tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

collections.json (14639B)


      1 {
      2  "$schema": "http://json-schema.org/draft-04/schema#",
      3  "id": "collections.json",
      4  "title": "Definitions: Annotation Collections.",
      5  "description": "Schemas in #/definitions detect or validate keys/objects (direct children) uniquely used to describe Annotation Collections (Section 5.1 and 5.2).",
      6  "definitions": {
      7 
      8    "contextValueFound": {
      9      "$schema": "http://json-schema.org/draft-04/schema#",
     10      "title": "Definition: Valid @context string included in Collection / Page description",
     11      "description": "True when the string has value http://www.w3.org/ns/anno.jsonld (Section 5)",
     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 included in Collection / Page description",
     19      "description": "True when the array contains a string item having value http://www.w3.org/ns/anno.jsonld (Section 5)",
     20      "type": "array",
     21      "not":
     22      { "items":
     23        { "not":
     24          { "$ref": "#/definitions/contextValueFound" }
     25        }
     26      }
     27    },
     28 
     29    "annotationCollectionTypeValueRecognized": {
     30      "$schema": "http://json-schema.org/draft-04/schema#",
     31      "title": "Definition: Valid AnnotationCollection type value string included in Collection description",
     32      "description": "True when the string has value 'AnnotationCollection' (Section 5.1)",
     33      "type": "string",
     34      "enum": [ "AnnotationCollection" ]
     35    },
     36 
     37    "annotationCollectionTypeValueInArrayRecognized": {
     38      "$schema": "http://json-schema.org/draft-04/schema#",
     39      "title": "Definition: Valid AnnotationCollection type in array included in Collection description",
     40      "description": "True when the array contains a string item having value 'AnnotationCollection' (Section 5.1)",
     41      "type": "array",
     42      "not":
     43      { "items":
     44        { "not":
     45          { "$ref": "#/definitions/annotationCollectionTypeValueRecognized" }
     46        }
     47      }
     48    },
     49 
     50    "annotationCollectionTypeValueFound":
     51    {
     52      "$schema": "http://json-schema.org/draft-04/schema#",
     53      "title": "Implementation: AnnotationCollection type",
     54      "description": "True when the Annotation Collection has type key and 'AnnotationCollection' is a value of type (Section 5.1)",
     55      "type": "object",
     56      "required": [ "type" ],
     57      "properties": {
     58        "type": {
     59          "oneOf": [
     60          { "$ref": "#/definitions/annotationCollectionTypeValueRecognized" },
     61          { "$ref": "#/definitions/annotationCollectionTypeValueInArrayRecognized" }
     62          ]
     63        }
     64      }
     65    },
     66 
     67    "annotationPageTypeValueRecognized": {
     68      "$schema": "http://json-schema.org/draft-04/schema#",
     69      "title": "Definition: Valid AnnotationPage type value string included in Page description",
     70      "description": "True when the string has value 'AnnotationPage' (Section 5.2)",
     71      "type": "string",
     72      "enum": [ "AnnotationPage" ]
     73    },
     74 
     75    "annotationPageTypeValueInArrayRecognized": {
     76      "$schema": "http://json-schema.org/draft-04/schema#",
     77      "title": "Definition: Valid AnnotationPage type in array included in Page description",
     78      "description": "True when the array contains a string item having value 'AnnotationPage' (Section 5.2)",
     79      "type": "array",
     80      "not":
     81      { "items":
     82        { "not":
     83          { "$ref": "#/definitions/annotationPageTypeValueRecognized" }
     84        }
     85      }
     86    },
     87 
     88    "annotationPageTypeValueFound":
     89    {
     90      "$schema": "http://json-schema.org/draft-04/schema#",
     91      "title": "Implementation: AnnotationPage type",
     92      "description": "True when the Annotation Page has type key and 'AnnotationPage' is a value of type (Section 5.2)",
     93      "type": "object",
     94      "required": [ "type" ],
     95      "properties": {
     96        "type": {
     97          "oneOf": [
     98          { "$ref": "#/definitions/annotationPageTypeValueRecognized" },
     99          { "$ref": "#/definitions/annotationPageTypeValueInArrayRecognized" }
    100          ]
    101        }
    102      }
    103    },
    104 
    105    "labelDefinition":
    106    {
    107      "$schema": "http://json-schema.org/draft-04/schema#",
    108      "title": "Definition: label (Annotation Collections)",
    109      "description": "True when the object has no label or has one or more label values of type string (Section 5.1)",
    110      "type": "object",
    111      "properties":
    112      {
    113        "label":
    114        {
    115          "oneOf":
    116            [
    117            {"type": "string" },
    118            {"type": "array",
    119              "minItems": 1,
    120              "items": {"type": "string"}
    121            }
    122            ]
    123        }
    124      }
    125    },
    126 
    127    "labelFound":
    128    {
    129      "$schema": "http://json-schema.org/draft-04/schema#",
    130      "title": "Check for implementation of Annotation Collection label",
    131      "description": "True when the object has one or more label value(s) (Section 5.1)",
    132      "allOf": [
    133      {"required": ["label"]},
    134      {"$ref": "#/definitions/labelDefinition"}
    135      ]
    136    },
    137 
    138    "totalDefinition":
    139    {
    140      "$schema": "http://json-schema.org/draft-04/schema#",
    141      "title": "Definition: total (Annotation Collections)",
    142      "description": "True when the object has no total key or has exactly one total value of type integer greater or equal to zero (Section 5.1)",
    143      "type": "object",
    144      "properties":
    145      {
    146        "total":
    147        {
    148          "oneOf":
    149            [
    150             {"type": "integer",
    151              "minimum": 0 },
    152             {"type": "array",
    153               "minItems": 1,
    154               "maxItems": 1,
    155               "items": {"type": "integer",
    156                         "minimum": 0 }
    157             }
    158            ]
    159        }
    160      }
    161    },
    162 
    163    "totalFound":
    164    {
    165      "$schema": "http://json-schema.org/draft-04/schema#",
    166      "title": "Check for implementation of Annotation Collection total key",
    167      "description": "True when the object has exactly one total value (Section 5.1)",
    168      "allOf": [
    169      {"required": ["total"]},
    170      {"$ref": "#/definitions/totalDefinition"}
    171      ]
    172    },
    173 
    174    "totalMoreThanZero":
    175    {
    176      "$schema": "http://json-schema.org/draft-04/schema#",
    177      "title": "Definition: total more than zero (Annotation Collections)",
    178      "description": "True when the object has exactly one total value of type integer and greater than zero (Section 5.1)",
    179      "type": "object",
    180      "properties":
    181      {
    182        "total":
    183        {
    184          "oneOf":
    185            [
    186             {"type": "integer",
    187              "minimum": 0,
    188              "exclusiveMinimum": true},
    189             {"type": "array",
    190               "minItems": 1,
    191               "maxItems": 1,
    192               "items": {"type": "integer",
    193                         "minimum": 0,
    194                         "exclusiveMinimum": true}
    195             }
    196            ]
    197        }
    198      },
    199      "required": [ "total" ]
    200    },
    201 
    202    "firstValidIfPresent":
    203    {   "$schema": "http://json-schema.org/draft-04/schema#",
    204      "title": "Validation: first value (Annotation Collection)",
    205      "description": "True when the Annotation Collection has no first key or has 1 first key value that is string of format uri or has first key value that is an object of type AnnotationPage (Section 5.1)",
    206      "type": "object",
    207      "properties": {"first":
    208        { "oneOf": [
    209          {
    210            "oneOf": [
    211              { "$ref": "id.json#/definitions/stringUri" },
    212              { "$ref": "#/definitions/annotationPageTypeValueFound" }
    213             ]
    214          },
    215          { "type": "array",
    216            "minItems": 1,
    217            "maxItems": 1,
    218            "items": {
    219                "oneOf": [
    220                  { "$ref": "id.json#/definitions/stringUri" },
    221                  { "$ref": "#/definitions/annotationPageTypeValueFound" }
    222               ]
    223             }
    224          }
    225         ]
    226        }
    227      }
    228    },
    229 
    230    "firstFound":
    231    {
    232      "$schema": "http://json-schema.org/draft-04/schema#",
    233      "title": "Check for implementation of Annotation Collection first key",
    234      "description": "True when the object has exactly one first value (Section 5.1)",
    235      "allOf": [
    236      {"required": ["first"]},
    237      {"$ref": "#/definitions/firstValidIfPresent"}
    238      ]
    239    },
    240 
    241    "firstRequiredIfTotalMoreThanZero":
    242    {
    243      "$schema": "http://json-schema.org/draft-04/schema#",
    244      "title": "If total greater than zero, check for implementation of Annotation Collection first key",
    245      "description": "True when the object has no total or has total = zero or has exactly one first value (Section 5.1)",
    246      "type": "object",
    247      "oneOf": [
    248        {
    249          "allOf": [
    250             { "$ref": "#/definitions/totalMoreThanZero" },
    251             { "$ref": "#/definitions/firstFound" }
    252          ]
    253        },
    254        { "not": { "$ref": "#/definitions/totalMoreThanZero" } }
    255      ]
    256    },
    257 
    258    "lastValidIfPresent":
    259    {   "$schema": "http://json-schema.org/draft-04/schema#",
    260      "title": "Validation: last value (Annotation Collection)",
    261      "description": "True when the Annotation Collection has no last key or has 1 last key value that is string of format uri (Section 5.1)",
    262      "type": "object",
    263      "properties": {"last":
    264        { "oneOf": [
    265          { "$ref": "id.json#/definitions/stringUri" },
    266          { "type": "array",
    267            "minItems": 1,
    268            "maxItems": 1,
    269            "items": { "$ref": "id.json#/definitions/stringUri" }
    270          }
    271         ]
    272        }
    273      }
    274    },
    275 
    276    "lastFound":
    277    {
    278      "$schema": "http://json-schema.org/draft-04/schema#",
    279      "title": "Check for implementation of Annotation Collection last key",
    280      "description": "True when the object has exactly one last value that is string of format uri (Section 5.1)",
    281      "allOf": [
    282      {"required": ["last"]},
    283      {"$ref": "#/definitions/lastValidIfPresent"}
    284      ]
    285    },
    286 
    287    "partOfValidIfPresent":
    288    {   "$schema": "http://json-schema.org/draft-04/schema#",
    289      "title": "Validation: partOf value (Annotation Page)",
    290      "description": "True when the Annotation Page has no partOf key or has 1 partOf key value that is string of format uri (Section 5.2)",
    291      "type": "object",
    292      "properties": {"partOf":
    293        { "oneOf": [
    294          { "$ref": "id.json#/definitions/arraySingleStringUri" },
    295          { "$ref": "id.json#/definitions/idValueFound" }
    296         ]
    297        }
    298      }
    299    },
    300 
    301    "partOfFound":
    302    {
    303      "$schema": "http://json-schema.org/draft-04/schema#",
    304      "title": "Check for implementation of Annotation Page partOf key",
    305      "description": "True when the object has exactly one partOf value that is string of format uri (Section 5.2)",
    306      "allOf": [
    307      {"required": ["partOf"]},
    308      {"$ref": "#/definitions/partOfValidIfPresent"}
    309      ]
    310    },
    311 
    312    "nextValidIfPresent":
    313    {   "$schema": "http://json-schema.org/draft-04/schema#",
    314      "title": "Validation: next value (Annotation Page)",
    315      "description": "True when the Annotation Page has no next key or has 1 next key value that is string of format uri (Section 5.2)",
    316      "type": "object",
    317      "properties": {"next":
    318        { "oneOf": [
    319          { "$ref": "id.json#/definitions/stringUri" },
    320          { "type": "array",
    321            "minItems": 1,
    322            "maxItems": 1,
    323            "items": { "$ref": "id.json#/definitions/stringUri" }
    324          }
    325         ]
    326        }
    327      }
    328    },
    329 
    330    "nextFound":
    331    {
    332      "$schema": "http://json-schema.org/draft-04/schema#",
    333      "title": "Check for implementation of Annotation Page next key",
    334      "description": "True when the object has exactly one next value that is string of format uri (Section 5.2)",
    335      "allOf": [
    336      {"required": ["next"]},
    337      {"$ref": "#/definitions/nextValidIfPresent"}
    338      ]
    339    },
    340 
    341    "prevValidIfPresent":
    342    {   "$schema": "http://json-schema.org/draft-04/schema#",
    343      "title": "Validation: prev value (Annotation Page)",
    344      "description": "True when the Annotation Page has no prev key or has 1 prev key value that is string of format uri (Section 5.2)",
    345      "type": "object",
    346      "properties": {"prev":
    347        { "oneOf": [
    348          { "$ref": "id.json#/definitions/stringUri" },
    349          { "type": "array",
    350            "minItems": 1,
    351            "maxItems": 1,
    352            "items": { "$ref": "id.json#/definitions/stringUri" }
    353          }
    354         ]
    355        }
    356      }
    357    },
    358 
    359    "prevFound":
    360    {
    361      "$schema": "http://json-schema.org/draft-04/schema#",
    362      "title": "Check for implementation of Annotation Page prev key",
    363      "description": "True when the object has exactly one prev value that is string of format uri (Section 5.2)",
    364      "allOf": [
    365      {"required": ["prev"]},
    366      {"$ref": "#/definitions/prevValidIfPresent"}
    367      ]
    368    },
    369 
    370    "startIndexDefinition":
    371    {
    372      "$schema": "http://json-schema.org/draft-04/schema#",
    373      "title": "Definition: startIndex (Annotation Pages)",
    374      "description": "True when the object has no startIndex key or has exactly one startIndex value of type integer greater or equal to zero (Section 5.2)",
    375      "type": "object",
    376      "properties":
    377      {
    378        "startIndex":
    379        {
    380          "oneOf":
    381            [
    382             {"type": "integer",
    383              "minimum": 0 },
    384             {"type": "array",
    385               "minItems": 1,
    386               "maxItems": 1,
    387               "items": {"type": "integer",
    388                         "minimum": 0 }
    389             }
    390            ]
    391        }
    392      }
    393    },
    394 
    395    "startIndexFound":
    396    {
    397      "$schema": "http://json-schema.org/draft-04/schema#",
    398      "title": "Check for implementation of Annotation Page startIndex key",
    399      "description": "True when the object has exactly one startIndex value (Section 5.2)",
    400      "allOf": [
    401      {"required": ["startIndex"]},
    402      {"$ref": "#/definitions/startIndexDefinition"}
    403      ]
    404    },
    405 
    406    "itemsFound":
    407    {
    408      "$schema": "http://json-schema.org/draft-04/schema#",
    409      "title": "Check for implementation of Annotation Page items key",
    410      "description": "True when the object has items key with value that is an array of strings of format uri and/or objects of type Annotation (Section 5.2)",
    411      "type": "object",
    412      "properties":
    413      {   "items":
    414          {  "type": "array",
    415             "items": {
    416               "oneOf":[
    417                   { "$ref": "annotations.json#/definitions/annotationTypeValueFound" },
    418                   { "type": "string",
    419                     "format": "uri" }
    420                ]
    421              }
    422          }
    423      },
    424      "required": [ "items" ]
    425    }
    426 
    427  }
    428 }