summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/annotation-model/definitions
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/annotation-model/definitions
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/annotation-model/definitions')
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/.gitignore0
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/annotations.json212
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/bodyTarget.json1049
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/choiceSet.json214
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/id.json38
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/otherProperties.json1472
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/specificResource.json1129
7 files changed, 4114 insertions, 0 deletions
diff --git a/testing/web-platform/tests/annotation-model/definitions/.gitignore b/testing/web-platform/tests/annotation-model/definitions/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/.gitignore
diff --git a/testing/web-platform/tests/annotation-model/definitions/annotations.json b/testing/web-platform/tests/annotation-model/definitions/annotations.json
new file mode 100644
index 000000000..df1f73613
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/annotations.json
@@ -0,0 +1,212 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "annotations.json",
+ "title": "Definitions: Annotations.",
+ "description": "Schemas in #/definitions detect or validate keys/objects (direct children) uniquely used to describe Annotations (Section 3.1 and 3.3.5).",
+ "definitions": {
+
+ "contextValueFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Valid @context string",
+ "description": "True when the string has value http://www.w3.org/ns/anno.jsonld (Section 3.1)",
+ "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",
+ "description": "True when the array contains a string item having value http://www.w3.org/ns/anno.jsonld (Section 3.1)",
+ "type": "array",
+ "not":
+ { "items":
+ { "not":
+ { "$ref": "#/definitions/contextValueFound" }
+ }
+ }
+ },
+
+ "annotationTypeValueRecognized": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Valid annotation type value string",
+ "description": "True when the string has value 'Annotation' (Section 3.1)",
+ "type": "string",
+ "enum": [ "Annotation" ]
+ },
+
+ "annotationTypeValueInArrayRecognized": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Valid annotation type array",
+ "description": "True when the array contains a string item having value 'Annotation' (Section 3.1)",
+ "type": "array",
+ "not":
+ { "items":
+ { "not":
+ { "$ref": "#/definitions/annotationTypeValueRecognized" }
+ }
+ }
+ },
+
+ "annotationTypeValueFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Implementation: Annotation type",
+ "description": "True when the Annotation has type key and 'Annotation' is a value of type (Section 3.1)",
+ "type": "object",
+ "required": [ "type" ],
+ "properties": {
+ "type": {
+ "oneOf": [
+ { "$ref": "annotations.json#/definitions/annotationTypeValueRecognized" },
+ { "$ref": "annotations.json#/definitions/annotationTypeValueInArrayRecognized" }
+ ]
+ }
+ }
+ },
+
+ "motivationList":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definitions: list of motivation and purposes",
+ "description": "List of motivations and purposes as defined in the model (Section 3.3.5).",
+ "type": "string",
+ "enum": ["assessing", "bookmarking", "classifying", "commenting", "describing", "editing", "highlighting", "identifying", "linking", "moderating", "questioning", "replying", "tagging" ]
+ },
+
+ "motivationRecognizedIfPresent":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: motivation value",
+ "description": "True when the annotation has 0 or more motivation property values (Section 3.3.5)",
+ "type": "object",
+ "properties": {"motivation":
+ { "oneOf": [
+ { "$ref": "#/definitions/motivationList" },
+ { "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "#/definitions/motivationList" } }
+ ]
+ }
+ }
+ },
+
+ "motivationSingularIfPresent":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: singular motivation value",
+ "description": "True when the annotation has 0 or exactly one motivation property value (Section 3.3.5)",
+ "type": "object",
+ "properties": {"motivation":
+ { "oneOf": [
+ { "$ref": "#/definitions/motivationList" },
+ { "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": { "$ref": "#/definitions/motivationList" } }
+ ]
+ }
+ }
+ },
+
+ "motivationPropertyFound":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: via motivation with qualifying annotation class",
+ "description": "Supports implementation check of via (if/when) used on Annotation (Sections 3.3.5)",
+ "oneOf": [
+ {"$ref": "#/definitions/annotationTypeValueFound"}
+ ],
+ "allOf": [
+ {"required": ["motivation"]},
+ {"$ref": "#/definitions/motivationRecognizedIfPresent"}
+ ]
+ },
+
+ "singleMotivationPropertyFound":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: via motivation with qualifying annotation class",
+ "description": "Supports implementation check of via (if/when) used on Annotation (Sections 3.3.5)",
+ "oneOf": [
+ {"$ref": "#/definitions/annotationTypeValueFound"}
+ ],
+ "allOf": [
+ {"required": ["motivation"]},
+ {"$ref": "#/definitions/motivationSingularIfPresent"}
+ ]
+ },
+
+ "stylesheetValueDefinition":
+ {
+ "title": "Definition: stylesheet value",
+ "description": "True when Annotation has no stylesheet, references an external stylesheet, or has embedded stylesheet of type CssStylesheet (Section 4.4)",
+ "type": "object",
+ "properties":
+ {
+ "stylesheet":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri"},
+ { "type": "object",
+ "properties":
+ {
+ "type": { "type": "string",
+ "enum": [ "CssStylesheet" ]},
+ "id": { "$ref": "id.json#/definitions/stringUri" },
+ "value": { "type": "string" }
+ },
+ "not": { "required": [ "id", "value"] },
+ "oneOf": [
+ { "required": [ "id"] },
+ { "required": [ "value"] }
+ ]
+ }
+ ]
+ }
+ }
+ },
+
+ "stylesheetDetected":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Annotation stylesheet",
+ "description": "True when the Annotation has a valid stylesheet property (Section 4.4)",
+ "allOf": [
+ {"required": ["stylesheet"]},
+ {"$ref": "#/definitions/stylesheetValueDefinition"}
+ ]
+ },
+
+ "bodyValueValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: bodyValue",
+ "description": "True when the Annotation has no bodyValue key or has a bodyValue key with valid value (Section 3.2.5)",
+ "type": "object",
+ "properties":
+ {
+ "bodyValue":
+ {
+ "oneOf":
+ [
+ { "type": "string" },
+ { "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": { "type": "string" }
+ }
+ ]
+ }
+ }
+ },
+
+ "bodyValueFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": " Implementation: bodyValue",
+ "description": "True when the Annotation has a valid bodyValue (Section 3.2.5)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/bodyValueValidIfPresent" },
+ { "required": [ "bodyValue" ] }
+ ]
+ }
+
+ }
+}
diff --git a/testing/web-platform/tests/annotation-model/definitions/bodyTarget.json b/testing/web-platform/tests/annotation-model/definitions/bodyTarget.json
new file mode 100644
index 000000000..65af961f6
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/bodyTarget.json
@@ -0,0 +1,1049 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "bodyTarget.json",
+ "title": "Definitions: Bodies and Targets.",
+ "description": "Schemas in #/definitions detect or validate keys, objects or constraints variously applicable to Bodies and/or Targets (Section 3.2.1 - 3.2.6). Excludes Choice, Set and Specific Resources.",
+ "definitions":
+ {
+ "externalWebResourceDetected":
+ {
+ "$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).",
+ "type": "object",
+ "allOf": [ {"$ref": "id.json#/definitions/idValueFound"} ],
+ "not":
+ { "anyOf":
+ [
+ { "required": ["value"] },
+ { "required": ["source"] },
+ { "required": ["target"] }
+ ]
+ }
+ },
+
+ "sourceEwrDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "source": {"$ref": "#/definitions/externalWebResourceDetected"}
+ }
+ },
+
+ "itemEwrDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/externalWebResourceDetected" } } }
+ }
+ }
+ },
+
+ "textualBodyFound" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Embedded Textual Body",
+ "description": "True when the object is an Embedded Textual Body, i.e., includes the value key (Section 3.2.4).",
+ "type" : "object",
+ "properties" :
+ {
+ "value":
+ {
+ "type": "string"
+ }
+ },
+ "required": [ "value" ]
+ } ,
+
+ "itemETBDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/textualBodyFound" } } }
+ }
+ }
+ },
+
+ "targetResourcesFound" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Resources that can be used as Target",
+ "description": "True when the string is format uri or the object is recognized as a valid target resource (Sections 3.2 and 4).",
+ "type" : ["string", "object"],
+ "oneOf": [
+ {"$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" }
+ ]
+ },
+
+ "bodyResourcesFound" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "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": [
+ {"$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" }
+ ]
+ },
+
+ "optionalBodyPropertiesShould" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Optional Body Keys Should Validations",
+ "description": "Supports validity checks of optional keys (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "$ref": "#/definitions/resourceTypeShouldIfPresent" },
+ { "$ref": "#/definitions/formatValidIfPresent" },
+ { "$ref": "#/definitions/languageValidIfPresent" },
+ { "$ref": "#/definitions/processingLanguageValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/creatorValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/generatorValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/audienceValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/accessibilityValidIfPresent" }
+ ]
+ },
+
+ "optionalBodyPropertiesMust" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Optional Body Keys Must Validations",
+ "description": "Supports validity checks of optional keys (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "$ref": "#/definitions/textDirectionValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/createdValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/generatedValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/canonicalValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/viaValidIfPresent" }
+ ]
+ },
+
+ "optionalBodyPurposePropertyShould" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Optional Purpose Key",
+ "description": "Supports validity checks of optional purpose key (if/when) used on Specific Resources or Textual Body Resources (Sections 3.3.5)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "$ref": "otherProperties.json#/definitions/purposeRecognizedIfPresent" }
+ ]
+ },
+
+ "optionalTargetPropertiesShould" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Optional Target Keys Should validation",
+ "description": "Supports validity check of optional keys (if/when) used on External Web Resources, Specific Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" }
+ ],
+ "allOf" :
+ [
+ { "$ref": "#/definitions/resourceTypeShouldIfPresent" },
+ { "$ref": "#/definitions/formatValidIfPresent" },
+ { "$ref": "#/definitions/languageValidIfPresent" },
+ { "$ref": "#/definitions/processingLanguageValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/creatorValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/generatorValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/audienceValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/accessibilityValidIfPresent" }
+ ]
+ },
+
+ "optionalTargetPropertiesMust" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Optional Target Keys Must validation",
+ "description": "Supports validity check of optional keys (if/when) used on External Web Resources, Specific Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" }
+ ],
+ "allOf" :
+ [
+ { "$ref": "#/definitions/textDirectionValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/createdValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/generatedValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/canonicalValidIfPresent" },
+ { "$ref": "otherProperties.json#/definitions/viaValidIfPresent" }
+ ]
+ },
+
+ "resourceTypeRecognizedIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definitions: body / target classes",
+ "description": "True when type value for body / target is or includes item from recommended list of classes (Section 3.2.2)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ { "oneOf":
+ [
+ { "type": "string",
+ "enum": [ "Dataset", "Image", "Video", "Sound", "Text" ] },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items":
+ { "not":
+ { "type": "string",
+ "enum": [ "Dataset", "Image", "Video", "Sound", "Text" ] }
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "resourceTypeShouldIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: body / target classes all from 3.2.2",
+ "description": "Adds TextualBody to list from 3.2.2. True when type absent or all type value(s) for body / target are from recommended list of classes (Section 3.2.2), or TextualBody",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ { "oneOf":
+ [
+ { "type": "string",
+ "enum": [ "Dataset", "Image", "Video", "Sound", "Text", "TextualBody" ] },
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ { "type": "string",
+ "enum": [ "Dataset", "Image", "Video", "Sound", "Text", "TextualBody" ] }
+ }
+ ]
+ }
+ }
+ },
+
+ "recognizedTypeFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: type key with recognized classes",
+ "description": "Supports implementation check of type (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.2)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["type" ] },
+ { "$ref": "#/definitions/resourceTypeRecognizedIfPresent" }
+ ]
+
+ },
+
+ "itemRecognizedTypeFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having type key with qualifying body/target classes",
+ "description": "Supports implementation check of items having type (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/recognizedTypeFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceRecognizedTypeFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having type key",
+ "description": "Supports implementation check of type (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["type"] ,
+ "$ref": "#/definitions/resourceTypeRecognizedIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "formatValueCheck":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definitions: format value regex",
+ "description": "True when string value starts with a registered top-level Media type, including trailing slash (Section 3.2.1)",
+ "type": "string",
+ "pattern": "^(application/|audio/|example/|image/|multipart/|text/|video/)"
+ },
+
+ "formatValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: format validity",
+ "description": "True when the body or target has no format or has a valid format value - single string or array of strings (Section 3.2.1)",
+ "type": "object",
+ "properties":
+ {
+ "format":
+ {
+ "oneOf":
+ [
+ {"$ref": "#/definitions/formatValueCheck"},
+ {"type": "array",
+ "minItems": 1,
+ "items" : {"$ref": "#/definitions/formatValueCheck"}
+ }
+ ]
+ }
+ }
+ },
+
+ "formatSingularIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definitions: format",
+ "description": "True when the body or target format value, if present, is singular and valid (Section 3.2.1)",
+ "type": "object",
+ "properties":
+ {
+ "format":
+ {
+ "oneOf":
+ [
+ {"$ref": "#/definitions/formatValueCheck"},
+ {"type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items" : {"$ref": "#/definitions/formatValueCheck"} }
+ ]
+ }
+ }
+ },
+
+ "formatPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: format key with qualifying body/target classes",
+ "description": "Supports implementation check of format (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["format" ] },
+ { "$ref": "#/definitions/formatValidIfPresent" }
+ ]
+ },
+
+ "itemFormatPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having format key with qualifying body/target classes",
+ "description": "Supports implementation check of items having format (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/formatPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceFormatPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having format key",
+ "description": "Supports implementation check of format (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["format"] ,
+ "$ref": "#/definitions/formatValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "singleFormatPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: format key with qualifying body/target classes",
+ "description": "Supports implementation check of format being singular (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["format"] },
+ { "$ref": "#/definitions/formatSingularIfPresent" }
+ ]
+ },
+
+ "itemSingleFormatPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having singular format key with qualifying body/target classes",
+ "description": "Supports implementation check of items having singular format (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/singleFormatPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceSingleFormatPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having single format key value",
+ "description": "Supports implementation check of singular format (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["format"] ,
+ "$ref": "#/definitions/formatSingularIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "languageValueCheck" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definitions: language value regex",
+ "description": "True when string value starts with a two or three lc characters and a hyphen or end of string (Section 3.2.1)",
+ "type": "string",
+ "oneOf" :
+ [
+ {"pattern": "^([a-z]){2,3}$"},
+ {"pattern": "^([a-z]){2,3}-"}
+ ]
+
+ },
+
+ "languageValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: language value",
+ "description": "True when the body or target has no language or has a valid language value - single string or array of strings (Section 3.2.1)",
+ "type": "object",
+ "properties":
+ {
+ "language":
+ {
+ "oneOf":
+ [
+ {"$ref": "#/definitions/languageValueCheck"},
+ {"type": "array",
+ "minItems": 1,
+ "items" : {"$ref": "#/definitions/languageValueCheck"}
+ }
+ ]
+ }
+ }
+ },
+
+ "languageSingularIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definitions: single language valid",
+ "description": "True when the body or target has no language or has exactly one language property - single string (Section 3.2.1)",
+ "type": "object",
+ "properties":
+ {
+ "language":
+ {
+ "oneOf":
+ [
+ {"$ref": "#/definitions/languageValueCheck"},
+ {"type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items" : {"$ref": "#/definitions/languageValueCheck"} }
+ ]
+ }
+ }
+ },
+
+ "languagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: language key with qualifying body/target classes",
+ "description": "Supports implementation check of language (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["language" ] },
+ { "$ref": "#/definitions/languageValidIfPresent" }
+ ]
+ },
+
+ "itemLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having language key with qualifying body/target classes",
+ "description": "Supports implementation check of items having language (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/languagePropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having language key",
+ "description": "Supports implementation check of language (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["language"] ,
+ "$ref": "#/definitions/languageValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "singleLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: language key with qualifying body/target classes",
+ "description": "Supports implementation check of language being singular (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["language"] },
+ { "$ref": "#/definitions/languageSingularIfPresent" }
+ ]
+ },
+
+ "itemSingleLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having singular language key with qualifying body/target classes",
+ "description": "Supports implementation check of items having singular language (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/singleLanguagePropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceSingleLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having single language key value",
+ "description": "Supports implementation check of singular language (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["language"] ,
+ "$ref": "#/definitions/languageSingularIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "processingLanguageValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: processingLanguage",
+ "description": "True when the Body or Target has no processingLanguage or exactly one processingLanguage property (Section 3.2.1)",
+ "type": "object",
+ "properties":
+ {
+ "processingLanguage":
+ {
+ "oneOf":
+ [
+ {"$ref": "#/definitions/languageValueCheck"},
+ {"type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items" : {"$ref": "#/definitions/languageValueCheck"} }
+ ]
+ }
+ }
+ },
+
+ "processingLanguagePropertyFound" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: processingLanguage Key with qualifying body/target classes",
+ "description": "Supports implementation check of processingLanguage (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["processingLanguage" ] },
+ { "$ref": "#/definitions/processingLanguageValidIfPresent" }
+ ]
+ },
+
+ "itemProcessingLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having processingLanguage key with qualifying body/target classes",
+ "description": "Supports implementation check of items having processingLanguage (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/processingLanguagePropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceProcessingLanguagePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having processingLanguage key",
+ "description": "Supports implementation check of processingLanguage (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["processingLanguage"] ,
+ "$ref": "#/definitions/processingLanguageValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "textDirectionValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: textDirection",
+ "description": "True when the body or target has no textDirection or exactly one valid textDirection (Section 3.2.1)",
+ "type": "object",
+ "properties":
+ {
+ "textDirection":
+ {
+ "oneOf":
+ [
+ {"type": "string",
+ "enum": ["ltr", "rtl", "auto"] },
+ {"type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items" : {"type": "string",
+ "enum": ["ltr", "rtl", "auto"] } }
+ ]
+ }
+ }
+ },
+
+ "textDirectionPropertyFound" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: textDirection Key with qualifying body/target classes",
+ "description": "Supports implementation check of textDirection (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "oneOf":
+ [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ {"$ref": "#/definitions/externalWebResourceDetected" },
+ {"$ref": "#/definitions/textualBodyFound" }
+ ],
+ "allOf" :
+ [
+ { "required": ["textDirection" ] },
+ { "$ref": "#/definitions/textDirectionValidIfPresent" }
+ ]
+ },
+
+ "itemTextDirectionPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having textDirection key with qualifying body/target classes",
+ "description": "Supports implementation check of items having textDirection (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/textDirectionPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceTextDirectionPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having textDirection key",
+ "description": "Supports implementation check of textDirection (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["textDirection"] ,
+ "$ref": "#/definitions/textDirectionValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "ewrWithItems" :
+ {
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/externalWebResourceDetected"},
+ { "required": [ "items" ] }
+ ]
+ },
+
+ "sourceEwrWithItems":
+ {
+ "type": "object",
+ "properties":
+ {
+ "source": {"$ref": "#/definitions/ewrWithItems"}
+ },
+ "required": ["source"]
+ },
+
+ "itemEwrWithItems":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/ewrWithItems" } } }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "ewrWithPurpose" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/externalWebResourceDetected"},
+ { "required": [ "purpose" ] }
+ ]
+ },
+
+ "sourceEwrWithPurpose":
+ {
+ "type": "object",
+ "properties":
+ {
+ "source": {"$ref": "#/definitions/ewrWithPurpose"}
+ },
+ "required": ["source"]
+ },
+
+ "itemEwrWithPurpose":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/ewrWithPurpose" } } }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "embeddedTextualBodyWithItems" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/textualBodyFound"},
+ { "required": [ "items" ] }
+ ]
+ },
+
+ "itemETBWithItems":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/embeddedTextualBodyWithItems" } } }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "embeddedTextualBodyWithSource" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/textualBodyFound"},
+ { "required": [ "source" ] }
+ ]
+ },
+
+ "itemETBWithSource":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/embeddedTextualBodyWithSource" } } }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "embeddedTextTypeIncludesTextualBody":
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/textualBodyFound" },
+ { "required": ["type"] },
+ { "properties":
+ {
+ "type":
+ {
+ "oneOf":
+ [
+ { "type": "string",
+ "enum": ["TextualBody"] },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items":
+ { "not": { "enum": [ "TextualBody"] } }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]
+ },
+
+ "itemEmbeddedTextTypeIncludesTextualBody":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/embeddedTextTypeIncludesTextualBody" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "embeddedTextTypeIncludesText":
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/textualBodyFound" },
+ { "required": ["type"] },
+ { "properties":
+ {
+ "type":
+ {
+ "oneOf":
+ [
+ { "type": "string",
+ "enum": ["Text"] },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items":
+ { "not": { "enum": [ "Text"] } }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]
+ },
+
+ "itemEmbeddedTextTypeIncludesText":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/embeddedTextTypeIncludesText" } }
+ }
+ }
+ },
+ "required": ["items"]
+ }
+
+ }
+}
diff --git a/testing/web-platform/tests/annotation-model/definitions/choiceSet.json b/testing/web-platform/tests/annotation-model/definitions/choiceSet.json
new file mode 100644
index 000000000..ffe21a0f0
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/choiceSet.json
@@ -0,0 +1,214 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "choiceSet.json",
+ "title": "Definitions: Choice, Composite, List, Independents.",
+ "description": "Schemas in #/definitions detect or validate keys/objects used in describing Choice, Composite, List, Independents (Sections 3.2.7 and 3.2.8).",
+ "definitions":
+ {
+
+ "itemsDetected" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: items",
+ "description": "True when the object includes items key and value of items is an array containing at least 1 item, which can be a specificResource, an externalWebResource, a uri, a textualBody or another choice/set (Sections 3.2.7 and 3.2.8).",
+ "type": "object",
+ "properties" :
+ {
+ "items" :
+ {
+ "type" : "array",
+ "minItems": 1,
+ "items": {
+ "oneOf":
+ [
+ { "$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" }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "required": [ "items" ]
+ },
+
+ "choiceTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Choice type",
+ "description": "True when object has type key and object's type is 'Choice' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Choice"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "compositeTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Composite type",
+ "description": "True when object has type key and object's type is 'Composite' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Composite"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "listTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: List type",
+ "description": "True when object has type key and object's type is 'List' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["List"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "independentsTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Independents type",
+ "description": "True when object has type key and object's type is 'Independents' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Independents"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "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" ]
+ },
+
+ "choiceDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Choice",
+ "description": "True when object's type is 'Choice' and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "compositeDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Composite",
+ "description": "True when object's type is 'Composite' and the object has an items array (Section 3.2.8)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/compositeTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "listDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: List",
+ "description": "True when object's type is 'List' and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/listTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "independentsDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Independents",
+ "description": "True when object's type is 'Independents' and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/independentsTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "choiceOrSetDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Choice or Set",
+ "description": "True when object's type is one of Choice, Composite, List or Independents and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "choiceSetWithValue" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetDetected" },
+ { "required": [ "value" ] }
+ ]
+ },
+
+ "choiceSetWithSource" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetDetected" },
+ { "required": [ "source" ] }
+ ]
+ },
+
+ "choiceSetWithPurpose" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetDetected" },
+ { "required": [ "purpose" ] }
+ ]
+ }
+
+ }
+}
diff --git a/testing/web-platform/tests/annotation-model/definitions/id.json b/testing/web-platform/tests/annotation-model/definitions/id.json
new file mode 100644
index 000000000..b037e87c9
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/id.json
@@ -0,0 +1,38 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id" : "id.json",
+ "title": "Definitions: id key",
+ "description": "Schemas in #/definitions used to detect valid id (string of format uri or array containing 1 item of string, format uri).",
+ "definitions":
+ {
+ "stringUri" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "string",
+ "format": "uri"
+ },
+
+ "arraySingleStringUri":
+ {
+ "oneOf":
+ [
+ { "$ref": "#/definitions/stringUri" },
+ { "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": { "$ref": "#/definitions/stringUri" }
+ }
+ ]
+ },
+
+ "idValueFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "required": [ "id" ],
+ "properties": {
+ "id" : { "$ref": "#/definitions/arraySingleStringUri" }
+ }
+ }
+ }
+}
diff --git a/testing/web-platform/tests/annotation-model/definitions/otherProperties.json b/testing/web-platform/tests/annotation-model/definitions/otherProperties.json
new file mode 100644
index 000000000..0cf42525c
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/otherProperties.json
@@ -0,0 +1,1472 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "otherProperties.json",
+ "title": "Definitions: Other Properties.",
+ "description": "Schemas in #/definitions detect or validate keys, objects or constraints variously applicable to Annotations, Bodies, Targets, Specific Resources, Textual Bodies, Items, and/or Sources (Section 3.3).",
+ "definitions": {
+
+ "createdValidIfPresent": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: created value",
+ "description": "True when the object being tested (annotation, body, target...) has no created or has a single created of format date-time (Section 3.3.1)",
+ "type": "object",
+ "properties": {"created": {"oneOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ]}}
+ },
+
+ "createdPropertyFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: created key with qualifying body/target classes",
+ "description": "Supports implementation check of created (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": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"$ref": "#/definitions/createdValidIfPresent"},
+ {"required": ["created"]}
+ ]
+ },
+
+ "itemCreatedPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having created key with qualifying body/target classes",
+ "description": "Supports implementation check of items having created (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/createdPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceCreatedPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having created key",
+ "description": "Supports implementation check of created (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["created"] ,
+ "$ref": "#/definitions/createdValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "generatedValidIfPresent": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: generated value",
+ "description": "True when the annotation, body or target has no generated or has a single generated of format date-time (Section 3.3.1)",
+ "type": "object",
+ "properties": {"generated": {"oneOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ]}}
+ },
+
+ "generatedPropertyFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "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"}
+ ],
+ "allOf": [
+ {"$ref": "#/definitions/generatedValidIfPresent"},
+ {"required": ["generated"]}
+ ]
+ },
+
+ "modifiedValidIfPresent": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: modified value",
+ "description": "True when the annotation, body or target has no modified or has a single modified of format date-time (Section 3.3.1)",
+ "type": "object",
+ "properties": {"modified": {"oneOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ]}}
+ },
+
+ "modifiedPropertyFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: modified key with qualifying body/target classes",
+ "description": "Supports implementation check of modified (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": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"$ref": "#/definitions/modifiedValidIfPresent"},
+ {"required": ["modified"]}
+ ]
+ },
+
+ "itemModifiedPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having modified key with qualifying body/target classes",
+ "description": "Supports implementation check of items having modified (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/modifiedPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceModifiedPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having modified key",
+ "description": "Supports implementation check of modified (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["modified"] ,
+ "$ref": "#/definitions/modifiedValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "creatorValidIfPresent": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: creator value",
+ "description": "True when the annotation, body or target has one or more creators (Section 3.3.1)",
+ "type": "object",
+ "properties": {"creator":
+ {"oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object" },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object" }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "creatorSingularIfPresent": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: creator value",
+ "description": "True when the annotation, body or target has exactly 1 creator (Section 3.3.1)",
+ "type": "object",
+ "properties": {"creator":
+ {"oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object" },
+ {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object" }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "creatorPropertyFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: creator key with qualifying body/target classes",
+ "description": "Supports implementation check of creator (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Section 3.3.1)",
+ "oneOf": [
+ {"$ref": "annotations.json#/definitions/annotationTypeValueFound"},
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["creator"]},
+ {"$ref": "#/definitions/creatorValidIfPresent"}
+ ]
+ },
+
+ "itemCreatorPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having creator key with qualifying body/target classes",
+ "description": "Supports implementation check of items having creator (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceCreatorPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having creator key",
+ "description": "Supports implementation check of creator (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["creator"] ,
+ "$ref": "#/definitions/creatorValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "singleCreatorPropertyFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: creator key with qualifying body/target classes",
+ "description": "Supports implementation check of creator being singular (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Section 3.3.1)",
+ "oneOf": [
+ {"$ref": "annotations.json#/definitions/annotationTypeValueFound"},
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["creator"]},
+ {"$ref": "#/definitions/creatorSingularIfPresent"}
+ ]
+ },
+
+ "itemSingleCreatorPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having singular creator key with qualifying body/target classes",
+ "description": "Supports implementation check of items having singular creator (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/singleCreatorPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceSingleCreatorPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having singular creator key",
+ "description": "Supports implementation check of singular creator (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["creator"] ,
+ "$ref": "#/definitions/creatorSingularIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "generatorValidIfPresent": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: generator value",
+ "description": "True when the annotation, body or target has a single generator (Section 3.3.1)",
+ "type": "object",
+ "properties": {"generator":
+ {"oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object" },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object" }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "generatorPropertyFound": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "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"}
+ ],
+ "allOf": [
+ {"required": ["generator"]},
+ {"$ref": "#/definitions/generatorValidIfPresent"}
+ ]
+ },
+
+ "audienceDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: audience object",
+ "description": "True when object meets our requirements for audience value (Section 3.3.3)",
+ "type": "object",
+ "properties": {
+ "id": {"$ref": "id.json#/definitions/arraySingleStringUri"} ,
+ "type": {
+ "oneOf": [
+ { "type": "string",
+ "pattern": "^(schema:)"},
+ { "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string",
+ "pattern": "^(schema:)"
+ }
+ }
+ ]
+ }
+ },
+ "patternProperties": {
+ "^(schema:)": { "type": ["string", "object", "array"] }
+ },
+ "additionalProperties": false
+ },
+
+ "audienceValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: audience value",
+ "description": "True when no audience or audience property of the annotation, body, target, ... is valid (Section 3.3.3)",
+ "type": "object",
+ "properties": {
+ "audience":
+ { "oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "$ref": "#/definitions/audienceDefinition" },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "$ref": "#/definitions/audienceDefinition" }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "audiencePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: audience key with qualifying body/target classes",
+ "description": "Supports implementation check of audience (if/when) used on Annotation, External Web Resources, Specific Resources, Textual Body Resources (Section 3.3.3)",
+ "oneOf": [
+ {"$ref": "annotations.json#/definitions/annotationTypeValueFound"},
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["audience"]},
+ {"$ref": "#/definitions/audienceValidIfPresent"}
+ ]
+ },
+
+ "itemAudiencePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having audience key with qualifying body/target classes",
+ "description": "Supports implementation check of items having audience (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/audiencePropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceAudiencePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having audience key",
+ "description": "Supports implementation check of audience (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["audience"] ,
+ "$ref": "#/definitions/audienceValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "accessibilityValidIfPresent":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: accessibility value",
+ "description": "True when no accessibility or accessibility property of the body, target, ... is valid (Section 3.3.4)",
+ "type": "object",
+ "properties": {
+ "accessibility" : {
+ "oneOf": [
+ { "type": "string" },
+ { "type": "array" ,
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "accessibilityPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: accessibility key with qualifying body/target classes",
+ "description": "Supports implementation check of accessibility (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Section 3.3.4)",
+ "oneOf": [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["accessibility"]},
+ {"$ref": "#/definitions/accessibilityValidIfPresent"}
+ ]
+ },
+
+ "itemAccessibilityPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having accessibility key with qualifying body/target classes",
+ "description": "Supports implementation check of items having accessibility (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/accessibilityPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceAccessibilityPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having audience key",
+ "description": "Supports implementation check of audience (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["accessibility"] ,
+ "$ref": "#/definitions/accessibilityValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "rightsValidIfPresent":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: rights value",
+ "description": "True when the annotation, body or target has 0 or more rights properties that are strings of format uri (Section 3.3.6)",
+ "type": "object",
+ "properties": {"rights":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "id.json#/definitions/stringUri" } }
+ ]
+ }
+ }
+ },
+
+ "rightsPropertyFound":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: rights key with qualifying annotation/body/target classes",
+ "description": "Supports implementation check of rights (if/when) used on Annotation, External Web Resources, Specific Resources, Textual Body Resources (Sections 3.3.6)",
+ "oneOf": [
+ {"$ref": "annotations.json#/definitions/annotationTypeValueFound"},
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["rights"]},
+ {"$ref": "#/definitions/rightsValidIfPresent"}
+ ]
+ },
+
+ "itemRightsPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having rights key with qualifying body/target classes",
+ "description": "Supports implementation check of items having rights (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/rightsPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceRightsPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having rights key",
+ "description": "Supports implementation check of rights (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["rights"] ,
+ "$ref": "#/definitions/rightsValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "canonicalValidIfPresent":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: canonical value",
+ "description": "True when the annotation, body or target has 0 or 1 canonical properties that are strings of format uri (Section 3.3.7)",
+ "type": "object",
+ "properties": {
+ "canonical": { "$ref": "id.json#/definitions/arraySingleStringUri" }
+ }
+ },
+
+ "canonicalPropertyFound":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: canonical key with qualifying annotation/body/target classes",
+ "description": "Supports implementation check of canonical (if/when) used on Annotation, External Web Resources, Specific Resources, Textual Body Resources (Sections 3.3.7)",
+ "oneOf": [
+ {"$ref": "annotations.json#/definitions/annotationTypeValueFound"},
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["canonical"]},
+ {"$ref": "#/definitions/canonicalValidIfPresent"}
+ ]
+ },
+
+ "itemCanonicalPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having canonical key with qualifying body/target classes",
+ "description": "Supports implementation check of items having canonical (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/canonicalPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceCanonicalPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having canonical key",
+ "description": "Supports implementation check of canonical (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["canonical"] ,
+ "$ref": "#/definitions/canonicalValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "viaValidIfPresent":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: via value",
+ "description": "True when the annotation, body or target has 0 or more via properties that are strings of format uri (Section 3.3.7)",
+ "type": "object",
+ "properties": {"via":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "id.json#/definitions/stringUri" } }
+ ]
+ }
+ }
+ },
+
+ "viaPropertyFound":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: via key with qualifying annotation/body/target classes",
+ "description": "Supports implementation check of via (if/when) used on Annotation, External Web Resources, Specific Resources, Textual Body Resources (Sections 3.3.7)",
+ "oneOf": [
+ {"$ref": "annotations.json#/definitions/annotationTypeValueFound"},
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["via"]},
+ {"$ref": "#/definitions/viaValidIfPresent"}
+ ]
+ },
+
+ "itemViaPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having via key with qualifying body/target classes",
+ "description": "Supports implementation check of items having via (if/when) used on External Web Resources, Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/viaPropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "sourceViaPropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: Specific Resource source having via key",
+ "description": "Supports implementation check of via (if/when) used on Specific Resource source (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": "object",
+ "required": ["via"] ,
+ "$ref": "#/definitions/viaValidIfPresent"
+ }
+ },
+ "required": ["source"]
+ },
+
+ "purposeRecognizedIfPresent":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Validation: purpose value",
+ "description": "True when the body has 0 or more purpose property values (Section 3.3.5)",
+ "type": "object",
+ "properties": {"purpose":
+ { "oneOf": [
+ { "$ref": "annotations.json#/definitions/motivationList" },
+ { "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "annotations.json#/definitions/motivationList" } }
+ ]
+ }
+ }
+ },
+
+ "purposePropertyFound":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: purpose key with qualifying body classes",
+ "description": "Supports implementation check of purpose (if/when) used on Specific Resource Body or Textual Body (Sections 3.3.5)",
+ "oneOf": [
+ {"$ref": "specificResource.json#/definitions/specificeResourceDetected"},
+ {"$ref": "bodyTarget.json#/definitions/textualBodyFound"}
+ ],
+ "allOf": [
+ {"required": ["purpose"]},
+ {"$ref": "#/definitions/purposeRecognizedIfPresent"}
+ ]
+ },
+
+ "itemPurposePropertyFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having purpose key with qualifying body/target classes",
+ "description": "Supports implementation check of items having purpose (if/when) used on Specific Resources, Textual Body Resources (Sections 3.2.1-6, 3.3)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/purposePropertyFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "creatorAgentWithIdFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "id.json#/definitions/idValueFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "id.json#/definitions/idValueFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithIdFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithIdFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithIdFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithIdFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent type value",
+ "description": "True when the object (creator or generator agent) has no type or has at least one recognized Agent type value (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "oneOf":
+ [
+ {"type": "string",
+ "enum": ["Person", "Organization", "Software"] },
+ {"type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items" :
+ { "not":
+ { "type": "string",
+ "enum": ["Person", "Organization", "Software"] }
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "agentTypeFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent type value",
+ "description": "True when the object (creator or generator agent) has at least one recognized Agent type value (Section 3.3.2)",
+ "allOf": [
+ {"required": ["type"]},
+ {"$ref": "#/definitions/agentTypeDefinition"}
+ ]
+ },
+
+ "creatorAgentWithTypeFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentTypeFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentTypeFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithTypeFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithTypeFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithTypeFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithTypeFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentNameDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent name value",
+ "description": "True when the object (creator or generator agent) has no name or has Agent name(s) of type string (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "name":
+ {
+ "oneOf":
+ [
+ {"type": "string" },
+ {"type": "array",
+ "minItems": 1,
+ "items": {"type": "string"}
+ }
+ ]
+ }
+ }
+ },
+
+ "agentSingularNameDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent name value",
+ "description": "True when the object (creator or generator agent) has no name or has exactly one Agent name that is a string (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "name":
+ {
+ "oneOf":
+ [
+ {"type": "string" },
+ {"type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {"type": "string"}
+ }
+ ]
+ }
+ }
+ },
+
+ "agentNameFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent name value",
+ "description": "True when the object (creator or generator agent) has Agent name value(s) (Section 3.3.2)",
+ "allOf": [
+ {"required": ["name"]},
+ {"$ref": "#/definitions/agentNameDefinition"}
+ ]
+ },
+
+ "creatorAgentWithNameFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentNameFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentNameFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithNameFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithNameFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithNameFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithNameFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentSingularNameFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent name value",
+ "description": "True when the object (creator or generator agent) has exactly one Agent name value (Section 3.3.2)",
+ "allOf": [
+ {"required": ["name"]},
+ {"$ref": "#/definitions/agentSingularNameDefinition"}
+ ]
+ },
+
+ "creatorAgentWithSingularNameFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentSingularNameFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentSingularNameFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithSingularNameFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithSingularNameFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithSingularNameFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithSingularNameFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentSingularNicknameDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent nickname value",
+ "description": "True when the object (creator or generator agent) has no nickname or has exacly one Agent nickname that is a string (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "nickname":
+ {
+ "oneOf":
+ [
+ {"type": "string" },
+ {"type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {"type": "string"}
+ }
+ ]
+ }
+ }
+ },
+
+ "agentSingularNicknameFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent nickname value",
+ "description": "True when the object (creator or generator agent) has an Agent nickname value (Section 3.3.2)",
+ "allOf": [
+ {"required": ["nickname"]},
+ {"$ref": "#/definitions/agentSingularNicknameDefinition"}
+ ]
+ },
+
+ "creatorAgentWithSingularNicknameFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentSingularNicknameFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentSingularNicknameFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithSingularNicknameFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithSingularNicknameFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithSingularNicknameFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithSingularNicknameFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentEmailDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent email value",
+ "description": "True when the object (creator or generator agent) has no email or has Agent one or more email addresses that start(s) mailto: and is format uri (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "email":
+ {
+ "oneOf":
+ [
+ { "type": "string",
+ "pattern": "^(mailto)",
+ "format": "uri" },
+ {"type": "array",
+ "minItems": 1,
+ "items": {"type": "string",
+ "pattern": "^(mailto)",
+ "format": "uri" }
+ }
+ ]
+ }
+ }
+ },
+
+ "agentEmailFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent email value",
+ "description": "True when the object (creator or generator agent) has Agent email value(s) (Section 3.3.2)",
+ "allOf": [
+ {"required": ["email"]},
+ {"$ref": "#/definitions/agentEmailDefinition"}
+ ]
+ },
+
+ "creatorAgentWithEmailFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentEmailFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentEmailFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithEmailFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithEmailFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithEmailFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithEmailFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentEmail_sha1Definition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent email_sha1 value",
+ "description": "True when the object (creator or generator agent) has no email_sha1 or has one or more email_sha1 that is/are a string (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "email_sha1":
+ {
+ "oneOf":
+ [
+ {"type": "string" },
+ {"type": "array",
+ "minItems": 1,
+ "items": {"type": "string"}
+ }
+ ]
+ }
+ }
+ },
+
+ "agentEmail_sha1Found":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent email_sha1 value",
+ "description": "True when the object (creator or generator agent) has has one or more email_sha1 that is/are a string (Section 3.3.2)",
+ "allOf": [
+ {"required": ["email_sha1"]},
+ {"$ref": "#/definitions/agentEmail_sha1Definition"}
+ ]
+ },
+
+ "creatorAgentWithEmail_sha1Found":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentEmail_sha1Found" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentEmail_sha1Found" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithEmail_sha1Found":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithEmail_sha1Found" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithEmail_sha1Found":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithEmail_sha1Found" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "agentHomepageDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Agent homepage value",
+ "description": "True when the object (creator or generator agent) has no homempage or has one or more agent homepage addresses of format uri (Section 3.3.2)",
+ "type": "object",
+ "properties":
+ {
+ "email":
+ {
+ "oneOf":
+ [
+ { "type": "string",
+ "format": "uri" },
+ {"type": "array",
+ "minItems": 1,
+ "items": {"type": "string",
+ "format": "uri" }
+ }
+ ]
+ }
+ }
+ },
+
+ "agentHomepageFound":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Check for implementation of Agent homepage value",
+ "description": "True when the object (creator or generator agent) has Agent homepage value(s) (Section 3.3.2)",
+ "allOf": [
+ {"required": ["homepage"]},
+ {"$ref": "#/definitions/agentHomepageDefinition"}
+ ]
+ },
+
+ "creatorAgentWithHomepageFound":
+ { "type": "object",
+ "properties":
+ { "creator":
+ { "oneOf":
+ [
+ { "$ref": "#/definitions/agentHomepageFound" },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": { "not": { "$ref": "#/definitions/agentHomepageFound" } } }
+ }
+ ]
+ }
+ },
+ "required": ["creator"]
+ },
+
+ "sourceCreatorAgentWithHomepageFound":
+ { "type": "object",
+ "properties":
+ {
+ "source":
+ { "$ref": "#/definitions/creatorAgentWithHomepageFound" }
+ },
+ "required": ["source"]
+ },
+
+ "itemCreatorAgentWithHomepageFound":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/creatorAgentWithHomepageFound" } }
+ }
+ }
+ },
+ "required": ["items"]
+ }
+
+ }
+}
diff --git a/testing/web-platform/tests/annotation-model/definitions/specificResource.json b/testing/web-platform/tests/annotation-model/definitions/specificResource.json
new file mode 100644
index 000000000..c3d97541e
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/specificResource.json
@@ -0,0 +1,1129 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id" : "specificResource.json",
+ "title": "Definitions: Specific Resources.",
+ "description": "Schemas in #/definitions detect or validate keys/objects used in describing Specific Resources (Section 4).",
+ "definitions": {
+
+ "sourceDetected":
+ {
+ "title": "Detection: source",
+ "description": "True when object has exactly 1 source key value and that value is of format uri or an External Web Resource (Section 4) - NB, the Specific Resource is closer in hierarchy to the External Web Resource than a Choice or Set; the items of a Choice or Set may be Specific Resources, but the source of a Specific Resource may not be a Choice or Set.",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "type": ["string", "object" ],
+ "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "$ref": "bodyTarget.json#/definitions/externalWebResourceDetected"}
+ ]
+ }
+ },
+ "required": ["source"]
+ },
+
+ "specificeResourceDetected":
+ {
+ "title": "Detection: Specific Resource",
+ "description": "True when object has exactly 1 source value and at least one of purpose, selector, state, styleClass, renderedVia, scope (Section 4)",
+ "type": "object",
+ "$ref": "#/definitions/sourceDetected",
+ "anyOf": [
+ { "$ref": "otherProperties.json#/definitions/purposeRecognizedIfPresent", "required": ["purpose"] },
+ { "$ref": "#/definitions/selectorDetected" },
+ { "$ref": "#/definitions/stateDetected" },
+ { "$ref": "#/definitions/styleClassDetected" },
+ { "$ref": "#/definitions/renderedViaDetected" },
+ { "$ref": "#/definitions/scopeDetected" }
+ ]
+ },
+
+ "itemSpecificResourceDetected":
+ {
+ "title": "Detection: Specific Resource as item member of a Choice or Set",
+ "description": "True when object has items array containing an object with exactly 1 source value and at least one of purpose, selector, state, styleClass, renderedVia, scope (Section 4)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/specificeResourceDetected" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "selectorDefined":
+ {
+ "title": "Definition: selector",
+ "description": "True when object tested has no selector, or has selector identified by uri, or has selector(s) with value matching one or more of the selectors described in the model (Section 4.2)",
+ "type": "object",
+ "properties":
+ {
+ "selector":
+ {
+ "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "anyOf": [
+ {"$ref": "id.json#/definitions/idValueFound"},
+ {"$ref": "#/definitions/fragmentSelectorDetected"},
+ {"$ref": "#/definitions/cssSelectorDetected"},
+ {"$ref": "#/definitions/xpathSelectorDetected"},
+ {"$ref": "#/definitions/textQuoteSelectorDetected"},
+ {"$ref": "#/definitions/textPositionSelectorDetected"},
+ {"$ref": "#/definitions/dataPositionSelectorDetected"},
+ {"$ref": "#/definitions/rangeSelectorDetected"},
+ {"$ref": "#/definitions/svgSelectorDetected"}
+ ]
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "anyOf": [
+ {"$ref": "id.json#/definitions/idValueFound"},
+ {"$ref": "#/definitions/fragmentSelectorDetected"},
+ {"$ref": "#/definitions/cssSelectorDetected"},
+ {"$ref": "#/definitions/xpathSelectorDetected"},
+ {"$ref": "#/definitions/textQuoteSelectorDetected"},
+ {"$ref": "#/definitions/textPositionSelectorDetected"},
+ {"$ref": "#/definitions/dataPositionSelectorDetected"},
+ {"$ref": "#/definitions/rangeSelectorDetected"},
+ {"$ref": "#/definitions/svgSelectorDetected"}
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "itemSelectorValidIfPresent":
+ {
+ "description": "True if ALL items in the items array of object tested have no selector, or have a selector that is uri, or have a selector that has recognized value(s)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "$ref": "#/definitions/selectorDefined" }
+ ]
+ }
+ }
+ }
+ },
+
+ "selectorDetected":
+ {
+ "title": "Detection: selector type",
+ "description": "True when object tested has selector(s) that is(are) recognized as being one or more of the selectors described in the model (Section 4.2)",
+ "type": "object",
+ "$ref": "#/definitions/selectorDefined",
+ "required": ["selector"]
+ },
+
+ "fragmentSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["FragmentSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "fragmentSelectorDetected":
+ {
+ "title": "Detection: fragment selector",
+ "description": "True when object is a fragment selelctor (Section 4.2.1)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/fragmentSelectorTypeDetected"},
+ {
+ "type": "object",
+ "properties":
+ {
+ "value": { "type": "string" },
+ "conformsTo": { "type": "string", "format": "uri"}
+ },
+ "required": ["value"]
+ }
+ ]
+ },
+
+ "conformsToPropertyFound":
+ {
+ "title": "Detection: fragment selector with conformsTo key",
+ "description": "True when object is a fragment selelctor with a conformsTo key (Section 4.2.1)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/fragmentSelectorDetected"},
+ { "required": ["conformsTo"] }
+ ]
+ },
+
+ "fragmentSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/fragmentSelectorTypeDetected" } },
+ { "$ref": "#/definitions/fragmentSelectorDetected" }
+ ]
+ },
+
+ "cssSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["CssSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "cssSelectorDetected":
+ {
+ "title": "Detection: CssSelector selector",
+ "description": "True when object is a CssSelector selelctor (Section 4.2.2)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/cssSelectorTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "value": { "type": "string" }
+ },
+ "required": ["value"]
+ }
+ ]
+ },
+
+ "cssSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/cssSelectorTypeDetected" } },
+ { "$ref": "#/definitions/cssSelectorDetected" }
+ ]
+ },
+
+ "xpathSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["XPathSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "xpathSelectorDetected":
+ {
+ "title": "Detection: XPath selector",
+ "description": "True when object is a XPath selelctor (Section 4.2.3)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/xpathSelectorTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "value": { "type": "string" }
+ },
+ "required": ["value"]
+ }
+ ]
+
+ },
+
+ "xpathSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/xpathSelectorTypeDetected" } },
+ { "$ref": "#/definitions/xpathSelectorDetected" }
+ ]
+ },
+
+ "textQuoteSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["TextQuoteSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "textQuoteSelectorDetected":
+ {
+ "title": "Detection: text quote selector",
+ "description": "True when object is a text quote selelctor (Section 4.2.4)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/textQuoteSelectorTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "exact": { "type": "string" },
+ "prefix": { "type": "string" },
+ "suffix": { "type": "string" }
+ },
+ "required": ["exact"]
+ }
+ ]
+ },
+
+ "prefixPropertyFound":
+ {
+ "title": "Detection: text quote selector with prefix key",
+ "description": "True when object is a text quote selelctor with a prefix key (Section 4.2.4)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/textQuoteSelectorDetected"},
+ { "required": ["prefix"] }
+ ]
+ },
+
+ "suffixPropertyFound":
+ {
+ "title": "Detection: text quote selector with suffix key",
+ "description": "True when object is a text quote selelctor with a suffix key (Section 4.2.4)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/textQuoteSelectorDetected"},
+ { "required": ["suffix"] }
+ ]
+ },
+
+ "textQuoteSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/textQuoteSelectorTypeDetected" } },
+ { "$ref": "#/definitions/textQuoteSelectorDetected" }
+ ]
+ },
+
+ "textPositionSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["TextPositionSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "textPositionSelectorDetected":
+ {
+ "title": "Definition: text position selector",
+ "description": "True when object is a text position selelctor (Section 4.2.5)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/textPositionSelectorTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "start": { "type": "integer", "minimum": 0 },
+ "end": { "type": "integer","minimum": 0 }
+ },
+ "required": ["start", "end"]
+ }
+ ]
+ },
+
+ "textPositionSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/textPositionSelectorTypeDetected" } },
+ { "$ref": "#/definitions/textPositionSelectorDetected" }
+ ]
+ },
+
+ "dataPositionSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["DataPositionSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "dataPositionSelectorDetected":
+ {
+ "title": "Definition: data position selector",
+ "description": "True when object is a data position selelctor (Section 4.2.5)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/dataPositionSelectorTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "start": { "type": "integer", "minimum": 0 },
+ "end": { "type": "integer","minimum": 0 }
+ },
+ "required": ["start", "end"]
+ }
+ ]
+ },
+
+ "dataPositionSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/dataPositionSelectorTypeDetected" } },
+ { "$ref": "#/definitions/dataPositionSelectorDetected" }
+ ]
+ },
+
+ "svgSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["SvgSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "svgSelectorDetected":
+ {
+ "title": "Detection: svg selector",
+ "description": "True when object is a svg selelctor (Section 4.2.7)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/svgSelectorTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "value": { "type": "string" },
+ "id": { "$ref": "id.json#/definitions/arraySingleStringUri" }
+ },
+ "oneOf": [
+ {"required": ["value"] },
+ {"required": ["id"] }
+ ]
+ }
+ ]
+ },
+
+ "svgSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/svgSelectorTypeDetected" } },
+ { "$ref": "#/definitions/svgSelectorDetected" }
+ ]
+ },
+
+ "rangeSelectorTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["RangeSelector"] }
+ },
+ "required": ["type"]
+ },
+
+ "rangeSelectorDetected":
+ {
+ "title": "Detection: range selector",
+ "description": "True when object is a range selelctor (Section 4.2.9)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/rangeSelectorTypeDetected" },
+ {
+ "type": "object",
+ "patternProperties":
+ {
+ "^(startSelector|endSelector)$":
+ { "type": "object",
+ "oneOf": [
+ {"$ref": "#/definitions/fragmentSelectorDetected"},
+ {"$ref": "#/definitions/cssSelectorDetected"},
+ {"$ref": "#/definitions/xpathSelectorDetected"},
+ {"$ref": "#/definitions/textQuoteSelectorDetected"},
+ {"$ref": "#/definitions/textPositionSelectorDetected"},
+ {"$ref": "#/definitions/dataPositionSelectorDetected"},
+ {"$ref": "#/definitions/svgSelectorDetected"}
+ ]
+ }
+ },
+ "required": ["startSelector", "endSelector"]
+ }
+ ]
+ },
+
+ "rangeSelectorTypeValidIfPresent":
+ {
+ "description": "True if Selector Type not detected (i.e., not present), or if both Type and Selector detected (i.e., Selector constraints met); note, Selector cannot be detected if Selector Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/rangeSelectorTypeDetected" } },
+ { "$ref": "#/definitions/rangeSelectorDetected" }
+ ]
+ },
+
+ "stateDefined" :
+ {
+ "title": "Definition: state",
+ "description": "True when object tested has state with value matching one or more of the state classes described in the model (Section 4.3)",
+ "type": "object",
+ "properties":
+ {
+ "state":
+ {
+ "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "anyOf": [
+ {"$ref": "id.json#/definitions/idValueFound"},
+ {"$ref": "#/definitions/timeStateDetected"},
+ {"$ref": "#/definitions/requestHeaderStateDetected"}
+ ]
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "anyOf": [
+ {"$ref": "id.json#/definitions/idValueFound"},
+ {"$ref": "#/definitions/timeStateDetected"},
+ {"$ref": "#/definitions/requestHeaderStateDetected"}
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "itemStateValidIfPresent":
+ {
+ "description": "True if ALL items in the items array of object tested have no state, or have a state that is uri, or have a state that has recognized value(s)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "$ref": "#/definitions/stateDefined" }
+ ]
+ }
+ }
+ }
+ },
+
+ "stateDetected":
+ {
+ "title": "Detection: state type",
+ "description": "True when object tested has state(s) that is(are) recognized as being one or more of the states described in the model (Section 4.3)",
+ "type": "object",
+ "$ref": "#/definitions/stateDefined",
+ "required": ["state"]
+ },
+
+ "timeStateTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["TimeState"] }
+ },
+ "required": ["type"]
+ },
+
+ "timeStateDetected":
+ {
+ "title": "Detection: time state",
+ "description": "True when object is a time state (Section 4.3.1)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/timeStateTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "sourceDate":
+ { "oneOf": [
+ { "type": "string",
+ "format": "date-time"},
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ {"type": "string", "format": "date-time"}
+ }
+ ]
+ },
+ "sourceDateStart": { "type": "string", "format": "date-time"},
+ "sourceDateEnd": { "type": "string", "format": "date-time"},
+ "cached": { "type": "string", "format": "uri"}
+ },
+ "oneOf":
+ [
+ { "required": ["sourceDate"] },
+ { "required": ["sourceDateStart", "sourceDateEnd"] }
+ ],
+ "not":
+ { "required": [ "sourceDate", "sourceDateStart", "sourceDateEnd" ] }
+ }
+ ]
+ },
+
+ "cachedPropertyFound":
+ {
+ "title": "Detection: time state with cached key",
+ "description": "True when object is a time state with a cached key (Section 4.3.1)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/timeStateDetected"},
+ { "required": ["cached"] }
+ ]
+ },
+
+ "timeStateTypeValidIfPresent":
+ {
+ "description": "True if State Type not detected (i.e., not present), or if both Type and State detected (i.e., State constraints met); note, State cannot be detected if State Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/timeStateTypeDetected" } },
+ { "$ref": "#/definitions/timeStateDetected" }
+ ]
+ },
+
+ "requestHeaderStateTypeDetected":
+ {
+ "type": "object",
+ "properties":
+ {
+ "type": { "type": "string", "enum": ["HttpRequestState"] }
+ },
+ "required": ["type"]
+ },
+
+ "requestHeaderStateDetected":
+ {
+ "title": "Detection: request header state",
+ "description": "True when object is a request header state (Section 4.3.2)",
+ "allOf":
+ [
+ { "$ref": "#/definitions/requestHeaderStateTypeDetected" },
+ {
+ "type": "object",
+ "properties":
+ {
+ "value": { "type": "string"}
+ },
+ "required": ["value"]
+ }
+ ]
+ },
+
+ "requestHeaderStateTypeValidIfPresent":
+ {
+ "description": "True if State Type not detected (i.e., not present), or if both Type and State detected (i.e., State constraints met); note, State cannot be detected if State Type not detected.",
+ "oneOf":
+ [
+ { "not": { "$ref": "#/definitions/requestHeaderStateTypeDetected" } },
+ { "$ref": "#/definitions/requestHeaderStateDetected" }
+ ]
+ },
+
+ "refinedByDefined":
+ {
+ "title": "Definition: refinedBy",
+ "description": "True when object tested has no refinedBy, or has refinedBy identified by uri, or has refinedBy(s) with value matching one or more of the refinedBys described in the model (Section 4.2)",
+ "type": "object",
+ "properties":
+ {
+ "refinedBy":
+ {
+ "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "anyOf": [
+ {"$ref": "id.json#/definitions/idValueFound"},
+ {"$ref": "#/definitions/fragmentSelectorDetected"},
+ {"$ref": "#/definitions/cssSelectorDetected"},
+ {"$ref": "#/definitions/xpathSelectorDetected"},
+ {"$ref": "#/definitions/textQuoteSelectorDetected"},
+ {"$ref": "#/definitions/textPositionSelectorDetected"},
+ {"$ref": "#/definitions/dataPositionSelectorDetected"},
+ {"$ref": "#/definitions/rangeSelectorDetected"},
+ {"$ref": "#/definitions/svgSelectorDetected"},
+ {"$ref": "#/definitions/timeStateDetected"},
+ {"$ref": "#/definitions/requestHeaderStateDetected"}
+ ]
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items":
+ { "oneOf": [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "anyOf": [
+ {"$ref": "id.json#/definitions/idValueFound"},
+ {"$ref": "#/definitions/fragmentSelectorDetected"},
+ {"$ref": "#/definitions/cssSelectorDetected"},
+ {"$ref": "#/definitions/xpathSelectorDetected"},
+ {"$ref": "#/definitions/textQuoteSelectorDetected"},
+ {"$ref": "#/definitions/textPositionSelectorDetected"},
+ {"$ref": "#/definitions/dataPositionSelectorDetected"},
+ {"$ref": "#/definitions/rangeSelectorDetected"},
+ {"$ref": "#/definitions/svgSelectorDetected"},
+ {"$ref": "#/definitions/timeStateDetected"},
+ {"$ref": "#/definitions/requestHeaderStateDetected"}
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "checkForRefinedBy":
+ {
+ "description": "True if no state or selector, if no refinedBy, or if correct refinedBy",
+ "type": "object",
+ "patternProperties":
+ {
+ "^(state|selector)$":
+ {"oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "$ref": "#/definitions/refinedByDefined" },
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ {"oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "type": "object",
+ "$ref": "#/definitions/refinedByDefined" }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "itemRefinedByValidIfPresent":
+ {
+ "description": "True if items in the items array of object tested have no refinedBy, or have a refinedBy that is uri, or have a refinedBy that has recognized value(s)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "$ref": "#/definitions/checkForRefinedBy" }
+ ]
+ }
+ }
+ }
+ },
+
+ "refinedByDetected":
+ {
+ "title": "Detection: refinedBy ",
+ "description": "True when object tested has selector or state that has refinedBy(s) that is(are) recognized as being one or more of the refinedBys described in the model (Section 4.2)",
+ "type": "object",
+ "anyOf":
+ [
+ { "properties":
+ { "state" : { "$ref ": "#/definitions/refinedByWithinStateSelector" } },
+ "required": ["state"]
+ },
+ { "properties":
+ { "selector" : { "$ref ": "#/definitions/refinedByWithinStateSelector" } },
+ "required": ["selector"]
+ }
+ ]
+ },
+
+ "refinedByWithinStateSelector":
+ {
+ "oneOf":
+ [
+ { "type": "object",
+ "$ref": "#/definitions/refinedByDefined",
+ "required": ["refinedBy"]
+ },
+ { "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ {"not":
+ { "type": "object",
+ "$ref": "#/definitions/refinedByDefined",
+ "required": ["refinedBy"]
+ }
+ }
+ }
+ }
+ ]
+ },
+
+ "styleClassDefinition":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: styleClass property value",
+ "description": "True when the object has no styleClass property or has a styleClass property that appears with source and that is a string value or array of string values (Section 4.4)",
+ "properties":
+ {
+ "styleClass":
+ {
+ "oneOf":
+ [
+ { "type": "string" },
+ { "type": "array",
+ "minItems": 1,
+ "items": { "type": "string" } }
+ ]
+ }
+ },
+ "dependencies":
+ {
+ "styleClass": ["source"]
+ }
+ },
+
+ "styleClassDetected":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: styleClass key with qualifying body/target classes",
+ "description": "Supports implementation check of styleClass (if/when) used on Specific Resources (Sections 4.4)",
+ "type": "object",
+ "allOf": [
+ { "$ref": "#/definitions/styleClassDefinition" },
+ { "required": ["styleClass"] }
+ ]
+ },
+
+ "itemStyleClassPropertyDetected":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having styleClass key with qualifying body/target classes",
+ "description": "Supports implementation check of items having styleClass (if/when) used on Specific Resources (Sections 4.4)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/styleClassDetected" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "renderedViaDefinition":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: renderedVia property value",
+ "description": "True when the body/target has no renderedVia property or has a valid renderedVia property (Section 4.5)",
+ "type": "object",
+ "properties": {
+ "renderedVia":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri"},
+ { "$ref": "id.json#/definitions/idValueFound"},
+ { "type": "array",
+ "minItems": 1,
+ "items":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri"},
+ { "$ref": "id.json#/definitions/idValueFound"}
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+
+ "renderedViaDetected":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: renderedVia key with qualifying body/target classes",
+ "description": "Supports implementation check of renderedVia (if/when) used on Specific Resources (Sections 4.4)",
+ "allOf": [
+ { "$ref": "#/definitions/sourceDetected" },
+ { "required": ["renderedVia"] },
+ { "$ref": "#/definitions/renderedViaDefinition" }
+ ]
+ },
+
+ "itemRenderedViaPropertyDetected":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: items having renderedVia key with qualifying body/target classes",
+ "description": "Supports implementation check of items having renderedVia (if/when) used on Specific Resources (Sections 4.4)",
+ "type": "object",
+ "properties":
+ {
+ "items":
+ {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ {
+ "items":
+ { "not": { "$ref": "#/definitions/renderedViaDetected" } }
+ }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "scopeDefinition":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: scope property value",
+ "description": "True when the body/target has no scope property or has a valid scope property (Section 4.6)",
+ "type": "object",
+ "properties": {
+ "scope":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/stringUri"},
+ { "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "id.json#/definitions/stringUri"}
+ }
+ ]
+ }
+ }
+ },
+
+ "scopeDetected":
+ { "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Collate: scope key with qualifying body/target classes",
+ "description": "Supports implementation check of scope (if/when) used on Specific Resource Body (Sections 4.6)",
+ "$ref": "#/definitions/sourceDetected",
+ "allOf": [
+ {"required": ["scope"]},
+ {"$ref": "#/definitions/scopeDefinition"}
+ ]
+ },
+
+ "sourceWithCreated":
+ {
+ "description": "True if no source, or source is uri, or source is object that does not have created key, or if source is object that has only 1 created key of date-time format",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri" },
+ { "$ref": "otherProperties.json#/definitions/createdValidIfPresent" }
+ ]
+ }
+ }
+ },
+
+ "sourceWithModified":
+ {
+ "description": "True if no source, or source is uri, or source is object that does not have modified key, or if source is object that has only 1 modified key of date-time format",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri" },
+ { "$ref": "otherProperties.json#/definitions/modifiedValidIfPresent" }
+ ]
+ }
+ }
+ },
+
+ "sourceWithRights":
+ {
+ "description": "True if no source, or source is uri, or source is object that does not have rights key, or if source is object that has rights key with all values of uri format",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri" },
+ { "$ref": "otherProperties.json#/definitions/rightsValidIfPresent" }
+ ]
+ }
+ }
+ },
+
+ "sourceWithCanonical":
+ {
+ "description": "True if no source, or source is uri, or source is object that does not have canonical key, or if source is object that has only 1 canonical key of uri format",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri" },
+ { "$ref": "otherProperties.json#/definitions/canonicalValidIfPresent" }
+ ]
+ }
+ }
+ },
+
+ "sourceWithVia":
+ {
+ "description": "True if no source, or source is uri, or source is object that does not have via key, or if source is object that has via key with all values of uri format",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri" },
+ { "$ref": "otherProperties.json#/definitions/viaValidIfPresent" }
+ ]
+ }
+ }
+ },
+
+ "sourceWithTextDirection":
+ {
+ "description": "True if no source, or source is uri, or source is object that does not have textDirection key, or if source is object that has only 1 textDirectoin key, one of ltr, rtl, auto",
+ "type": "object",
+ "properties":
+ {
+ "source":
+ {
+ "oneOf":
+ [
+ { "$ref": "id.json#/definitions/arraySingleStringUri" },
+ { "$ref": "bodyTarget.json#/definitions/textDirectionValidIfPresent" }
+ ]
+ }
+ }
+ },
+
+ "specificResourceWithItems" :
+ {
+ "description": "True if both source and items keys are present.",
+ "allOf":
+ [
+ { "$ref": "#/definitions/sourceDetected"},
+ { "required": [ "items" ] }
+ ]
+ },
+
+ "itemSRWithItems":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/specificResourceWithItems" } } }
+ }
+ },
+ "required": ["items"]
+ },
+
+ "specificResourceWithValue" :
+ {
+ "description": "True if both source and value keys are present.",
+ "allOf":
+ [
+ { "$ref": "#/definitions/sourceDetected"},
+ { "required": [ "value" ] }
+ ]
+ },
+
+ "itemSRWithValue":
+ {
+ "type": "object",
+ "properties":
+ {
+ "items": {
+ "type": "array",
+ "minItems": 1,
+ "not":
+ { "items": {"not": { "$ref": "#/definitions/specificResourceWithValue" } } }
+ }
+ },
+ "required": ["items"]
+ }
+
+ }
+}