Skip to content

Contribution

Referenced schema · Source · Dereferenced version

A dated contribution by an agent to a record.

Fields

Field Type Required Description
id string matching ^ctrb:[a-z]+:\d{4}-\d{2}-\d{2}:\d+$ yes
type always Contribution yes
agent_id string matching ^agent:(org|user):[a-z0-9]+$ yes Foreign key to agents.id.
description string yes
date string matching ^\d{4}-\d{2}-\d{2}$ yes

JSON Schema

Full JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://moalmanac.org/schemas/referenced/contributions.schema.json",
  "title": "Contribution",
  "description": "A dated contribution by an agent to a record.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^ctrb:[a-z]+:\\d{4}-\\d{2}-\\d{2}:\\d+$"
    },
    "type": {
      "const": "Contribution"
    },
    "agent_id": {
      "type": "string",
      "pattern": "^agent:(org|user):[a-z0-9]+$",
      "description": "Foreign key to `agents.id`."
    },
    "description": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "id",
    "type",
    "agent_id",
    "description",
    "date"
  ],
  "additionalProperties": false
}