Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Specification
Specification
Functions
Schemas
Registers

Provenance

Source schemas/json/provenance.schema.json

On this page
  1. Properties
  2. Positive fixtures
  3. Negative fixtures
  4. Mappings to open standards
  5. Schema

W3C PROV-O shaped provenance bundle (OBSP 0.1 section 5.6) that travels with observations and derived products: entities, activities and agents (by UNI and protocol role) with used, wasGeneratedBy, wasDerivedFrom, wasAssociatedWith, wasAttributedTo and actedOnBehalfOf relations. Identifiers in relations name members of this bundle or durable UNIs.

FieldValue
Identifierurn:obsp:schema:v3.1:provenance
Dialecthttps://json-schema.org/draft/2020-12/schema
Used by functionsQualify

Properties

PropertyRequiredTypeDescription
schemaVersionyesreference
apiVersionyesconstant
kindyesconstant
protocolVersionyesconstant
provenanceUniyesreference
entitiesyesarray
activitiesyesarray
agentsyesarray
usednoarray
wasGeneratedByyesarray
wasDerivedFromnoarray
wasAssociatedWithnoarray
wasAttributedTonoarray
actedOnBehalfOfnoarray
recordedAtyesreference
extensionsnoreference

Positive fixtures

  • provenance.valid.json

Negative fixtures

  • provenance.agent-company-role.json: agent role is a protocol role
  • provenance.missing-was-generated-by.json: a bundle states what generated its entity
  • provenance.named-agent.json: agents carry a protocol role, never a name
  • provenance.no-activities.json: a bundle has at least one activity
  • provenance.unknown-relation.json: only PROV-O relations of the profile

Mappings to open standards

