Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d

This commit is contained in:
Ms2ger 2016-11-14 11:07:09 +01:00
parent 65dd6d4340
commit ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions

View file

@ -53,6 +53,7 @@ Context](JSONtest-v1.jsonld). That context defines the following terms:
|description | string | A long self-describing paragraph that explains the purpose of the test and the expected input
|ref | URI | An optional reference to the portion of the specification to which the test relates
|testType | `automated`, `manual`, `ref` | The type of test - this informs [WPT](https://github.com/w3c/web-platform-tests) how the test should be controlled and presented
|skipFailures | list of strings | An optional list of assertionType values that, if present, should have their test skipped if the result would be "unexpected". Defaults to the empty list.
|assertions | list of URI, List @@@ATRISK@@@, or AssertionObject | The ordered collection of tests the input should be run against. See [JSON Schema Usage](#jsonSchema) for the structure of the objects. URI is relative to the top level folder of the test collection if it has a slash; relative to the current directory if it does not. @@@@ATRISK@@@@ Lists can be nested to define groups of sub-tests. Assertions / groups can be conditionally skipped. See [Assertion Lists](#assertionLists) for more details.
|content | URI or object | An object containing content to be checked against the referenced assertions, or a URI from which to retrieve that content
@ -71,9 +72,10 @@ Each test case has a suffix of `.test` and a shape like:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Verify annotation has target",
"type": "object",
"assertionType": "must",
"expectedResult": "valid",
"errorMessage": "The object was missing a required 'target' property",
"type": "object",
"properties": {
"target": {
"anyOf": [

View file

@ -12,12 +12,13 @@
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/specificResource.json",
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/id.json"
"definitions/collections.json"
];
var theTestFile="annotationMusts.test";

View file

@ -12,12 +12,13 @@
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/specificResource.json",
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/id.json"
"definitions/collections.json"
];
var theTestFile="annotationOptionals.test";

View file

@ -3,6 +3,7 @@
"name": "Annotation implements optional keys and meets optional key value constraints",
"description": "Web Annotations: <ul> <li>Should include certain properties (keys)</li> <li>May include additional keys</li> <li>should have Annotation key values that conform to model recommended constraints</li> </ul> Note: failing an assertion indicates that a recommended or optional feature has not been implemented or has not been implemented correctly.",
"testType": "manual",
"skipFailures": [ "should", "may" ],
"ref": "https://www.w3.org/TR/annotation-model/#other-properties",
"assertions": [
"annotations/3.3.1-annotationSingleCreatorImplemented.json",

View file

@ -12,12 +12,13 @@
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/specificResource.json",
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/id.json"
"definitions/collections.json"
];
var theTestFile="annotationsAgentOptionals.test";

View file

@ -3,6 +3,7 @@
"name": "Annotation implements optional keys and meets optional key value constraints for Creator and Generator Agents",
"description": "Agents (Creators, Generators) involved in an Annotation: <ul> <li>Should include certain properties (keys)</li> <li>May include additional keys</li> <li>should have Agent key values that conform to model recommended constraints</li> </ul> Note: failing an assertion indicates that a recommended or optional feature has not been implemented or has not been implemented correctly.",
"testType": "manual",
"skipFailures": [ "should", "may" ],
"ref": "https://www.w3.org/TR/annotation-model/#other-properties",
"assertions":
[

View file

@ -13,15 +13,15 @@
"target":
{
"allOf": [
{ "not": { "$ref": "bodyTarget.json#/definitions/embeddedTextTypeIncludesTextualBody" } },
{ "not": { "$ref": "bodyTarget.json#/definitions/itemEmbeddedTextTypeIncludesTextualBody" } },
{ "not": { "$ref": "bodyTarget.json#/definitions/embeddedTextTypeInclTextualBodyWithoutId" } },
{ "not": { "$ref": "bodyTarget.json#/definitions/itemEmbeddedTextTypeInclTextualBodyWithoutId" } },
{
"items":
{ "not":
{ "anyOf":
[
{ "$ref": "bodyTarget.json#/definitions/embeddedTextTypeIncludesTextualBody" },
{ "$ref": "bodyTarget.json#/definitions/itemEmbeddedTextTypeIncludesTextualBody" }
{ "$ref": "bodyTarget.json#/definitions/embeddedTextTypeInclTextualBodyWithoutId" },
{ "$ref": "bodyTarget.json#/definitions/itemEmbeddedTextTypeInclTextualBodyWithoutId" }
]
}
}

View file

@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-collectionCreatedImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Valid Annotation Collection-level created key not found. Annotation Collection may have exactly one created key value.",
"title": "Implements Annotation Collection-level **_created_ key** which has a **single value** that is a **string of format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when the Annotation Collection implements exactly one created key value (Sections 3.3.1 and 5.1)",
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/createdValidIfPresent"},
{ "type": "object",
"required" : [ "created" ]
}
]
}

View file

@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-collectionCreatedValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection has multiple created key values or a single created key value that is not of format date-time.",
"title": "If present the Annotation Collection-level **_created_ key** has a **single value** that is of **format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when no Annotation Collection created key present or when created key has a single value that is of format date-time (Section 3.3.1)",
"type": "object",
"allOf": [
{ "$ref": "otherProperties.json#/definitions/createdValidIfPresent" }
]
}

View file

@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-collectionCreatorImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Collection creator key not found. Annotation Collection may have zero or more creators.",
"title": "Implements **Annotation Collection _creator_ key** which has one or more values, each of which is a **string of format uri** or an **object** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when the Annotation Collection implements creator key (Section 3.3.1)",
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/creatorValidIfPresent"},
{ "type": "object",
"required": [ "creator" ] }
]
}

View file

@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-collectionModifiedImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Valid Annotation Collection-level modified key not found. Annotation Collection may have zero or exactly one modified key value.",
"title": "Implements Annotation Collection-level **_modified_ key** which has a **single value** that is a **string of format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when the Annotation Collection implements exactly one modified key value (Section 3.3.1, 5.1)",
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent"},
{ "type": "object",
"required": [ "modified" ] }
]
}

View file

@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-collectionModifiedValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection has multiple modified key values or a single modified key value that is not of format date-time.",
"title": "If present the Annotation Collection-level **_modified_ key** has a **single value** that is of **format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when no Annotation Collection modified key present or when modified key has a single value that is of format date-time (Section 3.3.1)",
"type": "object",
"allOf": [
{ "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent" }
]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentEmailImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Email for Annotation Collection Creator (Agent) not found. Agents may have one or more email values.",
"title": "Implements Annotation Collection-level creator (Agent) **_email_ key** with one or more values, each of which is a **mailto: uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more email values for Annotation Collection Creator (Agent) is implemented (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentEmailFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentEmailFound" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentEmail_sha1Implemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Email_sha1 for Annotation Collection Creator (Agent) not found. Agents may have one or more email_sha1 values.",
"title": "Implements Annotation Collection-level creator (Agent) **email_sha1 key** with one or more values - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more email_sha1 values for Annotation Collection Creator (Agent) is implemented (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentEmail_sha1Found" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentEmail_sha1Found" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentHomepageImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Homepage for Annotation Collection Creator (Agent) not found. Agents may have one or more homepage values.",
"title": "Implements Annotation Collection-level creator (Agent) **_homepage_ key** with one or more values, each of which is a **string of format uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more homepage values for Annotation Collection Creator (Agent) is implemented (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentHomepageFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentHomepageFound" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentIdImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Id for Annotation Collection Creator (Agent) not found or more than 1 found. Agents should have exactly one id of format uri.",
"title": "Implements Annotation Collection-level creator (Agent) **_id_ key** with **single value** that is a **string of format uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when type for Annotation Collection Creator (Agent) has exactly one id (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "id.json#/definitions/idValueFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "id.json#/definitions/idValueFound" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentNameImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Name for Annotation Collection Creator (Agent) not found. Agents may have one or more name values.",
"title": "Implements Annotation Collection-level creator (Agent) **_name_ key** with one or more values - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more name values for Annotation Collection Creator (Agent) is implemented (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentNameFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentNameFound" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentNicknameImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Nickname for Annotation Collection Creator (Agent) not found. Agents should have exactly one nickname value.",
"title": "Implements Annotation Collection-level creator (Agent) **_nickname_ key** with a **single value** that is a string - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when exactly one nickname for Annotation Collection Creator (Agent) is implemented (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentSingularNicknameFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentSingularNicknameFound" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-collectionCreatorAgentTypeImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Type (Person, Organization, Software) for Annotation Collection Creator (Agent) not found. Agents should have one or more type values.",
"title": "Implements Annotation Collection-level creator (Agent) **_type_ key** with one or more values from **model-recommended list (Person, Organization, Software)** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when type for Annotation Collection Creator (Agent) is implemented (Section 3.3.2)",
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentTypeFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentTypeFound" } } }
}
]
}
},
"required": ["creator"]
}

