{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ver.cy/schemas/dimension/1.0/relation.schema.json",
  "title": "Vercy immutable relation assertion",
  "type": "object",
  "required": ["recordType", "schemaVersion", "relationId", "relationType", "sourceId", "targetId", "validFrom", "validTo", "recordedAt", "status", "provenance"],
  "additionalProperties": false,
  "properties": {
    "recordType": {"const": "relation"},
    "schemaVersion": {"const": "1.0.0"},
    "relationId": {"type": "string", "minLength": 3},
    "relationType": {"type": "string", "minLength": 1},
    "sourceId": {"type": "string", "minLength": 3},
    "targetId": {"type": "string", "minLength": 3},
    "validFrom": {"type": "string", "format": "date-time"},
    "validTo": {"type": ["string", "null"]},
    "recordedAt": {"type": "string", "format": "date-time"},
    "status": {"type": "string", "enum": ["asserted", "contested", "retracted"]},
    "provenance": {"type": "object"},
    "accessClass": {"type": "string"}
  }
}
