{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bsfproject.com/data/schemas/source.schema.json",
  "title": "BSF Project research source",
  "type": "object",
  "required": ["id", "type", "title", "authors", "year", "license", "doi", "host"],
  "properties": {
    "id": { "type": "string", "pattern": "^src-[a-z0-9-]+$" },
    "type": {
      "type": "string",
      "enum": ["journal-article", "manual", "review", "dataset", "map", "photo"]
    },
    "title": { "type": "string" },
    "authors": { "type": "string" },
    "year": { "type": "integer" },
    "venue": { "type": "string" },
    "license": { "type": "string" },
    "doi": { "type": ["string", "null"] },
    "url": { "type": "string", "format": "uri" },
    "host": {
      "type": "object",
      "required": ["status"],
      "properties": {
        "status": { "type": "string", "enum": ["mirrored", "link-only", "pending"] },
        "path": { "type": ["string", "null"] },
        "bytes": { "type": ["integer", "null"] },
        "note": { "type": "string" }
      }
    },
    "topics": {
      "type": "array",
      "items": { "type": "string" }
    },
    "relevance": { "type": "string" }
  }
}
