{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bioecon.ru/data/schema/record.schema.json",
  "title": "Bioecon public record",
  "description": "One record of the Bioecon knowledge base, as published in /api/v1/<section>/<id>/index.json and as a line of /data/bundle/<lang>/<section>.jsonl. Text fields are in the language of the build (lang); @id is the same in every language.",
  "type": "object",
  "required": ["@id", "@type", "id", "name", "url", "section", "lang", "formats", "links"],
  "properties": {
    "@id": { "type": "string", "format": "uri", "pattern": "^https://[^/]+/[a-z-]+/.+/$", "description": "Stable identifier: the record's address on the default-language site." },
    "@type": { "enum": ["Organization", "Technology", "Substitution", "Industry", "Capability", "RegulatoryRoute", "MarketItem", "Grant", "Tender", "Article", "ScienceArticle", "Page"] },
    "id": { "type": "string", "minLength": 1, "description": "Identifier inside its section (slug or code)." },
    "name": { "type": "string", "minLength": 1 },
    "url": { "type": "string", "pattern": "^/", "description": "Path of the HTML page on this language's site." },
    "section": { "type": "string", "minLength": 1 },
    "lang": { "enum": ["ru", "en", "cn"] },
    "formats": {
      "type": "object", "required": ["html"],
      "properties": { "html": { "type": "string", "format": "uri" }, "json": { "type": "string", "format": "uri" }, "markdown": { "type": "string", "format": "uri" } },
      "additionalProperties": false
    },
    "links": {
      "type": "object", "description": "Related records, by relation, as @id values.",
      "additionalProperties": { "type": "array", "items": { "type": "string", "format": "uri" } }
    },
    "industries": { "type": "array", "items": { "type": "string" } },
    "summary": { "type": "string" }
  },
  "additionalProperties": true
}