View file

@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.6-collectionRightsImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Collection-level rights key having string value(s) of format uri not found. Annotation Collection may have zero or more rights key values.",
"title": "Implements Annotation Collection-level **_rights_** key which has one or more values, each of which is a **string of format uri** - [model 3.3.6](https://www.w3.org/TR/annotation-model/#rights-information)",
"description": "True when the Annotation Collection implements rights key with with string(s) of format uri value(s) (Sections 5.1 and 3.3.6)",
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/rightsValidIfPresent"},
{ "type": "object",
"required": [ "rights" ]}
]
}

View file

@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.6-collectionRightsValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection Collection has one or more values for the rights key that are not strings of format uri.",
"title": "If present the Annotation Collection Collection-level **_rights_ key** has values that are all **strings of format uri** - [model 3.3.6](https://www.w3.org/TR/annotation-model/#rights-information)",
"description": "True when no Annotation Collection Collection rights key present or when all values of rights key are strings of format uri (Section 3.3.6)",
"type": "object",
"allOf": [
{ "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" }
]
}

View file

@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionContextValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection is missing @context key or 'http://www.w3.org/ns/anno.jsonld' is not a value of @context.",
"title": "Implements **_@context_ key** and '**http://www.w3.org/ns/anno.jsonld**' is **a value of _@context_** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"description": "True when the Annotation Collection has @context key and 'http://www.w3.org/ns/anno.jsonld' is an @context value (Section 5.1)",
"type": "object",
"required": [ "@context" ],
"properties": {
"@context": {
"oneOf": [
{ "$ref": "collections.json#/definitions/contextValueFound" },
{ "$ref": "collections.json#/definitions/contextValueInArrayFound" }
]
}
}
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionFirstImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Collection is allowed exactly one first key.",
"title": "Implements **Annotation Collection _first_ key** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/firstFound"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionFirstValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection has invalid first key or has total value more than zero without a valid first key.",
"title": "**Annotation Collection has _first_ key**, or no **_total_ key**, or **_total_ key** with value of zero - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/firstRequiredIfTotalMoreThanZero"
}

View file

@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionIdValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection is missing id key or value of id key is not a single string of format uri.",
"title": "Implements **Annotation Collection _id_ key** which has a **single value** that is a **string of format uri** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"description": "True when the Annotation Collection has a single id that is a string of format uri (Section 5.1)",
"$ref": "id.json#/definitions/idValueFound"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionLabelImplemented.json",
"assertionType": "should",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Collection should have a label key.",
"title": "Implements **Annotation Collection _label_ key** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/labelFound"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionLabelValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection has label key with non-string value or an array as value containing non-string value.",
"title": "**Annotation Collection _label_ key**, if present, is **a value of type string** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/labelDefinition"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionLastImplemented.json",
"assertionType": "should",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Collection should include exactly one last key with value that is string of uri format.",
"title": "Implements **Annotation Collection _last_ key** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/lastFound"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionLastValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection has last key with non-uri value or array as value containing more than one item.",
"title": "**Annotation Collection _last_ key**, if present, is **a single value of format uri** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/lastValidIfPresent"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionTotalImplemented.json",
"assertionType": "should",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Collection should include exactly one total key with non-negative numeric value.",
"title": "Implements **Annotation Collection _total_ key** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/totalFound"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionTotalValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection has total key with non-numeric value, a negative numeric value, or more than one value.",
"title": "**Annotation Collection _total_ key**, if present, is **a non-negative integer value** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/totalDefinition"
}

View file

@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.1-collectionTypeValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Collection is missing type key or 'AnnotationCollection' is not a value of type.",
"title": "Implements **Annotation Collection _type_ key** such that '**AnnotationCollection**' is **a value of _type_** - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"$ref": "collections.json#/definitions/annotationCollectionTypeValueFound"
}

View file

@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<title>A single Annotation Collection has all required keys and all collection keys used meet required value constraints</title>
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/annotation-model/scripts/ajv.min.js"></script>
<script src="/annotation-model/scripts/showdown.min.js"></script>
<script src="/annotation-model/scripts/JSONtest.js"></script>
<script>
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/collections.json"
];
var theTestFile="collectionMusts.test";
var runningTest = new JSONtest( {
"testInput" : "annotation-input",
"runTest" : "annotation-run",
"closeWindow" : "annotation-close",
"schemaDefs" : theDefinitions,
"testFile" : theTestFile
} ) ;
</script>
</head>
<body>
<p>Fill the textarea below with JSON output from your annotation client
implementation that supports the following criteria:</p>
<div id="testDescription"></div>
<form name="annotation" id="annotation">
<textarea name="annotation-input" id="annotation-input" style="width: 90%; height: 10em" ></textarea>
<p><input type="button" id="annotation-run" name="Loading..." value="Loading...">
<input style="display: none" type="button" id="annotation-close"
name="Close" value="Close"></p>
</form>
<p>Specifically, the following assertions will be evaluated:</p>
<div id="assertion"></div>
</body>
</html>

View file

@ -0,0 +1,19 @@
{
"@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
"name": "A single Annotation Collection has all required keys and all collection keys used meet required value constraints",
"description": "Collections of Web Annotations: <ul> <li>MUST include certain properties (keys)</li> <li>MUST satisfy model constraints on values of required and any optional Annotation keys used</li> </ul> Note: Implementation of optional Annotation Collection keys (features), optional constraints on key values, and optional keys and constraints on Agents involved in an Annotation Collection checked by other tests.<br/><b>Please fill textarea with json-ld serialization of a single Annotation Collection description</b>",
"testType": "manual",
"ref": "https://www.w3.org/TR/annotation-model/",
"assertions": [
"collections/5.1-collectionContextValidated.json",
"collections/5.1-collectionIdValidated.json",
"collections/5.1-collectionTypeValidated.json",
"collections/5.1-collectionLabelValidated.json",
"collections/5.1-collectionTotalValidated.json",
"collections/5.1-collectionFirstValidated.json",
"collections/5.1-collectionLastValidated.json",
"collections/3.3.1-collectionCreatedValidated.json",
"collections/3.3.1-collectionModifiedValidated.json",
"collections/3.3.6-collectionRightsValidated.json"
]
}

View file

@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<title>A single Annotation Collection implements optional keys and meets optional key value constraints</title>
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/annotation-model/scripts/ajv.min.js"></script>
<script src="/annotation-model/scripts/showdown.min.js"></script>
<script src="/annotation-model/scripts/JSONtest.js"></script>
<script>
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/collections.json"
];
var theTestFile="collectionOptionals.test";
var runningTest = new JSONtest( {
"testInput" : "annotation-input",
"runTest" : "annotation-run",
"closeWindow" : "annotation-close",
"schemaDefs" : theDefinitions,
"testFile" : theTestFile
} ) ;
</script>
</head>
<body>
<p>Fill the textarea below with JSON output from your annotation client
implementation that supports the following criteria:</p>
<div id="testDescription"></div>
<form name="annotation" id="annotation">
<textarea name="annotation-input" id="annotation-input" style="width: 90%; height: 10em" ></textarea>
<p><input type="button" id="annotation-run" name="Loading..." value="Loading...">
<input style="display: none" type="button" id="annotation-close"
name="Close" value="Close"></p>
</form>
<p>Specifically, the following assertions will be evaluated:</p>
<div id="assertion"></div>
</body>
</html>

View file

@ -0,0 +1,24 @@
{
"@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
"name": "A single Annotation Collection implements optional keys and meets optional key value constraints",
"description": "A Collection of Web Annotations: <ul> <li>Should include certain properties (keys)</li> <li>May include additional keys</li> <li>May have creator Agent key values that conform to model recommended constraints</li></ul> Note: failing an assertion indicates only that a recommended or optional feature has not been implemented or has not been implemented correctly. <br/><b>Please fill textarea with json-ld serialization of a single Annotation Collection description</b>",
"testType": "manual",
"ref": "https://www.w3.org/TR/annotation-model/",
"assertions": [
"collections/5.1-collectionLabelImplemented.json",
"collections/5.1-collectionLastImplemented.json",
"collections/5.1-collectionTotalImplemented.json",
"collections/5.1-collectionFirstImplemented.json",
"collections/3.3.1-collectionModifiedImplemented.json",
"collections/3.3.1-collectionCreatorImplemented.json",
"collections/3.3.1-collectionCreatedImplemented.json",
"collections/3.3.6-collectionRightsImplemented.json",
"collections/3.3.2-collectionCreatorAgentEmail_sha1Implemented.json",
"collections/3.3.2-collectionCreatorAgentEmailImplemented.json",
"collections/3.3.2-collectionCreatorAgentHomepageImplemented.json",
"collections/3.3.2-collectionCreatorAgentIdImplemented.json",
"collections/3.3.2-collectionCreatorAgentNameImplemented.json",
"collections/3.3.2-collectionCreatorAgentNicknameImplemented.json",
"collections/3.3.2-collectionCreatorAgentTypeImplemented.json"
]
}

