Last active
April 25, 2016 12:17
-
-
Save gkellogg/4ff74c27313e95a6b3dcbad6cc64277a to your computer and use it in GitHub Desktop.
Potential Annotation test harness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@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", | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@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" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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