{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/specif/versions/1.0.json",
  "title": "JSON-Schema for SpecIF v1.0",
  "description": "The Specification Integration Facility (SpecIF) integrates partial system models from different methods and tools in a semantic net. Collaborators shall browse, search and audit engineering results in a common context. Also, the exchange of model information between organizations and tools is facilitated. SpecIF represents the visible, i.e. the diagrams and the text, as well as the semantics of system specifications.",
  "x-lintel": {
    "source": "https://www.schemastore.org/specif-1.0.json",
    "sourceSha256": "5c81016e7395a8b77a48ba4dd9d0ac500727e3b2a80a51d91b05bf950b4e9a6c",
    "fileMatch": [
      "*.specif",
      "*.specif.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?:\\/\\/(specif\\.de\\/v1\\.0\\/schema|.+\\/specif-1\\.0)\\.json$",
      "description": "An absolute URL pointing to this SpecIF schema."
    },
    "id": {
      "$ref": "#/$defs/id"
    },
    "title": {
      "$ref": "#/$defs/value"
    },
    "description": {
      "$ref": "#/$defs/value"
    },
    "isExtension": {
      "type": "boolean",
      "description": "Indicates that the project is not schema-compliant on its own; by default the value is 'false'. Of course, it is expected that once extended the project is schema-compliant."
    },
    "generator": {
      "type": "string"
    },
    "generatorVersion": {
      "type": "string"
    },
    "rights": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "title",
        "type",
        "url"
      ]
    },
    "createdAt": {
      "$ref": "#/$defs/dateTime"
    },
    "createdBy": {
      "description": "The creator of the SpecIF data-set (file). If specified, at least an e-mail address must be given.",
      "type": "object",
      "properties": {
        "familyName": {
          "type": "string"
        },
        "givenName": {
          "type": "string"
        },
        "org": {
          "type": "object",
          "properties": {
            "organizationName": {
              "type": "string"
            }
          },
          "required": [
            "organizationName"
          ]
        },
        "email": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "value": {
              "type": "string",
              "format": "email"
            }
          },
          "required": [
            "value"
          ]
        }
      },
      "required": [
        "email"
      ]
    },
    "language": {
      "description": "An IETF language tag such as 'en', 'en-US, 'fr' or 'de' showing the used language of simple property values. Is superseded by a resource's, statement's or property's language value.",
      "type": "string"
    },
    "dataTypes": {
      "description": "The base data types for use by property class definitions.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "title": "Data-type 'Boolean' or 'dateTime'",
                "description": "The corresponding definition in <https://www.w3.org/TR/xmlschema-2/> applies.",
                "enum": [
                  "xs:boolean",
                  "xs:dateTime"
                ]
              },
              "id": {
                "$ref": "#/$defs/id"
              },
              "title": {
                "$ref": "#/$defs/value"
              },
              "description": {
                "$ref": "#/$defs/value"
              },
              "revision": {
                "$ref": "#/$defs/revision"
              },
              "replaces": {
                "$ref": "#/$defs/replaces"
              },
              "changedAt": {
                "$ref": "#/$defs/dateTime"
              },
              "changedBy": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "type",
              "changedAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "title": "Data-type 'Integer'",
                "description": "The corresponding definition in <https://www.w3.org/TR/xmlschema-2/> applies.",
                "enum": [
                  "xs:integer"
                ]
              },
              "id": {
                "$ref": "#/$defs/id"
              },
              "title": {
                "$ref": "#/$defs/value"
              },
              "description": {
                "$ref": "#/$defs/value"
              },
              "minInclusive": {
                "type": "number",
                "title": "Minimum Value of a Number",
                "description": "Optional use by dataTypes 'xs:integer' and 'xs:double'."
              },
              "maxInclusive": {
                "type": "number",
                "title": "Maximum Value of a Number",
                "description": "Optional use by dataTypes 'xs:integer' and 'xs:double'."
              },
              "revision": {
                "$ref": "#/$defs/revision"
              },
              "replaces": {
                "$ref": "#/$defs/replaces"
              },
              "changedAt": {
                "$ref": "#/$defs/dateTime"
              },
              "changedBy": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "type",
              "changedAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "title": "Data-type 'Double'",
                "description": "The corresponding definition in <https://www.w3.org/TR/xmlschema-2/> applies.",
                "enum": [
                  "xs:double"
                ]
              },
              "id": {
                "$ref": "#/$defs/id"
              },
              "title": {
                "$ref": "#/$defs/value"
              },
              "description": {
                "$ref": "#/$defs/value"
              },
              "fractionDigits": {
                "type": "integer",
                "title": "Number of fraction digits of a Decimal Number",
                "description": "Optional use by dataType 'xs:double', indicates the number of decimals.",
                "minimum": 1
              },
              "minInclusive": {
                "type": "number",
                "title": "Minimum Value of a Number",
                "description": "Optional use by dataTypes 'xs:integer' and 'xs:double'."
              },
              "maxInclusive": {
                "type": "number",
                "title": "Maximum Value of a Number",
                "description": "Optional use by dataTypes 'xs:integer' and 'xs:double'."
              },
              "revision": {
                "$ref": "#/$defs/revision"
              },
              "replaces": {
                "$ref": "#/$defs/replaces"
              },
              "changedAt": {
                "$ref": "#/$defs/dateTime"
              },
              "changedBy": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "type",
              "changedAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "title": "Data-type 'String' or 'Formatted Text'",
                "description": "The corresponding definition in <https://www.w3.org/TR/xmlschema-2/> resp. <https://www.w3.org/TR/xhtml1/> applies.",
                "enum": [
                  "xs:string",
                  "xhtml"
                ]
              },
              "id": {
                "$ref": "#/$defs/id"
              },
              "title": {
                "$ref": "#/$defs/value"
              },
              "description": {
                "$ref": "#/$defs/value"
              },
              "maxLength": {
                "type": "integer",
                "title": "Maximum String Length",
                "description": "Optional use by dataTypes 'xs:string' and 'xhtml'.",
                "minimum": 0
              },
              "revision": {
                "$ref": "#/$defs/revision"
              },
              "replaces": {
                "$ref": "#/$defs/replaces"
              },
              "changedAt": {
                "$ref": "#/$defs/dateTime"
              },
              "changedBy": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "type",
              "changedAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "title": "Data-type 'Enumeration'",
                "description": "The corresponding definition in <https://www.w3.org/TR/xmlschema-2/> applies.",
                "enum": [
                  "xs:enumeration"
                ]
              },
              "id": {
                "$ref": "#/$defs/id"
              },
              "title": {
                "$ref": "#/$defs/value"
              },
              "description": {
                "$ref": "#/$defs/value"
              },
              "values": {
                "type": "array",
                "title": "Enumerated Values",
                "description": "Mandatory use by dataType 'xs:enumeration'. If 'multiple' is true 0..n options may be selected, otherwise exactly one must be selected.",
                "uniqueItems": true,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "$ref": "#/$defs/id"
                    },
                    "value": {
                      "$ref": "#/$defs/value"
                    }
                  },
                  "required": [
                    "id",
                    "value"
                  ]
                }
              },
              "multiple": {
                "type": "boolean",
                "description": "Optional use by dataType 'xs:enumeration'. Indicates whether multiple values can be chosen; by default the value is 'false'."
              },
              "revision": {
                "$ref": "#/$defs/revision"
              },
              "replaces": {
                "$ref": "#/$defs/replaces"
              },
              "changedAt": {
                "$ref": "#/$defs/dateTime"
              },
              "changedBy": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "type",
              "changedAt"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "propertyClasses": {
      "description": "Class definition of a property for resources or statements. Is a sub-element of the respective resourceClass or statementClass. If no revision or change information is specified, the respective values of the parent element apply.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value"
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "dataType": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of dataTypes."
          },
          "multiple": {
            "type": "boolean",
            "description": "Optional use by a propertyClass with dataType 'xs:enumeration'. Indicates whether multiple values can be chosen. If omitted, the 'multiple' property of the dataType applies; by default the value is 'false'."
          },
          "value": {
            "$ref": "#/$defs/value",
            "description": "An optional default value in case the instantiated resource's or statement's property is missing."
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "dataType",
          "changedAt"
        ]
      }
    },
    "resourceClasses": {
      "description": "The class definitions for resources.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value"
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "extends": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of resourceClasses."
          },
          "icon": {
            "$ref": "#/$defs/icon"
          },
          "isHeading": {
            "type": "boolean"
          },
          "instantiation": {
            "$ref": "#/$defs/instantiation"
          },
          "propertyClasses": {
            "type": "array",
            "description": "A collection of keys of eligible property classes",
            "minItems": 0,
            "uniqueItems": true,
            "items": {
              "$ref": "#/$defs/key",
              "description": "Must be a member of propertyClasses."
            }
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "changedAt"
        ]
      }
    },
    "statementClasses": {
      "description": "The class definitions for statements in subject-predicate-object statements, where subject and object are resources.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value"
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "extends": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of statementClasses."
          },
          "icon": {
            "$ref": "#/$defs/icon"
          },
          "instantiation": {
            "$ref": "#/$defs/instantiation"
          },
          "isUndirected": {
            "type": "boolean",
            "description": "Indicates that an instance's subject and object are equivalent and can be exchanged without changing its meaning. Is superseded by a statement's definition."
          },
          "propertyClasses": {
            "type": "array",
            "description": "A collection of keys of eligible property classes",
            "minItems": 0,
            "uniqueItems": true,
            "items": {
              "$ref": "#/$defs/key",
              "description": "Must be a member of propertyClasses."
            }
          },
          "subjectClasses": {
            "type": "array",
            "title": "Resource and statement classes eligible as subject",
            "description": "A collection of id's of eligible resource and statement classes; if 'subjectClasses' is missing, all resource or statement classes are eligible.",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "$ref": "#/$defs/key",
              "description": "Must be a member of resourceClasses or statementClasses."
            }
          },
          "objectClasses": {
            "type": "array",
            "title": "Resource and statement classes eligible as object",
            "description": "A collection of id's of eligible resource and statement classes; if 'objectClasses' is missing, all resource or statement classes are eligible.",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "$ref": "#/$defs/key",
              "description": "Must be a member of resourceClasses or statementClasses."
            }
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "changedAt"
        ]
      }
    },
    "resources": {
      "description": "The resources such as diagrams, model elements or requirements.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value"
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "class": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of resourceClasses."
          },
          "language": {
            "description": "An IETF language tag such as 'en', 'en-US, 'fr' or 'de' showing the used language of simple property values. Is superseded by a property's language value.",
            "type": "string"
          },
          "properties": {
            "$ref": "#/$defs/properties"
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "alternativeIds": {
            "$ref": "#/$defs/alternativeIds"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "class",
          "changedAt"
        ]
      }
    },
    "statements": {
      "description": "Subject-predicate-Object statements, where subject and object are resources. In other terms, statements are directed relations between two resources building a semantic net.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value",
            "description": "The statement's appelation; if missing, the statementClass' title applies."
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "class": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of statementClasses."
          },
          "subject": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of resources or statements."
          },
          "object": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of resources or statements."
          },
          "language": {
            "description": "An IETF language tag such as 'en', 'en-US, 'fr' or 'de' showing the used language of simple property values. Is superseded by a property's language value.",
            "type": "string"
          },
          "properties": {
            "$ref": "#/$defs/properties"
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "alternativeIds": {
            "$ref": "#/$defs/alternativeIds"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "class",
          "subject",
          "object",
          "changedAt"
        ]
      }
    },
    "hierarchies": {
      "$ref": "#/$defs/nodes",
      "description": "A list of hierarchies with pointers to resources; may be nested to build a tree, i.e. a hierarchy of pointers."
    },
    "files": {
      "description": "A list of files being referenced by a resource's or statement's property of dataType XHTML using an <object> tag. A file should have a media type as defined by IANA (see below).",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value",
            "description": "In case of a file, the title is the absolute or relative URL."
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "type": {
            "description": "The file's media type (formerly MIME-type) according to <https://www.iana.org/assignments/media-types/media-types.xhtml>.",
            "type": "string"
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "type",
          "changedAt"
        ]
      }
    }
  },
  "required": [
    "$schema",
    "id",
    "title",
    "resourceClasses",
    "statementClasses",
    "resources",
    "statements",
    "hierarchies"
  ],
  "$defs": {
    "id": {
      "description": "A globally unique identifier.",
      "type": "string",
      "pattern": "^[_a-zA-Z]{1}[_a-zA-Z0-9.-]*$"
    },
    "revision": {
      "description": "A globally unique revision tag with one or multiple blocks with alphanumeric characters separated by a special character [.:,;/-]. Sequential as well as branching/merging notations are possible.",
      "type": "string",
      "pattern": "^(?:[0-9a-zA-Z]+[.:,;/-])*[0-9a-zA-Z]+$"
    },
    "replaces": {
      "description": "For change and configuration management; the first revision has 0 entries, a simple modification has 1 entry and the result of a merge has 2 entries.",
      "type": "array",
      "maxItems": 2,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/revision"
      }
    },
    "key": {
      "description": "A unique key for a particular revision of an identifiable item, e.g. of a resource.",
      "oneOf": [
        {
          "$ref": "#/$defs/id",
          "description": "A string with a valid identifier; where the last revision (i.e. revision=0) is implied."
        },
        {
          "description": "A key consisting of a globally unique identifier and a revision. No or an undefined revision means the latest revision of the identified item.",
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/id"
            },
            "revision": {
              "$ref": "#/$defs/revision"
            }
          },
          "required": [
            "id"
          ]
        }
      ]
    },
    "dateTime": {
      "description": "An ISO-8601 dateTime string. For reduced accuracy, any number of values may be dropped, but only from right to left.",
      "type": "string",
      "format": "date-time"
    },
    "icon": {
      "description": "A symbol for display as a prefix to titles; applicable to all instances of the class. Is usually a XML-encoded UTF-8 symbol, can be an URL or dataURL.",
      "type": "string"
    },
    "instantiation": {
      "description": "Indicates whether an instance of the class is created automatically, manually or both. All is allowed, if the property is omitted. The class is abstract and cannot be instantiated, if the property list is present, but empty.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "auto",
          "user"
        ]
      }
    },
    "alternativeIds": {
      "description": "The list of consolidated items which can be used in case a consolidated item shall be updated.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "description": "A list of pointers to resources resp statements which have been merged to this one.",
        "oneOf": [
          {
            "$ref": "#/$defs/id",
            "description": "A string with a valid identifier of a model-element; where the last revision (i.e. revision=0) is implied."
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/id",
                "description": "A string with a valid identifier of a model-element"
              },
              "revision": {
                "$ref": "#/$defs/revision"
              },
              "project": {
                "$ref": "#/$defs/id",
                "description": "A string with a valid project identifier"
              }
            },
            "required": [
              "id"
            ]
          }
        ]
      }
    },
    "value": {
      "description": "A property value according to the property class.",
      "oneOf": [
        {
          "description": "A string containing some text or a special value.",
          "type": "string"
        },
        {
          "description": "A list of items with text and language properties. Thus, the information can be given in multiple languages.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "description": "A string containing some text.",
                "type": "string"
              },
              "language": {
                "description": "An IETF language tag such as 'en', 'en-US, 'fr' or 'de'.",
                "type": "string"
              }
            },
            "required": [
              "text",
              "language"
            ],
            "additionalProperties": false
          }
        }
      ]
    },
    "nodes": {
      "description": "A list of pointers to resources; may be nested to build a tree, i.e. a hierarchy of pointers.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value",
            "description": "The node's label; if missing, the title of the referenced resource is applied."
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "resource": {
            "$ref": "#/$defs/key",
            "description": "The pointer to the resource to be displayed at this position."
          },
          "nodes": {
            "$ref": "#/$defs/nodes",
            "description": "The next hierarchy level."
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime"
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "resource",
          "changedAt"
        ]
      }
    },
    "properties": {
      "description": "A list of properties of a resource or statement.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/id"
          },
          "title": {
            "$ref": "#/$defs/value",
            "description": "The property's label; if missing, the title of the property's class is applied."
          },
          "description": {
            "$ref": "#/$defs/value"
          },
          "class": {
            "$ref": "#/$defs/key",
            "description": "Must be a member of propertyClasses. In addition, it must be listed in the propertyClasses of the parent's class."
          },
          "value": {
            "$ref": "#/$defs/value",
            "description": "If the value is unknown, omit the whole property. By default, the class' value applies."
          },
          "revision": {
            "$ref": "#/$defs/revision"
          },
          "replaces": {
            "$ref": "#/$defs/replaces"
          },
          "changedAt": {
            "$ref": "#/$defs/dateTime",
            "description": "Without change information, the parent's change information applies."
          },
          "changedBy": {
            "type": "string"
          }
        },
        "required": [
          "class",
          "value"
        ]
      }
    }
  },
  "id": "http://specif.de/v1.0/schema#"
}