View file

@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-pageCreatedImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Valid Annotation Page-level created key not found. Annotation Page may have exactly one created key value inherited from Collection.",
"title": "Implements Annotation Page-level **_created_ key** which has a **single value** that is a **string of format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when the Annotation Page implements exactly one created key value (Sections 3.3.1 and 5.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/createdImplemented" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/createdImplemented" }
},
"required": [ "first" ]
}
],
"definitions":
{
"createdImplemented":
{
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/createdValidIfPresent"},
{ "type": "object",
"required" : [ "created" ]
}
]
}
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-pageCreatedValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation page has multiple created key values or a single created key value that is not of format date-time.",
"title": "If present the Annotation page-level **_created_ key** has a **single value** that is of **format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when no Annotation page created key present or when created key has a single value that is of format date-time (Section 3.3.1)",
"type": "object",
"oneOf": [
{ "allOf": [
{ "$ref": "otherProperties.json#/definitions/createdValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "properties":
{"first":
{ "$ref": "otherProperties.json#/definitions/createdValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-pageCreatorImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Valid Annotation Page-level creator key not found. Annotation Page may have zero or more creators inherited from Collection.",
"title": "Implements **Annotation Page-level _creator_ key** which has one or more values, each of which is a **string of format uri** or an **object** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when the Annotation Page implements creator key (Section 3.3.1)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorImplemented" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorImplemented" }
},
"required": [ "first" ]
}
],
"definitions":
{
"creatorImplemented":
{
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/creatorValidIfPresent"},
{ "type": "object",
"required": [ "creator" ] }
]
}
}
}

View file

@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-pageModifiedImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Valid Annotation Page-level modified key not found. Annotation Page may have zero or exactly one modified key value inherited from Collection.",
"title": "Implements Annotation Page-level **_modified_ key** which has a **single value** that is a **string of format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when the Annotation Page implements exactly one modified key value (Section 3.3.1, 5.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/modifiedImplemented" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/modifiedImplemented" }
},
"required": [ "first" ]
}
],
"definitions":
{
"modifiedImplemented":
{
"allOf":
[
{ "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent"},
{ "type": "object",
"required": [ "modified" ] }
]
}
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.1-pageModifiedValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation page has multiple modified key values or a single modified key value that is not of format date-time.",
"title": "If present the Annotation page-level **_modified_ key** has a **single value** that is of **format date-time** - [model 3.3.1](https://www.w3.org/TR/annotation-model/#lifecycle-information)",
"description": "True when no Annotation page modified key present or when modified key has a single value that is of format date-time (Section 3.3.1)",
"type": "object",
"oneOf": [
{ "allOf": [
{ "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "properties":
{"first":
{ "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentEmailImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Email for Annotation Page Creator (Agent), inherited from Collection, not found. Agents may have one or more email values.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **_email_ key** with one or more values, each of which is a **mailto: uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more email values for Annotation Page Creator (Agent), inherited from Collection, is implemented (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentEmailFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentEmailFound" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentEmailFound":
{ "properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentEmailFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentEmailFound" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentEmail_sha1Implemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Email_sha1 for Annotation Page Creator (Agent), inherited from Collection, not found. Agents may have one or more email_sha1 values.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **email_sha1 key** with one or more values - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more email_sha1 values for Annotation Page Creator (Agent), inherited from Collection, is implemented (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentEmail_sha1Found" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentEmail_sha1Found" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentEmail_sha1Found":
{ "properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentEmail_sha1Found" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentEmail_sha1Found" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentHomepageImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Homepage for Annotation Page Creator (Agent), inherited from Collection, not found. Agents may have one or more homepage values.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **_homepage_ key** with one or more values, each of which is a **string of format uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more homepage values for Annotation Page Creator (Agent), inherited from Collection, is implemented (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentHomePageFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentHomePageFound" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentHomePageFound":
{ "properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentHomepageFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentHomepageFound" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentIdImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Single id for Annotation Page Creator (Agent), inherited from Collection, not found for any Creator. Agents should have exactly one id of format uri.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **_id_ key** with **single value** that is a **string of format uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when at least one Annotation Page Creator (Agent), inherited from Collection, has exactly one id (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentIdFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentIdFound" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentIdFound":
{
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "id.json#/definitions/idValueFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "id.json#/definitions/idValueFound" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentNameImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Name for Annotation Page Creator (Agent), inherited from Collection, not found. Agents may have one or more name values.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **_name_ key** with one or more values - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when one or more name values for Annotation Page Creator (Agent), inherited from Collection, is implemented (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentNameFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentNameFound" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentNameFound":
{ "properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentNameFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentNameFound" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,45 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentNicknameImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Single nickname for Annotation Page Creator (Agent), inherited from Collection, not found for any Creator. Agents should have exactly one id of format uri.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **_nickname_ key** with **single value** that is a **string of format uri** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when at least one Annotation Page Creator (Agent), inherited from Collection, has exactly one nickname (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentNicknameFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentNicknameFound" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentNicknameFound":
{
"properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentSingularNicknameFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentSingularNicknameFound" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.2-pageCreatorAgentTypeImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Type (Person, Organization, Software) for Annotation Page Creator (Agent), inherited from Collection, not found. Agents should have one or more type values.",
"title": "Implements Annotation Page-level creator (Agent), inherited from Collection, **_type_ key** with one or more values from **model-recommended list (Person, Organization, Software)** - [model 3.2.2](https://www.w3.org/TR/annotation-model/#agents)",
"description": "True when type for Annotation Page Creator (Agent), inherited from Collection, is implemented (Section 3.3.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "#/definitions/creatorAgentNameFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "#/definitions/creatorAgentNameFound" }
},
"required": [ "first" ]
}
],
"definitions": {
"creatorAgentNameFound":
{ "properties":
{ "creator":
{ "oneOf":
[
{ "$ref": "otherProperties.json#/definitions/agentNameFound" },
{ "type": "array",
"minItems": 1,
"not":
{ "items": { "not": { "$ref": "otherProperties.json#/definitions/agentNameFound" } } }
}
]
}
},
"required": ["creator"]
}
}
}

View file

@ -0,0 +1,31 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.6-pageRightsImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page rights key (inherited from Collection) having string value(s) of format uri not found. Annotation Page may may have zero or more rights key values.",
"title": "Implements Annotation Page **_rights_** key (inherited from Collection) which has one or more values, each of which is a **string of format uri** - [model 3.3.6](https://www.w3.org/TR/annotation-model/#rights-information)",
"description": "True when the Annotation Page implements rights key with with string(s) of format uri value(s) (Sections 5.1 and 3.3.6)",
"oneOf": [
{ "allOf": [
{ "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" },
{ "type": "object",
"required": [ "rights" ]},
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "allOf": [
{ "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" },
{ "type": "object",
"required": [ "rights" ]}
]
}
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "3.3.6-pageRightsValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation page page has one or more values for the rights key that are not strings of format uri.",
"title": "If present the Annotation page page-level **_rights_ key** has values that are all **strings of format uri** - [model 3.3.6](https://www.w3.org/TR/annotation-model/#rights-information)",
"description": "True when no Annotation page page rights key present or when all values of rights key are strings of format uri (Section 3.3.6)",
"type": "object",
"oneOf": [
{ "allOf": [
{ "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "properties":
{"first":
{ "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageContextValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page/Collection is missing @context key or 'http://www.w3.org/ns/anno.jsonld' is not a value of @context.",
"title": "Implements **Annotation Page** (or Annotation Collection for embedded Page) **_@context_ key** and '**http://www.w3.org/ns/anno.jsonld**' is **a value of _@context_** - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"description": "True when the Annotation Page/Collection has @context key and 'http://www.w3.org/ns/anno.jsonld' is an @context value (Section 5.2)",
"type": "object",
"required": [ "@context" ],
"properties": {
"@context": {
"oneOf": [
{ "$ref": "collections.json#/definitions/contextValueFound" },
{ "$ref": "collections.json#/definitions/contextValueInArrayFound" }
]
}
}
}

View file

@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageFirstImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no first key (inherited from Collection).",
"title": "Implements **Annotation Page _first_ key** (inherited from Collection) with valid value - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/firstFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/firstFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageFirstValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has invalid first key.",
"title": "**Annotation Page _first_ key** (inherited from Collection), if present, has value of string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/firstValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/firstValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageIdValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page is missing id key or value of id key is not a single string of format uri.",
"title": "Implements **Annotation Page _id_ key** which has a **single value** that is a **string of format uri** - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"description": "True when the Annotation Page has a single id that is a string of format uri (Section 5.2)",
"oneOf": [
{ "allOf": [
{ "$ref": "id.json#/definitions/idValueFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "id.json#/definitions/idValueFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageItemsValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page is missing items key or value of items key is not an array of strings of format uri and/or objects of type Annotation.",
"title": "Implements **Annotation Page _items_ key** such that value of items key is an array of strings of format uri and/or objects of type Annotation - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "$ref": "collections.json#/definitions/itemsFound" },
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/itemsFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageLabelImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no label key (inherited from Collection).",
"title": "Implements **Annotation Page _label_ key** (inherited from Collection) with valid value - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/labelFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/labelFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageLabelValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has label key with non-string value or an array as value containing non-string value.",
"title": "**Annotation Page _label_ key**, if present (inherited from Collection), is **a value of type string** - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/labelDefinition" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/labelDefinition" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageLastImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no last key (inherited from Collection).",
"title": "Implements **Annotation Page _last_ key** (inherited from Collection) with valid value - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/lastFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/lastFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageLastValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has last key with non-uri value or array as value containing more than one item.",
"title": "**Annotation Page _last_ key** (inherited from Collection), if present, is **a single value of format uri** - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/lastValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/lastValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageNextImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no next key.",
"title": "Implements **Annotation Page _next_ key** with valid value of string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "$ref": "collections.json#/definitions/nextFound" },
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/nextFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageNextValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has an invalid next value.",
"title": "True when **Annotation Page has no _next_ key** or has **_next_ key** with valid value of string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/nextValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/nextValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pagePartOfImplemented.json",
"assertionType": "should",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no partOf key.",
"title": "Implements **Annotation Page _partOf_ key** with valid value of string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "$ref": "collections.json#/definitions/partOfFound" },
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/partOfFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pagePartOfValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has an invalid partOf value.",
"title": "True when **Annotation Page has no _partOf_ key** or has **_partOf_ key** with valid value oof string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/partOfValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/partOfValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pagePrevImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no prev key.",
"title": "Implements **Annotation Page _prev_ key** with valid value of string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "$ref": "collections.json#/definitions/prevFound" },
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/prevFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pagePrevValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has an invalid prev value.",
"title": "True when **Annotation Page has no _prev_ key** or has **_prev_ key** with valid value of string of format uri - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/prevValidIfPresent" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/prevValidIfPresent" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageStartIndexImplemented.json",
"assertionType": "should",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has has no valid startIndex value.",
"title": "Implements **Annotation Page _startIndex_ key** with valid value of _type_ integer >= 0 - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "$ref": "collections.json#/definitions/startIndexFound" },
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/startIndexFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageStartIndexValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has an invalid startIndex value.",
"title": "True when **Annotation Page has no _startIndex_ key** or has **_startIndex_ key** with valid value of _type_ integer >= 0 - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/startIndexDefinition" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/startIndexDefinition" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageTotalImplemented.json",
"assertionType": "may",
"expectedResult": "valid",
"onUnexpectedResult" : "passAndContinue",
"errorMessage": "Annotation Page has no total key (inherited from Collection).",
"title": "Implements **Annotation Page _total_ key** (inherited from Collection) with valid value - [model 5.1](https://www.w3.org/TR/annotation-model/#annotation-collection)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/totalFound" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/totalFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageTotalValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page has total key with non-numeric value, a negative numeric value, or more than one value.",
"title": "**Annotation Page _total_ key**, if present (inherited from Collection), is **a non-negative integer value** - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "allOf": [
{ "$ref": "collections.json#/definitions/totalDefinition" },
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/totalDefinition" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "5.2-pageTypeValidated.json",
"assertionType": "must",
"expectedResult": "valid",
"onUnexpectedResult" : "failAndContinue",
"errorMessage": "ERROR: Annotation Page is missing type key or 'AnnotationPage' is not a value of type.",
"title": "Implements **Annotation Page _type_ key** such that '**AnnotationPage**' is **a value of _type_** - [model 5.2](https://www.w3.org/TR/annotation-model/#annotation-page)",
"oneOf": [
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" },
{ "type": "object",
"properties":
{"first":
{ "$ref": "collections.json#/definitions/annotationPageTypeValueFound" }
},
"required": [ "first" ]
}
]
}

View file

@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<title>A single Annotation Page has all required keys and all page keys present meet required value constraints</title>
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/annotation-model/scripts/ajv.min.js"></script>
<script src="/annotation-model/scripts/showdown.min.js"></script>
<script src="/annotation-model/scripts/JSONtest.js"></script>
<script>
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/collections.json"
];
var theTestFile="pageMusts.test";
var runningTest = new JSONtest( {
"testInput" : "annotation-input",
"runTest" : "annotation-run",
"closeWindow" : "annotation-close",
"schemaDefs" : theDefinitions,
"testFile" : theTestFile
} ) ;
</script>
</head>
<body>
<p>Fill the textarea below with JSON output from your annotation client
implementation that supports the following criteria:</p>
<div id="testDescription"></div>
<form name="annotation" id="annotation">
<textarea name="annotation-input" id="annotation-input" style="width: 90%; height: 10em" ></textarea>
<p><input type="button" id="annotation-run" name="Loading..." value="Loading...">
<input style="display: none" type="button" id="annotation-close"
name="Close" value="Close"></p>
</form>
<p>Specifically, the following assertions will be evaluated:</p>
<div id="assertion"></div>
</body>
</html>

View file

@ -0,0 +1,24 @@
{
"@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
"name": "A single Annotation Page has all required keys and all page keys present meet required value constraints",
"description": "Pages of Web Annotations: <ul> <li>MUST include certain properties (keys)</li> <li>MUST satisfy model constraints on values of required and any optional Annotation keys used</li> </ul> Note: Implementation of optional Annotation Collection keys (features), optional constraints on key values, and optional keys and constraints on Agents involved in an Annotation Collection checked by other tests.<br/><b>Please fill textarea with json-ld serialization of a single Annotation Page or an Annotation Collection with an embedded Page</b>",
"testType": "manual",
"ref": "https://www.w3.org/TR/annotation-model/",
"assertions": [
"collections/pages/5.2-pageContextValidated.json",
"collections/pages/5.2-pageIdValidated.json",
"collections/pages/5.2-pageTypeValidated.json",
"collections/pages/5.2-pageItemsValidated.json",
"collections/pages/5.2-pageStartIndexValidated.json",
"collections/pages/5.2-pagePartOfValidated.json",
"collections/pages/5.2-pageNextValidated.json",
"collections/pages/5.2-pagePrevValidated.json",
"collections/pages/5.2-pageTotalValidated.json",
"collections/pages/5.2-pageLabelValidated.json",
"collections/pages/5.2-pageFirstValidated.json",
"collections/pages/5.2-pageLastValidated.json",
"collections/pages/3.3.1-pageCreatedValidated.json",
"collections/pages/3.3.1-pageModifiedValidated.json",
"collections/pages/3.3.6-pageRightsValidated.json"
]
}

View file

@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<title>A single Annotation Page implements optional keys and meets optional key value constraints</title>
<link rel="stylesheet" href="/resources/testharness.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/annotation-model/scripts/ajv.min.js"></script>
<script src="/annotation-model/scripts/showdown.min.js"></script>
<script src="/annotation-model/scripts/JSONtest.js"></script>
<script>
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/choiceSet.json",
"definitions/id.json",
"definitions/bodyTarget.json",
"definitions/annotations.json",
"definitions/specificResource.json",
"definitions/otherProperties.json",
"definitions/collections.json"
];
var theTestFile="pageOptionals.test";
var runningTest = new JSONtest( {
"testInput" : "annotation-input",
"runTest" : "annotation-run",
"closeWindow" : "annotation-close",
"schemaDefs" : theDefinitions,
"testFile" : theTestFile
} ) ;
</script>
</head>
<body>
<p>Fill the textarea below with JSON output from your annotation client
implementation that supports the following criteria:</p>
<div id="testDescription"></div>
<form name="annotation" id="annotation">
<textarea name="annotation-input" id="annotation-input" style="width: 90%; height: 10em" ></textarea>
<p><input type="button" id="annotation-run" name="Loading..." value="Loading...">
<input style="display: none" type="button" id="annotation-close"
name="Close" value="Close"></p>
</form>
<p>Specifically, the following assertions will be evaluated:</p>
<div id="assertion"></div>
</body>
</html>

View file

@ -0,0 +1,28 @@
{
"@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
"name": "A single Annotation Page implements optional keys and meets optional key value constraints",
"description": "Pages of Web Annotations: <ul> <li>MUST include certain properties (keys)</li> <li>MUST satisfy model constraints on values of required and any optional Annotation keys used</li> </ul> Note: Implementation of optional Annotation Collection keys (features), optional constraints on key values, and optional keys and constraints on Agents involved in an Annotation Collection checked by other tests.<br/><b>Please fill textarea with json-ld serialization of a single Annotation Page or an Annotation Collection with an embedded Page</b>",
"testType": "manual",
"ref": "https://www.w3.org/TR/annotation-model/",
"assertions": [
"collections/pages/5.2-pagePartOfImplemented.json",
"collections/pages/5.2-pageStartIndexImplemented.json",
"collections/pages/5.2-pageNextImplemented.json",
"collections/pages/5.2-pagePrevImplemented.json",
"collections/pages/5.2-pageLabelImplemented.json",
"collections/pages/5.2-pageLastImplemented.json",
"collections/pages/5.2-pageTotalImplemented.json",
"collections/pages/5.2-pageFirstImplemented.json",
"collections/pages/3.3.1-pageModifiedImplemented.json",
"collections/pages/3.3.1-pageCreatorImplemented.json",
"collections/pages/3.3.1-pageCreatedImplemented.json",
"collections/pages/3.3.6-pageRightsImplemented.json",
"collections/pages/3.3.2-pageCreatorAgentEmail_sha1Implemented.json",
"collections/pages/3.3.2-pageCreatorAgentEmailImplemented.json",
"collections/pages/3.3.2-pageCreatorAgentHomepageImplemented.json",
"collections/pages/3.3.2-pageCreatorAgentIdImplemented.json",
"collections/pages/3.3.2-pageCreatorAgentNameImplemented.json",
"collections/pages/3.3.2-pageCreatorAgentNicknameImplemented.json",
"collections/pages/3.3.2-pageCreatorAgentTypeImplemented.json"
]
}

View file

@ -9,13 +9,12 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: External Web Resource",
"description": "True when the object is an External Web Resource, i.e., includes an id that is of format uri but does not contain value (Textual Body) or source (Specific Resource) keys (Sections 3.2.1, 3.2.4, 4).",
"description": "True when the object is an External Web Resource, i.e., includes an id that is of format uri but does not contain source (Specific Resource) keys (Sections 3.2.1, 3.2.4, 4).",
"type": "object",
"allOf": [ {"$ref": "id.json#/definitions/idValueFound"} ],
"not":
{ "anyOf":
[
{ "required": ["value"] },
{ "required": ["source"] },
{ "required": ["target"] }
]
@ -26,23 +25,23 @@
{
"type": "object",
"properties":
{
"source": {"$ref": "#/definitions/externalWebResourceDetected"}
}
{
"source": {"$ref": "#/definitions/externalWebResourceDetected"}
}
},
"itemEwrDetected":
{
"type": "object",
"properties":
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/externalWebResourceDetected" } } }
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/externalWebResourceDetected" } } }
}
}
}
},
"textualBodyFound" :
@ -65,14 +64,14 @@
{
"type": "object",
"properties":
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/textualBodyFound" } } }
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/textualBodyFound" } } }
}
}
}
},
"targetResourcesFound" :
@ -98,15 +97,15 @@
"title": "Definition: Resources that can be used as Body",
"description": "True when the string is format uri or the object is recognized as a valid body resource (Sections 3.2 and 4).",
"type" : ["string", "object"],
"oneOf": [
"anyOf": [
{"$ref": "id.json#/definitions/stringUri"},
{"$ref": "choiceSet.json#/definitions/choiceDetected" },
{"$ref": "choiceSet.json#/definitions/compositeDetected" },
{"$ref": "choiceSet.json#/definitions/independentsDetected" },
{"$ref": "choiceSet.json#/definitions/listDetected" },
{"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
{"$ref": "#/definitions/externalWebResourceDetected" },
{"$ref": "#/definitions/textualBodyFound" }
{"$ref": "choiceSet.json#/definitions/independentsDetected" },
{"$ref": "choiceSet.json#/definitions/listDetected" },
{"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
{"$ref": "#/definitions/externalWebResourceDetected" },
{"$ref": "#/definitions/textualBodyFound" }
]
},
@ -297,16 +296,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/recognizedTypeFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/recognizedTypeFound" } }
}
}
}
},
"required": ["items"]
},
@ -319,12 +318,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["type"] ,
"$ref": "#/definitions/resourceTypeRecognizedIfPresent"
}
"source":
{
"type": "object",
"required": ["type"] ,
"$ref": "#/definitions/resourceTypeRecognizedIfPresent"
}
},
"required": ["source"]
},
@ -408,16 +407,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/formatPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/formatPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -430,12 +429,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["format"] ,
"$ref": "#/definitions/formatValidIfPresent"
}
"source":
{
"type": "object",
"required": ["format"] ,
"$ref": "#/definitions/formatValidIfPresent"
}
},
"required": ["source"]
},
@ -466,16 +465,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/singleFormatPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/singleFormatPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -488,12 +487,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["format"] ,
"$ref": "#/definitions/formatSingularIfPresent"
}
"source":
{
"type": "object",
"required": ["format"] ,
"$ref": "#/definitions/formatSingularIfPresent"
}
},
"required": ["source"]
},
@ -582,16 +581,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/languagePropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/languagePropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -604,12 +603,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["language"] ,
"$ref": "#/definitions/languageValidIfPresent"
}
"source":
{
"type": "object",
"required": ["language"] ,
"$ref": "#/definitions/languageValidIfPresent"
}
},
"required": ["source"]
},
@ -640,16 +639,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/singleLanguagePropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/singleLanguagePropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -662,12 +661,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["language"] ,
"$ref": "#/definitions/languageSingularIfPresent"
}
"source":
{
"type": "object",
"required": ["language"] ,
"$ref": "#/definitions/languageSingularIfPresent"
}
},
"required": ["source"]
},
@ -720,16 +719,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/processingLanguagePropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/processingLanguagePropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -742,12 +741,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["processingLanguage"] ,
"$ref": "#/definitions/processingLanguageValidIfPresent"
}
"source":
{
"type": "object",
"required": ["processingLanguage"] ,
"$ref": "#/definitions/processingLanguageValidIfPresent"
}
},
"required": ["source"]
},
@ -802,16 +801,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/textDirectionPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/textDirectionPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -824,12 +823,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["textDirection"] ,
"$ref": "#/definitions/textDirectionValidIfPresent"
}
"source":
{
"type": "object",
"required": ["textDirection"] ,
"$ref": "#/definitions/textDirectionValidIfPresent"
}
},
"required": ["source"]
},
@ -848,9 +847,9 @@
{
"type": "object",
"properties":
{
"source": {"$ref": "#/definitions/ewrWithItems"}
},
{
"source": {"$ref": "#/definitions/ewrWithItems"}
},
"required": ["source"]
},
@ -858,14 +857,14 @@
{
"type": "object",
"properties":
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/ewrWithItems" } } }
}
},
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/ewrWithItems" } } }
}
},
"required": ["items"]
},
@ -882,9 +881,9 @@
{
"type": "object",
"properties":
{
"source": {"$ref": "#/definitions/ewrWithPurpose"}
},
{
"source": {"$ref": "#/definitions/ewrWithPurpose"}
},
"required": ["source"]
},
@ -892,14 +891,14 @@
{
"type": "object",
"properties":
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/ewrWithPurpose" } } }
}
},
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/ewrWithPurpose" } } }
}
},
"required": ["items"]
},
@ -916,14 +915,14 @@
{
"type": "object",
"properties":
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/embeddedTextualBodyWithItems" } } }
}
},
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/embeddedTextualBodyWithItems" } } }
}
},
"required": ["items"]
},
@ -940,109 +939,158 @@
{
"type": "object",
"properties":
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/embeddedTextualBodyWithSource" } } }
}
},
{
"items": {
"type": "array",
"minItems": 1,
"not":
{ "items": {"not": { "$ref": "#/definitions/embeddedTextualBodyWithSource" } } }
}
},
"required": ["items"]
},
"embeddedTextTypeIncludesTextualBody":
{
"allOf":
"allOf":
[
{ "$ref": "#/definitions/textualBodyFound" },
{ "required": ["type"] },
{ "properties":
{
"type":
{
"oneOf":
[
{ "type": "string",
"enum": ["TextualBody"] },
{ "type": "array",
"minItems": 1,
"not":
{ "items":
{ "not": { "enum": [ "TextualBody"] } }
}
}
]
}
{ "$ref": "#/definitions/textualBodyFound" },
{ "required": ["type"] },
{ "properties":
{
"type":
{
"oneOf":
[
{ "type": "string",
"enum": ["TextualBody"] },
{ "type": "array",
"minItems": 1,
"not":
{ "items":
{ "not": { "enum": [ "TextualBody"] } }
}
}
]
}
}
}
}
]
]
},
"embeddedTextTypeInclTextualBodyWithoutId":
{
"allOf":
[
{ "$ref": "#/definitions/textualBodyFound" },
{ "required": ["type"] },
{ "properties":
{
"type":
{
"oneOf":
[
{ "type": "string",
"enum": ["TextualBody"] },
{ "type": "array",
"minItems": 1,
"not":
{ "items":
{ "not": { "enum": [ "TextualBody"] } }
}
}
]
}
}
},
{ "not": { "$ref": "id.json#/definitions/idValueFound" } }
]
},
"itemEmbeddedTextTypeIncludesTextualBody":
{
"type": "object",
"properties":
{
"items":
"type": "object",
"properties":
{
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/embeddedTextTypeIncludesTextualBody" } }
}
}
},
"required": ["items"]
"items":
{
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/embeddedTextTypeIncludesTextualBody" } }
}
}
},
"required": ["items"]
},
"embeddedTextTypeIncludesText":
"itemEmbeddedTextTypeInclTextualBodyWithoutId":
{
"allOf":
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/embeddedTextTypeIncludesTextualBody" } }
}
}
},
"required": ["items"],
"not": { "$ref": "id.json#/definitions/idValueFound" }
},
"embeddedTextTypeIncludesText":
{
"allOf":
[
{ "$ref": "#/definitions/textualBodyFound" },
{ "required": ["type"] },
{ "properties":
{
"type":
{ "$ref": "#/definitions/textualBodyFound" },
{ "required": ["type"] },
{ "properties":
{
"oneOf":
[
{ "type": "string",
"enum": ["Text"] },
{ "type": "array",
"minItems": 1,
"not":
{ "items":
{ "not": { "enum": [ "Text"] } }
}
}
]
"type":
{
"oneOf":
[
{ "type": "string",
"enum": ["Text"] },
{ "type": "array",
"minItems": 1,
"not":
{ "items":
{ "not": { "enum": [ "Text"] } }
}
}
]
}
}
}
}
]
]
},
"itemEmbeddedTextTypeIncludesText":
{
"type": "object",
"properties":
{
"items":
"type": "object",
"properties":
{
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/embeddedTextTypeIncludesText" } }
}
}
},
"required": ["items"]
"items":
{
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/embeddedTextTypeIncludesText" } }
}
}
},
"required": ["items"]
}
}

