Specification

This section describes the MaRDI file format itself. It fixes terminology, explains the overall JSON object model, documents namespaces and versioned profiles, and collects type-level encoding notes linked to concrete examples in the rosetta stone.

Core Pages

Data Types

Basics

Containers

Rings

Linear Algebra

Groups

Lie Theory

Polyhedral Geometry

Schema Basis

The current schema basis used by this prototype is reproduced below from paper/data.json, which in turn reflects the JSON Schema discussion from the paper.

{
  "$id": "https://oscar-system.org/schemas/mrdi.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["_type"],
  "properties": {
    "_ns": {"type": "object"},
    "_type": {
      "oneOf": [
        {"type": "string"},
        {
          "type": "object",
          "properties": {"name": {"type": "string"}, "params": {"$ref": "#/$defs/data"}}
        }
      ]
    },
    "data": {"$ref": "#/$defs/data"},
    "_refs": {
      "type": "object",
      "patternProperties": {"^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$": {"$ref": "#"}}
    }
  },
  "$defs": {
    "data": {
      "oneOf": [
        {"type": "string"},
        {"type": "array", "items": {"$ref": "#/$defs/data"}},
        {
          "type": "object",
          "not": {"required": ["_ns"]},
          "patternProperties": {"^[a-zA-Z0-9_]*": {"$ref": "#/$defs/data"}}
        },
        {"$ref": "https://polymake.org/schemas/data.json"}
      ]
    }
  }
}