Demo for queries

This demo exposes the interface of the Anno.Queries API.

Demo

Load Fixture

Query

Help

It loads the fixtures of the Web Platform Tests for the Web Annotation Protocol via the Anno.Fixtures module.

Choose an annotation or write/paste your own in the textarea.

Then select a query type and choose whether to return the first, all or the count of return values.

HTML

See markdown source

Javascript

See /assets/js/queries.js for full source

function query() {
    const input = inputField.editor.getDoc().getValue()
    const anno = JSON.parse(input)
    const queryClass = queryClassList.value
    const method = methodList.value
    const result = Anno.Queries[queryClass][method](anno)
    resultField.innerHTML = JSON.stringify(result, null, 2)
}