View file

@ -21,14 +21,14 @@
"items": {
"oneOf":
[
{ "$ref": "specificResource.json#/definitions/specificeResourceDetected" },
{ "$ref": "bodyTarget.json#/definitions/externalWebResourceDetected" },
{ "$ref": "bodyTarget.json#/definitions/textualBodyFound" },
{ "$ref": "specificResource.json#/definitions/specificeResourceDetected" },
{ "$ref": "bodyTarget.json#/definitions/externalWebResourceDetected" },
{ "$ref": "bodyTarget.json#/definitions/textualBodyFound" },
{ "$ref": "id.json#/definitions/stringUri" },
{ "allOf":
[
{ "$ref" : "#/definitions/choiceOrSetTypeDefinition" },
{ "$ref": "#/definitions/itemsDetected" }
{ "$ref" : "#/definitions/choiceOrSetTypeDefinition" },
{ "$ref": "#/definitions/itemsDetected" }
]
}
]
@ -108,19 +108,19 @@
"choiceOrSetTypeDefinition":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Choice or Set type",
"description": "True when object has type key and object's type is any of 'Choice', 'Composite', 'List', 'Independents' (Section 3.2.7)",
"type": "object",
"properties":
{
"type":
{
"type": "string",
"enum": ["Choice", "Composite", "List", "Independents"]
}
},
"required": [ "type" ]
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Choice or Set type",
"description": "True when object has type key and object's type is any of 'Choice', 'Composite', 'List', 'Independents' (Section 3.2.7)",
"type": "object",
"properties":
{
"type":
{
"type": "string",
"enum": ["Choice", "Composite", "List", "Independents"]
}
},
"required": [ "type" ]
},
"choiceDetected": {
@ -178,36 +178,36 @@
"type": "object",
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetTypeDefinition" },
{ "$ref": "#/definitions/itemsDetected" }
{ "$ref": "#/definitions/choiceOrSetTypeDefinition" },
{ "$ref": "#/definitions/itemsDetected" }
]
},
"choiceSetWithValue" :
{
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetDetected" },
{ "required": [ "value" ] }
]
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetDetected" },
{ "required": [ "value" ] }
]
},
"choiceSetWithSource" :
{
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetDetected" },
{ "required": [ "source" ] }
]
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetDetected" },
{ "required": [ "source" ] }
]
},
"choiceSetWithPurpose" :
{
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetDetected" },
{ "required": [ "purpose" ] }
]
"allOf":
[
{ "$ref": "#/definitions/choiceOrSetDetected" },
{ "required": [ "purpose" ] }
]
}
}