A mapping to a standard, never a conformance statement.

  • maps to NS-2 Citation and attribution (relation REL-NS-2)
  • maps to W3C PROV-O (relation EXT-PROV)

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:obsp:schema:v3.1:provenance",
  "title": "Provenance",
  "description": "W3C PROV-O shaped provenance bundle (OBSP 0.1 section 5.6) that travels with observations and derived products: entities, activities and agents (by UNI and protocol role) with used, wasGeneratedBy, wasDerivedFrom, wasAssociatedWith, wasAttributedTo and actedOnBehalfOf relations. Identifiers in relations name members of this bundle or durable UNIs.",
  "type": "object",
  "required": [
    "schemaVersion",
    "apiVersion",
    "kind",
    "protocolVersion",
    "provenanceUni",
    "entities",
    "activities",
    "agents",
    "wasGeneratedBy",
    "recordedAt"
  ],
  "properties": {
    "schemaVersion": {
      "$ref": "#/$defs/SchemaVersion"
    },
    "apiVersion": {
      "const": "obsp/provenance/v3.1"
    },
    "kind": {
      "const": "Provenance"
    },
    "protocolVersion": {
      "const": "obsp/0.1"
    },
    "provenanceUni": {
      "$ref": "#/$defs/Uni"
    },
    "entities": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "entityKind"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/Uni"
          },
          "entityKind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{2,63}$",
            "description": "Contract stem or data kind, e.g. observation-record"
          },
          "version": {
            "$ref": "#/$defs/RecordVersion"
          },
          "digest": {
            "$ref": "#/$defs/Digest"
          },
          "generatedAtTime": {
            "$ref": "#/$defs/Timestamp"
          }
        },
        "additionalProperties": false,
        "description": "prov:Entity"
      }
    },
    "activities": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "activityKind",
          "startedAtTime"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/Uni"
          },
          "activityKind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{2,63}$"
          },
          "startedAtTime": {
            "$ref": "#/$defs/Timestamp"
          },
          "endedAtTime": {
            "$ref": "#/$defs/Timestamp"
          },
          "softwareVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "implementationDigest": {
            "$ref": "#/$defs/Digest"
          }
        },
        "additionalProperties": false,
        "description": "prov:Activity"
      }
    },
    "agents": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "agentKind",
          "role"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/Uni"
          },
          "agentKind": {
            "enum": [
              "SOFTWARE_AGENT",
              "PERSON_IN_ROLE",
              "ORGANISATION_IN_ROLE"
            ]
          },
          "role": {
            "$ref": "#/$defs/ProtocolRole"
          }
        },
        "additionalProperties": false,
        "description": "prov:Agent, identified by UNI and protocol role, never by name"
      }
    },
    "used": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "activity",
          "entity"
        ],
        "properties": {
          "activity": {
            "$ref": "#/$defs/Uni"
          },
          "entity": {
            "$ref": "#/$defs/Uni"
          },
          "role": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{1,63}$"
          }
        },
        "additionalProperties": false
      }
    },
    "wasGeneratedBy": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "entity",
          "activity"
        ],
        "properties": {
          "entity": {
            "$ref": "#/$defs/Uni"
          },
          "activity": {
            "$ref": "#/$defs/Uni"
          },
          "time": {
            "$ref": "#/$defs/Timestamp"
          }
        },
        "additionalProperties": false
      },
      "minItems": 1
    },
    "wasDerivedFrom": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "generatedEntity",
          "usedEntity"
        ],
        "properties": {
          "generatedEntity": {
            "$ref": "#/$defs/Uni"
          },
          "usedEntity": {
            "$ref": "#/$defs/Uni"
          },
          "activity": {
            "$ref": "#/$defs/Uni"
          },
          "derivationKind": {
            "enum": [
              "DERIVATION",
              "REVISION",
              "QUOTATION",
              "PRIMARY_SOURCE"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "wasAssociatedWith": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "activity",
          "agent"
        ],
        "properties": {
          "activity": {
            "$ref": "#/$defs/Uni"
          },
          "agent": {
            "$ref": "#/$defs/Uni"
          },
          "role": {
            "$ref": "#/$defs/ProtocolRole"
          }
        },
        "additionalProperties": false
      }
    },
    "wasAttributedTo": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "entity",
          "agent"
        ],
        "properties": {
          "entity": {
            "$ref": "#/$defs/Uni"
          },
          "agent": {
            "$ref": "#/$defs/Uni"
          }
        },
        "additionalProperties": false
      }
    },
    "actedOnBehalfOf": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "delegate",
          "responsible"
        ],
        "properties": {
          "delegate": {
            "$ref": "#/$defs/Uni"
          },
          "responsible": {
            "$ref": "#/$defs/Uni"
          },
          "activity": {
            "$ref": "#/$defs/Uni"
          }
        },
        "additionalProperties": false
      }
    },
    "recordedAt": {
      "$ref": "#/$defs/Timestamp"
    },
    "extensions": {
      "$ref": "#/$defs/Extensions"
    }
  },
  "$defs": {
    "SchemaVersion": {
      "type": "string",
      "const": "3.1.0"
    },
    "Uni": {
      "type": "string",
      "minLength": 8,
      "maxLength": 256,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9:._/@-]{7,255}$",
      "description": "Durable UNI or typed unresolved identifier according to authority rules"
    },
    "Digest": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,31}:[A-Fa-f0-9]{32,128}$",
      "description": "Algorithm-prefixed hexadecimal digest"
    },
    "NonEmptyString": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "RecordVersion": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]+){0,2}$"
    },
    "Extensions": {
      "type": "object",
      "description": "Namespaced extension bag; unknown top-level fields remain forbidden.",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$"
      },
      "additionalProperties": true
    },
    "EvidenceRef": {
      "type": "object",
      "required": [
        "uri",
        "digest"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        },
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "recordedAt": {
          "$ref": "#/$defs/Timestamp"
        }
      },
      "additionalProperties": false
    },
    "ProtocolRole": {
      "enum": [
        "NODE",
        "SITE_CELL",
        "CLUSTER",
        "FED_PEER",
        "GRID_OPERATOR",
        "PROVIDER",
        "VERIFIER",
        "CONSUMER",
        "STEWARD"
      ],
      "description": "OBSP 0.1 participant role (specification section 3). Roles, never company names."
    },
    "RecordRef": {
      "type": "object",
      "required": [
        "uni",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "VersionedRecordRef": {
      "type": "object",
      "required": [
        "uni",
        "version",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "CorrectionState": {
      "enum": [
        "CURRENT",
        "DISPUTED",
        "SUPERSEDED",
        "WITHDRAWN",
        "RECALLED"
      ]
    }
  },
  "additionalProperties": false
}