{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://w3id.org/aow/schemas/work-item.schema.json",
  "title": "Work Item",
  "description": "The unit of business work that the rest of the ontology is about: a claim, an application, an order, a case, a ticket.",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ref",
      "description": "Stable identifier of the entity. Serialized as the node's IRI."
    },
    "type": {
      "const": "WorkItem",
      "description": "The AOW class of the entity (for example, \"Intent\")."
    },
    "label": {
      "description": "Short human-readable name.",
      "type": "string"
    },
    "description": {
      "description": "Longer human-readable explanation.",
      "type": "string"
    },
    "version": {
      "description": "Version of this entity definition, ideally a semantic version such as \"1.4.2\".",
      "type": "string"
    },
    "created_at": {
      "description": "When this entity or version was created.",
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "description": "The Actor responsible for creating this entity or version.",
      "$ref": "#/$defs/ref"
    },
    "revision_of": {
      "description": "The earlier version this entity revises.",
      "$ref": "#/$defs/ref"
    },
    "item_type": {
      "description": "The kind of work item, for example \"insurance-claim\" or \"purchase-order\".",
      "type": "string"
    },
    "external_ref": {
      "description": "Identifier of the item in its system of record.",
      "type": "string"
    },
    "state": {
      "description": "Current business state of the item, in the vocabulary of its system of record.",
      "type": "string"
    },
    "opened_at": {
      "description": "When the item entered the process.",
      "type": "string",
      "format": "date-time"
    },
    "closed_at": {
      "description": "When the item left the process, if it has.",
      "type": "string",
      "format": "date-time"
    }
  },
  "patternProperties": {
    "^[A-Za-z][A-Za-z0-9_-]*:[A-Za-z0-9_-]+$": {
      "description": "Extension property, namespaced with a prefix."
    }
  },
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "item_type"
  ],
  "$defs": {
    "ref": {
      "type": "string",
      "minLength": 1,
      "description": "Identifier of an entity: an IRI, a compact IRI such as aow:AL2, or an id relative to the document base."
    }
  }
}