View file

@ -0,0 +1,428 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "collections.json",
"title": "Definitions: Annotation Collections.",
"description": "Schemas in #/definitions detect or validate keys/objects (direct children) uniquely used to describe Annotation Collections (Section 5.1 and 5.2).",
"definitions": {
"contextValueFound": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Valid @context string included in Collection / Page description",
"description": "True when the string has value http://www.w3.org/ns/anno.jsonld (Section 5)",
"type": "string",
"enum": [ "http://www.w3.org/ns/anno.jsonld" ]
},
"contextValueInArrayFound": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Valid @context string found in array included in Collection / Page description",
"description": "True when the array contains a string item having value http://www.w3.org/ns/anno.jsonld (Section 5)",
"type": "array",
"not":
{ "items":
{ "not":
{ "$ref": "#/definitions/contextValueFound" }
}
}
},
"annotationCollectionTypeValueRecognized": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Valid AnnotationCollection type value string included in Collection description",
"description": "True when the string has value 'AnnotationCollection' (Section 5.1)",
"type": "string",
"enum": [ "AnnotationCollection" ]
},
"annotationCollectionTypeValueInArrayRecognized": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Valid AnnotationCollection type in array included in Collection description",
"description": "True when the array contains a string item having value 'AnnotationCollection' (Section 5.1)",
"type": "array",
"not":
{ "items":
{ "not":
{ "$ref": "#/definitions/annotationCollectionTypeValueRecognized" }
}
}
},
"annotationCollectionTypeValueFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Implementation: AnnotationCollection type",
"description": "True when the Annotation Collection has type key and 'AnnotationCollection' is a value of type (Section 5.1)",
"type": "object",
"required": [ "type" ],
"properties": {
"type": {
"oneOf": [
{ "$ref": "#/definitions/annotationCollectionTypeValueRecognized" },
{ "$ref": "#/definitions/annotationCollectionTypeValueInArrayRecognized" }
]
}
}
},
"annotationPageTypeValueRecognized": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Valid AnnotationPage type value string included in Page description",
"description": "True when the string has value 'AnnotationPage' (Section 5.2)",
"type": "string",
"enum": [ "AnnotationPage" ]
},
"annotationPageTypeValueInArrayRecognized": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: Valid AnnotationPage type in array included in Page description",
"description": "True when the array contains a string item having value 'AnnotationPage' (Section 5.2)",
"type": "array",
"not":
{ "items":
{ "not":
{ "$ref": "#/definitions/annotationPageTypeValueRecognized" }
}
}
},
"annotationPageTypeValueFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Implementation: AnnotationPage type",
"description": "True when the Annotation Page has type key and 'AnnotationPage' is a value of type (Section 5.2)",
"type": "object",
"required": [ "type" ],
"properties": {
"type": {
"oneOf": [
{ "$ref": "#/definitions/annotationPageTypeValueRecognized" },
{ "$ref": "#/definitions/annotationPageTypeValueInArrayRecognized" }
]
}
}
},
"labelDefinition":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: label (Annotation Collections)",
"description": "True when the object has no label or has one or more label values of type string (Section 5.1)",
"type": "object",
"properties":
{
"label":
{
"oneOf":
[
{"type": "string" },
{"type": "array",
"minItems": 1,
"items": {"type": "string"}
}
]
}
}
},
"labelFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Collection label",
"description": "True when the object has one or more label value(s) (Section 5.1)",
"allOf": [
{"required": ["label"]},
{"$ref": "#/definitions/labelDefinition"}
]
},
"totalDefinition":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: total (Annotation Collections)",
"description": "True when the object has no total key or has exactly one total value of type integer greater or equal to zero (Section 5.1)",
"type": "object",
"properties":
{
"total":
{
"oneOf":
[
{"type": "integer",
"minimum": 0 },
{"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {"type": "integer",
"minimum": 0 }
}
]
}
}
},
"totalFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Collection total key",
"description": "True when the object has exactly one total value (Section 5.1)",
"allOf": [
{"required": ["total"]},
{"$ref": "#/definitions/totalDefinition"}
]
},
"totalMoreThanZero":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: total more than zero (Annotation Collections)",
"description": "True when the object has exactly one total value of type integer and greater than zero (Section 5.1)",
"type": "object",
"properties":
{
"total":
{
"oneOf":
[
{"type": "integer",
"minimum": 0,
"exclusiveMinimum": true},
{"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {"type": "integer",
"minimum": 0,
"exclusiveMinimum": true}
}
]
}
},
"required": [ "total" ]
},
"firstValidIfPresent":
{ "$schema": "http://json-schema.org/draft-04/schema#",
"title": "Validation: first value (Annotation Collection)",
"description": "True when the Annotation Collection has no first key or has 1 first key value that is string of format uri or has first key value that is an object of type AnnotationPage (Section 5.1)",
"type": "object",
"properties": {"first":
{ "oneOf": [
{
"oneOf": [
{ "$ref": "id.json#/definitions/stringUri" },
{ "$ref": "#/definitions/annotationPageTypeValueFound" }
]
},
{ "type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"oneOf": [
{ "$ref": "id.json#/definitions/stringUri" },
{ "$ref": "#/definitions/annotationPageTypeValueFound" }
]
}
}
]
}
}
},
"firstFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Collection first key",
"description": "True when the object has exactly one first value (Section 5.1)",
"allOf": [
{"required": ["first"]},
{"$ref": "#/definitions/firstValidIfPresent"}
]
},
"firstRequiredIfTotalMoreThanZero":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "If total greater than zero, check for implementation of Annotation Collection first key",
"description": "True when the object has no total or has total = zero or has exactly one first value (Section 5.1)",
"type": "object",
"oneOf": [
{
"allOf": [
{ "$ref": "#/definitions/totalMoreThanZero" },
{ "$ref": "#/definitions/firstFound" }
]
},
{ "not": { "$ref": "#/definitions/totalMoreThanZero" } }
]
},
"lastValidIfPresent":
{ "$schema": "http://json-schema.org/draft-04/schema#",
"title": "Validation: last value (Annotation Collection)",
"description": "True when the Annotation Collection has no last key or has 1 last key value that is string of format uri (Section 5.1)",
"type": "object",
"properties": {"last":
{ "oneOf": [
{ "$ref": "id.json#/definitions/stringUri" },
{ "type": "array",
"minItems": 1,
"maxItems": 1,
"items": { "$ref": "id.json#/definitions/stringUri" }
}
]
}
}
},
"lastFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Collection last key",
"description": "True when the object has exactly one last value that is string of format uri (Section 5.1)",
"allOf": [
{"required": ["last"]},
{"$ref": "#/definitions/lastValidIfPresent"}
]
},
"partOfValidIfPresent":
{ "$schema": "http://json-schema.org/draft-04/schema#",
"title": "Validation: partOf value (Annotation Page)",
"description": "True when the Annotation Page has no partOf key or has 1 partOf key value that is string of format uri (Section 5.2)",
"type": "object",
"properties": {"partOf":
{ "oneOf": [
{ "$ref": "id.json#/definitions/arraySingleStringUri" },
{ "$ref": "id.json#/definitions/idValueFound" }
]
}
}
},
"partOfFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Page partOf key",
"description": "True when the object has exactly one partOf value that is string of format uri (Section 5.2)",
"allOf": [
{"required": ["partOf"]},
{"$ref": "#/definitions/partOfValidIfPresent"}
]
},
"nextValidIfPresent":
{ "$schema": "http://json-schema.org/draft-04/schema#",
"title": "Validation: next value (Annotation Page)",
"description": "True when the Annotation Page has no next key or has 1 next key value that is string of format uri (Section 5.2)",
"type": "object",
"properties": {"next":
{ "oneOf": [
{ "$ref": "id.json#/definitions/stringUri" },
{ "type": "array",
"minItems": 1,
"maxItems": 1,
"items": { "$ref": "id.json#/definitions/stringUri" }
}
]
}
}
},
"nextFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Page next key",
"description": "True when the object has exactly one next value that is string of format uri (Section 5.2)",
"allOf": [
{"required": ["next"]},
{"$ref": "#/definitions/nextValidIfPresent"}
]
},
"prevValidIfPresent":
{ "$schema": "http://json-schema.org/draft-04/schema#",
"title": "Validation: prev value (Annotation Page)",
"description": "True when the Annotation Page has no prev key or has 1 prev key value that is string of format uri (Section 5.2)",
"type": "object",
"properties": {"prev":
{ "oneOf": [
{ "$ref": "id.json#/definitions/stringUri" },
{ "type": "array",
"minItems": 1,
"maxItems": 1,
"items": { "$ref": "id.json#/definitions/stringUri" }
}
]
}
}
},
"prevFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Page prev key",
"description": "True when the object has exactly one prev value that is string of format uri (Section 5.2)",
"allOf": [
{"required": ["prev"]},
{"$ref": "#/definitions/prevValidIfPresent"}
]
},
"startIndexDefinition":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Definition: startIndex (Annotation Pages)",
"description": "True when the object has no startIndex key or has exactly one startIndex value of type integer greater or equal to zero (Section 5.2)",
"type": "object",
"properties":
{
"startIndex":
{
"oneOf":
[
{"type": "integer",
"minimum": 0 },
{"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {"type": "integer",
"minimum": 0 }
}
]
}
}
},
"startIndexFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Page startIndex key",
"description": "True when the object has exactly one startIndex value (Section 5.2)",
"allOf": [
{"required": ["startIndex"]},
{"$ref": "#/definitions/startIndexDefinition"}
]
},
"itemsFound":
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check for implementation of Annotation Page items key",
"description": "True when the object has items key with value that is an array of strings of format uri and/or objects of type Annotation (Section 5.2)",
"type": "object",
"properties":
{ "items":
{ "type": "array",
"items": {
"oneOf":[
{ "$ref": "annotations.json#/definitions/annotationTypeValueFound" },
{ "type": "string",
"format": "uri" }
]
}
}
},
"required": [ "items" ]
}
}
}

