{
  "$id": "https://schemas.dissco.tech/schemas/fdo-type/annotation/0.3.0/annotation.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$comment": "Annotation Version 0.3.0",
  "title": "Annotation",
  "description": "Information about the Annotation data model. This model has been based on the W3C Web Annotation model",
  "type": "object",
  "properties": {
    "@id": {
      "type": "string",
      "description": "The unique identifier (handle) of the Annotation object",
      "pattern": "^https:\/\/hdl\\.handle\\.net\/[\\w.]+\/(.){3}-(.){3}-(.){3}",
      "examples": [
        "https://hdl.handle.net/20.5000.1025/XXX-XXX-XXX"
      ]
    },
    "@type": {
      "type": "string",
      "description": "The type of the object, in this case ods:Annotation",
      "const": "ods:Annotation"
    },
    "ods:ID": {
      "type": "string",
      "description": "The handle of the annotation. It is a unique identifier for the annotation. It is composed of the handle of the document followed by a slash and a unique identifier for the annotation.",
      "pattern": "^https:\/\/hdl\\.handle\\.net\/[\\w.]+\/(.){3}-(.){3}-(.){3}",
      "examples": [
        "https://hdl.handle.net/20.5000.1025/XXX-XXX-XXX"
      ]
    },
    "ods:status": {
      "enum": [
        "ods:Draft",
        "ods:Active",
        "ods:Tombstone"
      ],
      "description": "The status of the Digital Object."
    },
    "ods:jobID": {
      "type": "string",
      "description": "Handle of the job record, if the annotation was produced by a Machine Annotation Service, only filled when annotation was created by a MAS",
      "pattern": "^https:\/\/hdl\\.handle\\.net\/[\\w.]+\/(.){3}-(.){3}-(.){3}",
      "examples": [
        "https://hdl.handle.net/20.5000.1025/XXX-XXX-XXX"
      ]
    },
    "rdf:type": {
      "type": "string",
      "description": "The type of the annotation. It is always ods:Annotation. https://www.w3.org/TR/rdf12-schema/#ch_type",
      "const": "ods:Annotation"
    },
    "ods:version": {
      "type": "integer",
      "description": "The version of the object, each change generates a new version",
      "minimum": 1,
      "examples": [
        1
      ]
    },
    "oa:motivation": {
      "description": "The motivation for the annotation. Based on a selection of https://www.w3.org/TR/annotation-model/#motivation-and-purpose. The motivation ods:adding is added for DiSSCo's purposes.",
      "enum": [
        "ods:adding",
        "ods:deleting",
        "oa:assessing",
        "oa:editing",
        "oa:commenting"
      ]
    },
    "oa:motivatedBy": {
      "type": "string",
      "description": "Describes the reason for the annotation. https://www.w3.org/TR/annotation-vocab/#motivatedby",
      "examples": [
        "The country is incorrect"
      ]
    },
    "oa:hasTarget": {
      "type": "object",
      "description": "Indicates the particular object and part of the object on which the annotation has been made.",
      "$ref": "https://schemas.dissco.tech/schemas/fdo-type/annotation/0.3.0/annotation-target.json"
    },
    "oa:hasBody": {
      "type": "object",
      "description": "The body of the annotation contains the specific value of the annotation",
      "$ref": "https://schemas.dissco.tech/schemas/fdo-type/annotation/0.3.0/annotation-body.json"
    },
    "dcterms:creator": {
      "type": "object",
      "description": "Contains an ods:Agent object",
      "$ref": "https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/agent.json"
    },
    "dcterms:created": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the annotation was created. https://purl.org/dc/terms/created"
    },
    "dcterms:modified": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the annotation was last modified, generating a new version. https://purl.org/dc/terms/modified"
    },
    "dcterms:issued": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the annotation was generated. https://purl.org/dc/terms/issued"
    },
    "as:generator": {
      "type": "object",
      "description": "Object containing information on who generated the object. Generated is here seen as who stored/indexed the object. In most case this will be the annotation-processing-service. Contains an ods:Agent object.",
      "$ref": "https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/agent.json"
    },
    "schema:AggregateRating": {
      "type": "object",
      "description": "The average rating based on multiple ratings or reviews",
      "properties": {
        "@type": {
          "type": "string",
          "const": "schema:AggregateRating",
          "description": "Indicates which type of aggregateRating we are using."
        },
        "schema:ratingCount": {
          "type": "integer",
          "description": "The count of total number of ratings. https://schema.org/ratingCount",
          "minimum": 0,
          "examples": [
            3
          ]
        },
        "schema:ratingValue": {
          "type": "number",
          "description": "The rating for the content. https://schema.org/ratingValue",
          "examples": [
            4.5
          ]
        }
      },
      "required": [
        "@type",
        "schema:ratingCount",
        "schema:ratingValue"
      ],
      "additionalProperties": false
    },
    "ods:batchID": {
      "type": "string",
      "format": "uuid",
      "description": "Internally generated PID to identify the batch the annotation was generated by"
    },
    "ods:placeInBatch": {
      "type": "integer",
      "description": "For batching only. Links annotation to batchMetadata provided in a batch event. If present, must correspond to an ods:placeInBatch in the batch metadata"
    },
    "ods:mergingDecisionStatus": {
      "enum": [
        "ods:Pending",
        "ods:Rejected",
        "ods:Approved"
      ],
      "description": "The merging status of the annotation. Only present when motivation is ods:adding or oa:editing"
    },
    "ods:mergingStateChangeDate": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the annotation was merging state was changed. Only present when motivation is ods:adding or oa:editing"
    },
    "ods:MergingStateChangedBy": {
      "type": "object",
      "description": "Object containing information on who changed the merging state of the annotation. Only present when motivation is ods:adding or oa:editing. Contains an ods:Agent object.",
      "$ref": "https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/agent.json"
    },
    "ods:TombstoneMetadata": {
      "type": "object",
      "description": "Object containing the tombstone metadata of the object. Only present when ods:status is ods:Tombstone",
      "$ref": "https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/tombstone-metadata.json"
    }
  },
  "required": [
    "@id",
    "@type",
    "ods:ID",
    "rdf:type",
    "ods:version",
    "oa:motivation",
    "oa:hasTarget",
    "oa:hasBody",
    "dcterms:creator",
    "dcterms:created",
    "dcterms:modified",
    "as:generator",
    "dcterms:issued"
  ],
  "additionalProperties": false
}
