{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.org/ocg.config.schema.json",
  "title": "Ontology Companion Generator Config",
  "type": "object",
  "required": ["project", "sources"],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "project": {
      "type": "object",
      "required": ["title", "shortName", "slug", "description", "namespace", "canonicalUri"],
      "properties": {
        "title": { "type": "string" },
        "shortName": { "type": "string" },
        "slug": { "type": "string" },
        "description": { "type": "string" },
        "namespace": { "type": "string", "format": "uri" },
        "canonicalUri": { "type": "string", "format": "uri" },
        "version": { "type": "string" },
        "maintainer": { "type": "string" }
      },
      "additionalProperties": false
    },
    "sources": {
      "type": "object",
      "required": ["ontology"],
      "properties": {
        "ontology": { "type": "string" },
        "ontologyFormat": {
          "type": "string",
          "enum": ["auto", "turtle", "rdfxml", "jsonld", "ntriples"]
        },
        "shapes": { "type": "string" },
        "shex": { "type": "string" },
        "spec": { "type": "string" },
        "examples": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["key", "label", "path"],
            "properties": {
              "key": { "type": "string" },
              "label": { "type": "string" },
              "path": { "type": "string" },
              "description": { "type": "string" }
            },
            "additionalProperties": false
          }
        },
        "artifacts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["key", "label", "path"],
            "properties": {
              "key": { "type": "string" },
              "label": { "type": "string" },
              "path": { "type": "string" },
              "description": { "type": "string" },
              "destinationName": { "type": "string" }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "features": {
      "type": "object",
      "properties": {
        "referencePage": { "type": "boolean" },
        "graphPage": { "type": "boolean" },
        "termPages": { "type": "boolean" },
        "rawViewer": { "type": "boolean" },
        "overviewCards": { "type": "boolean" },
        "hierarchyAsset": { "type": "boolean" },
        "hierarchyOverview": { "type": "boolean" },
        "specPage": { "type": "boolean" },
        "usageGuidePage": { "type": "boolean" }
      },
      "additionalProperties": false
    },
    "hierarchy": {
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "description": { "type": "string" },
        "termTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["class", "objectProperty", "datatypeProperty", "annotationProperty", "concept", "declaredTerm"]
          }
        },
        "relations": {
          "type": "array",
          "items": { "type": "string", "enum": ["subClassOf", "broader"] }
        },
        "rootTerms": {
          "type": "array",
          "items": { "type": "string" }
        },
        "maxRoots": { "type": "integer", "minimum": 1 },
        "maxDepth": { "type": "integer", "minimum": 0 },
        "maxChildrenPerNode": { "type": "integer", "minimum": 1 },
        "maxNodes": { "type": "integer", "minimum": 1 },
        "includeLeafTerms": { "type": "boolean" },
        "includeExternal": { "type": "boolean" },
        "includePropertyRelations": { "type": "boolean" },
        "propertyRelations": {
          "type": "array",
          "items": { "type": "string", "enum": ["domain", "range"] }
        },
        "maxPropertyRelations": { "type": "integer", "minimum": 0 },
        "labelMode": {
          "type": "string",
          "enum": ["label", "qname", "label-and-qname"]
        }
      },
      "additionalProperties": false
    },
    "graph": {
      "type": "object",
      "properties": {
        "defaultView": {
          "type": "string",
          "enum": ["custom", "webvowl"]
        },
        "custom": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean" },
            "label": { "type": "string", "minLength": 1 },
            "defaultMode": {
              "type": "string",
              "enum": ["predicate-nodes", "predicate-edges"]
            },
            "modes": {
              "type": "object",
              "properties": {
                "predicateNodes": { "type": "boolean" },
                "predicateEdges": { "type": "boolean" }
              },
              "additionalProperties": false
            },
            "layout": {
              "type": "object",
              "properties": {
                "iterations": { "type": "integer", "minimum": 50, "maximum": 2000 },
                "seed": { "type": "integer", "minimum": 0, "maximum": 2147483647 },
                "scalingRatio": { "type": "number", "minimum": 0.25, "maximum": 8 },
                "gravity": { "type": "number", "minimum": 0.01, "maximum": 20 },
                "linLogMode": { "type": "boolean" },
                "preventOverlap": { "type": "boolean" },
                "labelSpacing": { "type": "number", "minimum": 0.5, "maximum": 3 }
              },
              "additionalProperties": false
            },
            "labels": {
              "type": "object",
              "properties": {
                "density": { "type": "number", "minimum": 0.1, "maximum": 10 },
                "gridCellSize": { "type": "integer", "minimum": 20, "maximum": 300 },
                "renderedSizeThreshold": { "type": "number", "minimum": 0, "maximum": 20 },
                "forceAllUnder": { "type": "integer", "minimum": 0, "maximum": 2000 }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "webvowl": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean" },
            "serviceUrl": { "type": "string", "format": "uri" },
            "ontologyUrl": { "type": "string", "format": "uri-reference" },
            "height": { "type": "integer", "minimum": 320 }
          },
          "additionalProperties": false
        },
        "colors": {
          "type": "object",
          "properties": {
            "class": { "type": "string" },
            "objectProperty": { "type": "string" },
            "datatypeProperty": { "type": "string" },
            "annotationProperty": { "type": "string" },
            "concept": { "type": "string" },
            "declaredTerm": { "type": "string" },
            "external": { "type": "string" },
            "subClassOf": { "type": "string" },
            "domain": { "type": "string" },
            "range": { "type": "string" },
            "broader": { "type": "string" }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "theme": {
      "type": "object",
      "properties": {
        "fonts": {
          "type": "object",
          "properties": {
            "heading": { "type": "string" },
            "body": { "type": "string" },
            "mono": { "type": "string" }
          },
          "additionalProperties": false
        },
        "colors": {
          "type": "object",
          "properties": {
            "pageBackground": { "type": "string" },
            "pageBackgroundAlt": { "type": "string" },
            "panelBackground": { "type": "string" },
            "cardBackground": { "type": "string" },
            "text": { "type": "string" },
            "mutedText": { "type": "string" },
            "accent": { "type": "string" },
            "accentStart": { "type": "string" },
            "accentBorder": { "type": "string" },
            "accentStrong": { "type": "string" },
            "border": { "type": "string" },
            "warmAccent": { "type": "string" }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "site": {
      "type": "object",
      "properties": {
        "basePath": { "type": "string" },
        "branding": {
          "type": "object",
          "properties": {
            "headerImage": { "type": "string" },
            "favicon": { "type": "string" }
          },
          "additionalProperties": false
        },
        "hero": {
          "type": "object",
          "properties": {
            "kicker": { "type": "string" },
            "headline": { "type": "string" },
            "body": { "type": "string" }
          },
          "additionalProperties": false
        },
        "resourcePanel": {
          "type": "object",
          "properties": {
            "title": { "type": "string" },
            "body": { "type": "string" }
          },
          "additionalProperties": false
        },
        "toc": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean" },
            "title": { "type": "string" },
            "collapseLabel": { "type": "string" },
            "expandLabel": { "type": "string" }
          },
          "additionalProperties": false
        },
        "home": {
          "type": "object",
          "properties": {
            "actions": {
              "type": "object",
              "properties": {
                "reference": { "type": "string" },
                "graph": { "type": "string" },
                "terms": { "type": "string" },
                "specification": { "type": "string" },
                "ontology": { "type": "string" },
                "shapes": { "type": "string" },
                "shex": { "type": "string" }
              },
              "additionalProperties": false
            },
            "metadata": {
              "type": "object",
              "properties": {
                "canonicalUri": { "type": "string" },
                "version": { "type": "string" },
                "maintainer": { "type": "string" },
                "unspecified": { "type": "string" },
                "copyNamespace": { "type": "string" },
                "namespaceCopied": { "type": "string" },
                "namespaceCopyUnavailable": { "type": "string" }
              },
              "additionalProperties": false
            },
            "snapshot": {
              "type": "object",
              "properties": {
                "title": { "type": "string" },
                "body": { "type": "string" }
              },
              "additionalProperties": false
            },
            "overview": {
              "type": "object",
              "properties": {
                "title": { "type": "string" },
                "body": { "type": "string" }
              },
              "additionalProperties": false
            },
            "featuredTerms": {
              "type": "object",
              "properties": {
                "title": { "type": "string" },
                "body": { "type": "string" },
                "emptyBody": { "type": "string" }
              },
              "additionalProperties": false
            },
            "examples": {
              "type": "object",
              "properties": {
                "title": { "type": "string" },
                "body": { "type": "string" },
                "defaultDescription": { "type": "string" },
                "linkText": { "type": "string" }
              },
              "additionalProperties": false
            },
            "viewer": {
              "type": "object",
              "properties": {
                "title": { "type": "string" },
                "body": { "type": "string" },
                "viewFileText": { "type": "string" },
                "loadingText": { "type": "string" }
              },
              "additionalProperties": false
            },
            "artifacts": {
              "type": "object",
              "properties": {
                "ontologyLabel": { "type": "string" },
                "ontologyDescription": { "type": "string" },
                "shapesLabel": { "type": "string" },
                "shapesDescription": { "type": "string" },
                "shexLabel": { "type": "string" },
                "shexDescription": { "type": "string" },
                "specificationLabel": { "type": "string" },
                "specificationDescription": { "type": "string" },
                "additionalArtifactDescription": { "type": "string" }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "overviewCards": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["title", "body"],
            "properties": {
              "title": { "type": "string" },
              "body": { "type": "string" },
              "linkText": { "type": "string" },
              "linkHref": { "type": "string" }
            },
            "additionalProperties": false
          }
        },
        "customSections": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["title"],
            "properties": {
              "title": { "type": "string" },
              "body": { "type": "string" },
              "items": {
                "type": "array",
                "items": { "type": "string" }
              }
            },
            "additionalProperties": false
          }
        },
        "footer": {
          "type": "object",
          "properties": {
            "primary": { "type": "string" },
            "secondary": { "type": "string" }
          },
          "additionalProperties": false
        },
        "generator": {
          "type": "object",
          "properties": {
            "repositoryUrl": { "type": "string", "format": "uri" },
            "documentationUrl": { "type": "string", "format": "uri" }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "curation": {
      "type": "object",
      "properties": {
        "featuredTerms": {
          "type": "array",
          "items": { "type": "string" }
        },
        "autoFeaturedTerms": { "type": "boolean" },
        "featuredTermLimit": { "type": "integer", "minimum": 0 },
        "viewerTabs": {
          "type": "array",
          "items": { "type": "string" }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