View file

@ -51,16 +51,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/createdPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/createdPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -73,12 +73,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["created"] ,
"$ref": "#/definitions/createdValidIfPresent"
}
"source":
{
"type": "object",
"required": ["created"] ,
"$ref": "#/definitions/createdValidIfPresent"
}
},
"required": ["source"]
},
@ -110,7 +110,7 @@
"title": "Collate: generated key with qualifying body/target classes",
"description": "Supports implementation check of generated (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
"oneOf": [
{"$ref": "annotations.json#/definitions/annotationTypeValueFound"}
{"$ref": "annotations.json#/definitions/annotationTypeValueFound"}
],
"allOf": [
{"$ref": "#/definitions/generatedValidIfPresent"},
@ -164,16 +164,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/modifiedPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/modifiedPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -186,12 +186,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["modified"] ,
"$ref": "#/definitions/modifiedValidIfPresent"
}
"source":
{
"type": "object",
"required": ["modified"] ,
"$ref": "#/definitions/modifiedValidIfPresent"
}
},
"required": ["source"]
},
@ -269,16 +269,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -291,12 +291,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["creator"] ,
"$ref": "#/definitions/creatorValidIfPresent"
}
"source":
{
"type": "object",
"required": ["creator"] ,
"$ref": "#/definitions/creatorValidIfPresent"
}
},
"required": ["source"]
},
@ -325,16 +325,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/singleCreatorPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/singleCreatorPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -347,12 +347,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["creator"] ,
"$ref": "#/definitions/creatorSingularIfPresent"
}
"source":
{
"type": "object",
"required": ["creator"] ,
"$ref": "#/definitions/creatorSingularIfPresent"
}
},
"required": ["source"]
},
@ -386,7 +386,7 @@
"title": "Collate: generator key with qualifying body/target classes",
"description": "Supports implementation check of generator (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Section 3.3.1)",
"oneOf": [
{"$ref": "annotations.json#/definitions/annotationTypeValueFound"}
{"$ref": "annotations.json#/definitions/annotationTypeValueFound"}
],
"allOf": [
{"required": ["generator"]},
@ -474,16 +474,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/audiencePropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/audiencePropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -496,12 +496,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["audience"] ,
"$ref": "#/definitions/audienceValidIfPresent"
}
"source":
{
"type": "object",
"required": ["audience"] ,
"$ref": "#/definitions/audienceValidIfPresent"
}
},
"required": ["source"]
},
@ -551,16 +551,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/accessibilityPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/accessibilityPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -573,12 +573,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["accessibility"] ,
"$ref": "#/definitions/accessibilityValidIfPresent"
}
"source":
{
"type": "object",
"required": ["accessibility"] ,
"$ref": "#/definitions/accessibilityValidIfPresent"
}
},
"required": ["source"]
},
@ -623,16 +623,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/rightsPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/rightsPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -645,12 +645,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["rights"] ,
"$ref": "#/definitions/rightsValidIfPresent"
}
"source":
{
"type": "object",
"required": ["rights"] ,
"$ref": "#/definitions/rightsValidIfPresent"
}
},
"required": ["source"]
},
@ -689,16 +689,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/canonicalPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/canonicalPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -711,12 +711,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["canonical"] ,
"$ref": "#/definitions/canonicalValidIfPresent"
}
"source":
{
"type": "object",
"required": ["canonical"] ,
"$ref": "#/definitions/canonicalValidIfPresent"
}
},
"required": ["source"]
},
@ -761,16 +761,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/viaPropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/viaPropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -783,12 +783,12 @@
"type": "object",
"properties":
{
"source":
{
"type": "object",
"required": ["via"] ,
"$ref": "#/definitions/viaValidIfPresent"
}
"source":
{
"type": "object",
"required": ["via"] ,
"$ref": "#/definitions/viaValidIfPresent"
}
},
"required": ["source"]
},
@ -831,16 +831,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/purposePropertyFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/purposePropertyFound" } }
}
}
}
},
"required": ["items"]
},
@ -866,11 +866,11 @@
"sourceCreatorAgentWithIdFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithIdFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithIdFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithIdFound":
@ -878,16 +878,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithIdFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithIdFound" } }
}
}
}
},
"required": ["items"]
},
@ -954,11 +954,11 @@
"sourceCreatorAgentWithTypeFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithTypeFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithTypeFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithTypeFound":
@ -966,16 +966,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithTypeFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithTypeFound" } }
}
}
}
},
"required": ["items"]
},
@ -1057,11 +1057,11 @@
"sourceCreatorAgentWithNameFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithNameFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithNameFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithNameFound":
@ -1069,16 +1069,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithNameFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithNameFound" } }
}
}
}
},
"required": ["items"]
},
@ -1115,11 +1115,11 @@
"sourceCreatorAgentWithSingularNameFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithSingularNameFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithSingularNameFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithSingularNameFound":
@ -1127,16 +1127,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithSingularNameFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithSingularNameFound" } }
}
}
}
},
"required": ["items"]
},
@ -1196,11 +1196,11 @@
"sourceCreatorAgentWithSingularNicknameFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithSingularNicknameFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithSingularNicknameFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithSingularNicknameFound":
@ -1208,16 +1208,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithSingularNicknameFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithSingularNicknameFound" } }
}
}
}
},
"required": ["items"]
},
@ -1280,11 +1280,11 @@
"sourceCreatorAgentWithEmailFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithEmailFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithEmailFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithEmailFound":
@ -1292,16 +1292,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithEmailFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithEmailFound" } }
}
}
}
},
"required": ["items"]
},
@ -1360,11 +1360,11 @@
"sourceCreatorAgentWithEmail_sha1Found":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithEmail_sha1Found" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithEmail_sha1Found" }
},
"required": ["source"]
},
"itemCreatorAgentWithEmail_sha1Found":
@ -1372,16 +1372,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithEmail_sha1Found" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithEmail_sha1Found" } }
}
}
}
},
"required": ["items"]
},
@ -1442,11 +1442,11 @@
"sourceCreatorAgentWithHomepageFound":
{ "type": "object",
"properties":
{
"source":
{ "$ref": "#/definitions/creatorAgentWithHomepageFound" }
},
"required": ["source"]
{
"source":
{ "$ref": "#/definitions/creatorAgentWithHomepageFound" }
},
"required": ["source"]
},
"itemCreatorAgentWithHomepageFound":
@ -1454,16 +1454,16 @@
"type": "object",
"properties":
{
"items":
{
"type": "array",
"minItems": 1,
"not":
"items":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithHomepageFound" } }
"type": "array",
"minItems": 1,
"not":
{
"items":
{ "not": { "$ref": "#/definitions/creatorAgentWithHomepageFound" } }
}
}
}
},
"required": ["items"]
}

