Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Potential Annotation test harness
{
"@context": "https://github.io/w3c/annotation/testing/context.jsonld",
"id": "manifest-model",
"type": "mf:Manifest",
"label": "Web Annotation Data Model Tests",
"comment": "Runs a battery of test patterns against multiple annotations in JSON-LD format. Each test entry identifies a procedure for generating an annotation, and the results are matched against a set of patterns.",
"entries": [
{
"id": "manifest-model#test001",
"type": "ant:SchemaTest",
"name": "Simple Annotation",
"comment": "Tests run on the 'action' file, but could be specified by instructing an endpoint to deliver such a file to the testing framework, either manually or automatically",
"approval": "ant:Proposed",
"action": "test001-in.jsonld",
"result": [
"verify-context-present.json",
"verify-type-Annotation.json",
"verify-body-present-or-empty.json"
"verify-target-present.json",
]
}
]
}
{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno5",
"type":"Annotation",
"body": {
"type" : "TextualBody",
"text" : "<p>Comment text</p>",
"format" : "text/html",
"language" : "en"
},
"target": "http://example.org/photo1"
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Verify annotation has @context",
"type": "object",
"properties": {
"@context": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"anyOf": {
"type": "string"
}
}
],
"not": {"type": "object"}
}
},
"required": ["@context"]
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Verify annotation has @context",
"type": "object",
"properties": {
"type": {
"anyOf": [
{
"type": "string",
"pattern": "^Annotation$"
},
{
"type": "array",
"anyOf": {
"type": "string",
"pattern": "^Annotation$"
}
}
],
"not": {"type": "object"}
}
},
"required": ["type"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment