annotations.json (7299B)
1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "annotations.json", 4 "title": "Definitions: Annotations.", 5 "description": "Schemas in #/definitions detect or validate keys/objects (direct children) uniquely used to describe Annotations (Section 3.1 and 3.3.5).", 6 "definitions": { 7 8 "contextValueFound": { 9 "$schema": "http://json-schema.org/draft-04/schema#", 10 "title": "Definition: Valid @context string", 11 "description": "True when the string has value http://www.w3.org/ns/anno.jsonld (Section 3.1)", 12 "type": "string", 13 "enum": [ "http://www.w3.org/ns/anno.jsonld" ] 14 }, 15 16 "contextValueInArrayFound": { 17 "$schema": "http://json-schema.org/draft-04/schema#", 18 "title": "Definition: Valid @context string found in array", 19 "description": "True when the array contains a string item having value http://www.w3.org/ns/anno.jsonld (Section 3.1)", 20 "type": "array", 21 "not": 22 { "items": 23 { "not": 24 { "$ref": "#/definitions/contextValueFound" } 25 } 26 } 27 }, 28 29 "annotationTypeValueRecognized": { 30 "$schema": "http://json-schema.org/draft-04/schema#", 31 "title": "Definition: Valid annotation type value string", 32 "description": "True when the string has value 'Annotation' (Section 3.1)", 33 "type": "string", 34 "enum": [ "Annotation" ] 35 }, 36 37 "annotationTypeValueInArrayRecognized": { 38 "$schema": "http://json-schema.org/draft-04/schema#", 39 "title": "Definition: Valid annotation type array", 40 "description": "True when the array contains a string item having value 'Annotation' (Section 3.1)", 41 "type": "array", 42 "not": 43 { "items": 44 { "not": 45 { "$ref": "#/definitions/annotationTypeValueRecognized" } 46 } 47 } 48 }, 49 50 "annotationTypeValueFound": 51 { 52 "$schema": "http://json-schema.org/draft-04/schema#", 53 "title": "Implementation: Annotation type", 54 "description": "True when the Annotation has type key and 'Annotation' is a value of type (Section 3.1)", 55 "type": "object", 56 "required": [ "type" ], 57 "properties": { 58 "type": { 59 "oneOf": [ 60 { "$ref": "annotations.json#/definitions/annotationTypeValueRecognized" }, 61 { "$ref": "annotations.json#/definitions/annotationTypeValueInArrayRecognized" } 62 ] 63 } 64 } 65 }, 66 67 "motivationList": 68 { "$schema": "http://json-schema.org/draft-04/schema#", 69 "title": "Definitions: list of motivation and purposes", 70 "description": "List of motivations and purposes as defined in the model (Section 3.3.5).", 71 "type": "string", 72 "enum": ["assessing", "bookmarking", "classifying", "commenting", "describing", "editing", "highlighting", "identifying", "linking", "moderating", "questioning", "replying", "tagging" ] 73 }, 74 75 "motivationRecognizedIfPresent": 76 { "$schema": "http://json-schema.org/draft-04/schema#", 77 "title": "Validation: motivation value", 78 "description": "True when the annotation has 0 or more motivation property values (Section 3.3.5)", 79 "type": "object", 80 "properties": {"motivation": 81 { "oneOf": [ 82 { "$ref": "#/definitions/motivationList" }, 83 { "type": "array", 84 "minItems": 1, 85 "items": { "$ref": "#/definitions/motivationList" } } 86 ] 87 } 88 } 89 }, 90 91 "motivationSingularIfPresent": 92 { "$schema": "http://json-schema.org/draft-04/schema#", 93 "title": "Validation: singular motivation value", 94 "description": "True when the annotation has 0 or exactly one motivation property value (Section 3.3.5)", 95 "type": "object", 96 "properties": {"motivation": 97 { "oneOf": [ 98 { "$ref": "#/definitions/motivationList" }, 99 { "type": "array", 100 "minItems": 1, 101 "maxItems": 1, 102 "items": { "$ref": "#/definitions/motivationList" } } 103 ] 104 } 105 } 106 }, 107 108 "motivationPropertyFound": 109 { "$schema": "http://json-schema.org/draft-04/schema#", 110 "title": "Collate: via motivation with qualifying annotation class", 111 "description": "Supports implementation check of via (if/when) used on Annotation (Sections 3.3.5)", 112 "oneOf": [ 113 {"$ref": "#/definitions/annotationTypeValueFound"} 114 ], 115 "allOf": [ 116 {"required": ["motivation"]}, 117 {"$ref": "#/definitions/motivationRecognizedIfPresent"} 118 ] 119 }, 120 121 "singleMotivationPropertyFound": 122 { "$schema": "http://json-schema.org/draft-04/schema#", 123 "title": "Collate: via motivation with qualifying annotation class", 124 "description": "Supports implementation check of via (if/when) used on Annotation (Sections 3.3.5)", 125 "oneOf": [ 126 {"$ref": "#/definitions/annotationTypeValueFound"} 127 ], 128 "allOf": [ 129 {"required": ["motivation"]}, 130 {"$ref": "#/definitions/motivationSingularIfPresent"} 131 ] 132 }, 133 134 "stylesheetValueDefinition": 135 { 136 "title": "Definition: stylesheet value", 137 "description": "True when Annotation has no stylesheet, references an external stylesheet, or has embedded stylesheet of type CssStylesheet (Section 4.4)", 138 "type": "object", 139 "properties": 140 { 141 "stylesheet": 142 { 143 "oneOf": 144 [ 145 { "$ref": "id.json#/definitions/arraySingleStringUri"}, 146 { "type": "object", 147 "properties": 148 { 149 "type": { "type": "string", 150 "enum": [ "CssStylesheet" ]}, 151 "id": { "$ref": "id.json#/definitions/stringUri" }, 152 "value": { "type": "string" } 153 }, 154 "not": { "required": [ "id", "value"] }, 155 "oneOf": [ 156 { "required": [ "id"] }, 157 { "required": [ "value"] } 158 ] 159 } 160 ] 161 } 162 } 163 }, 164 165 "stylesheetDetected": 166 { 167 "$schema": "http://json-schema.org/draft-04/schema#", 168 "title": "Check for implementation of Annotation stylesheet", 169 "description": "True when the Annotation has a valid stylesheet property (Section 4.4)", 170 "allOf": [ 171 {"required": ["stylesheet"]}, 172 {"$ref": "#/definitions/stylesheetValueDefinition"} 173 ] 174 }, 175 176 "bodyValueValidIfPresent": 177 { 178 "$schema": "http://json-schema.org/draft-04/schema#", 179 "title": "Validation: bodyValue", 180 "description": "True when the Annotation has no bodyValue key or has a bodyValue key with valid value (Section 3.2.5)", 181 "type": "object", 182 "properties": 183 { 184 "bodyValue": 185 { 186 "oneOf": 187 [ 188 { "type": "string" }, 189 { "type": "array", 190 "minItems": 1, 191 "maxItems": 1, 192 "items": { "type": "string" } 193 } 194 ] 195 } 196 } 197 }, 198 199 "bodyValueFound": 200 { 201 "$schema": "http://json-schema.org/draft-04/schema#", 202 "title": " Implementation: bodyValue", 203 "description": "True when the Annotation has a valid bodyValue (Section 3.2.5)", 204 "allOf": 205 [ 206 { "$ref": "#/definitions/bodyValueValidIfPresent" }, 207 { "required": [ "bodyValue" ] } 208 ] 209 } 210 211 } 212 }