View file

@ -29,6 +29,7 @@ function JSONtest(params) {
this.Params = null; // paramaters passed in
this.Promise = null; // master Promise that resolves when intialization is complete
this.Properties = null; // testharness_properties from the opening window
this.SkipFailures = []; // list of assertionType values that should be skipped if their test would fail
this.Test = null; // test being run
this.AssertionCounter = 0;// keeps track of which assertion is being processed
@ -122,6 +123,10 @@ function JSONtest(params) {
this.DescriptionText = test.description;
}
if (test.hasOwnProperty("skipFailures") && Array.isArray(test.skipFailures) ) {
this.SkipFailures = test.skipFailures;
}
if (test.content) {
// we have content
if (typeof test.content === "string") {
@ -407,7 +412,7 @@ JSONtest.prototype = {
var message = assert.hasOwnProperty('errorMessage') ?
assert.errorMessage : "Result was not " + expected;
var type = assert.hasOwnProperty('assertionType') ?
assert.assertionType : "must" ;
assert.assertionType.toLowerCase() : "must" ;
if (!typeMap.hasOwnProperty(type)) {
type = "must";
}
@ -507,39 +512,42 @@ JSONtest.prototype = {
return ;
}
if (testAction !== 'continue') {
if (testAction === 'continue') {
// a previous test told us to not run this test; skip it
test(function() { }, "SKIPPED: " + assert.title);
} else {
// test(function() { }, "SKIPPED: " + assert.title);
// start an actual sub-test
test(function() {
var valid = validate(content) ;
var valid = validate(content) ;
var result = this.determineResult(assert, valid) ;
var theResult = this.determineResult(assert, valid) ;
// remember the result
theResults.push(result);
// remember the result
theResults.push(theResult);
var newAction = this.determineAction(assert, result) ;
// next time around we will use this action
testAction = newAction;
var newAction = this.determineAction(assert, theResult) ;
// next time around we will use this action
testAction = newAction;
var err = ";";
if (validate.errors !== null) {
err = "; Errors: " + this.ajv.errorsText(validate.errors) + ";" ;
}
if (testAction === 'abort') {
err += "; Aborting execution of remaining assertions;";
} else if (testAction === 'skip') {
err += "; Skipping execution of remaining assertions at level " + level + ";";
}
if (result === false) {
// test result was unexpected; use message
assert_true(result, typeMap[type] + message + err);
} else {
assert_true(result, err) ;
}
}.bind(this), "" + level + ":" + (num+1) + " " + assert.title);
// only run the test if we are NOT skipping fails for some types
// or the result is expected
if ( theResult === true || !this.SkipFailures.includes(type) ) {
test(function() {
var err = ";";
if (validate.errors !== null && !assert.hasOwnProperty("errorMessage")) {
err = "; Errors: " + this.ajv.errorsText(validate.errors) + ";" ;
}
if (testAction === 'abort') {
err += "; Aborting execution of remaining assertions;";
} else if (testAction === 'skip') {
err += "; Skipping execution of remaining assertions at level " + level + ";";
}
if (theResult === false) {
// test result was unexpected; use message
assert_true(theResult, typeMap[type] + message + err);
} else {
assert_true(theResult, err) ;
}
}.bind(this), "" + level + ":" + (num+1) + " " + assert.title);
}
}
}.bind(this));
}