{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://digitaltwin.org.uk/ptw/element-card.schema.json",
  "title": "Element card (Periodic Table of Work), draft 0.1",
  "description": "One capability: what goes in, what it does, what comes out, who answers for it, how much, how fast, at what rate, and its record, failures included. Same shape as a capability in an organisational digital twin.",
  "type": "object",
  "required": [
    "symbol",
    "name",
    "reactants",
    "reaction",
    "product",
    "made_of",
    "nucleus"
  ],
  "properties": {
    "symbol": {
      "type": "string",
      "pattern": "^[A-Z][a-z]?$",
      "description": "One or two letters, like a chemical symbol."
    },
    "name": {
      "type": "string"
    },
    "family": {
      "type": "string",
      "description": "Group on the table, e.g. find, win, deliver, money, people, data, support, govern."
    },
    "made_of": {
      "type": "string",
      "enum": [
        "person",
        "team",
        "software",
        "ai",
        "mix"
      ]
    },
    "make_up": {
      "type": "string",
      "description": "Who or what is inside it."
    },
    "nucleus": {
      "type": "object",
      "description": "The named person who answers for it. Always a person.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "identity": {
          "type": "string",
          "enum": [
            "verified",
            "declared"
          ]
        }
      }
    },
    "reactants": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What it must be given (inputs)."
    },
    "reaction": {
      "type": "string",
      "description": "What it does (the transformation)."
    },
    "product": {
      "type": "string",
      "description": "What it hands on (output), specific enough to check."
    },
    "catalysts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "own": {
            "type": "boolean",
            "description": "Invented by the Element."
          }
        }
      }
    },
    "yield": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        },
        "unit": {
          "type": "string"
        },
        "per": {
          "type": "string"
        }
      }
    },
    "reaction_time": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number"
        },
        "unit": {
          "type": "string",
          "enum": [
            "hours",
            "days"
          ]
        }
      }
    },
    "rate": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "basis": {
          "type": "string",
          "description": "per product, per period, per contract, % of value"
        }
      }
    },
    "bonds_offered": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "spark",
          "half-life",
          "stable"
        ]
      }
    },
    "titration": {
      "type": "object",
      "description": "Trial offered before bonding.",
      "properties": {
        "transactions": {
          "type": "integer"
        },
        "days": {
          "type": "integer"
        }
      }
    },
    "data_tenure": {
      "type": "string",
      "enum": [
        "compound-owns",
        "leased",
        "shared",
        "stewarded",
        "escrow"
      ]
    },
    "record": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "level",
          "claim"
        ],
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "verified",
              "declared",
              "projected"
            ]
          },
          "claim": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          }
        }
      }
    },
    "failures": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "what": {
            "type": "string"
          },
          "changed": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          }
        }
      }
    },
    "isotopes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Symbols of the same Element with a different make-up."
    },
    "made_of_elements": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "For a Molecule: the Elements inside it, in order."
    },
    "version": {
      "type": "string"
    },
    "listed_since": {
      "type": "string",
      "format": "date"
    }
  }
}
