{
  "$id": "https://opencourse.space/data/schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "audience": {
      "enum": [
        "general",
        "undergraduate",
        "graduate",
        "professional"
      ],
      "type": "string"
    },
    "courseCode": {
      "type": "string"
    },
    "firstSeen": {
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "type": "string"
    },
    "id": {
      "pattern": "^[a-z0-9][a-z0-9-]*$",
      "type": "string"
    },
    "institutions": {
      "items": {
        "pattern": "^[a-z0-9][a-z0-9-]*$",
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    },
    "instructors": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "keywords": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "languages": {
      "items": {
        "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    },
    "lastChanged": {
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "type": "string"
    },
    "level": {
      "enum": [
        "introductory",
        "intermediate",
        "advanced"
      ],
      "type": "string"
    },
    "offerings": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "access": {
            "additionalProperties": false,
            "properties": {
              "certificate": {
                "enum": [
                  "none",
                  "free",
                  "paid"
                ],
                "type": "string"
              },
              "cost": {
                "enum": [
                  "free",
                  "free-account",
                  "free-paid-extras"
                ],
                "type": "string"
              }
            },
            "required": [
              "cost"
            ],
            "type": "object"
          },
          "captions": {
            "items": {
              "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
              "type": "string"
            },
            "type": "array"
          },
          "contentLicense": {
            "type": "string"
          },
          "effort": {
            "additionalProperties": false,
            "properties": {
              "hours": {
                "exclusiveMinimum": 0,
                "type": "number"
              },
              "hoursPerWeek": {
                "exclusiveMinimum": 0,
                "type": "number"
              },
              "lectures": {
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991,
                "type": "integer"
              },
              "weeks": {
                "exclusiveMinimum": 0,
                "type": "number"
              }
            },
            "type": "object"
          },
          "formats": {
            "items": {
              "enum": [
                "video",
                "audio",
                "lecture-notes",
                "slides",
                "assignments",
                "exams",
                "readings",
                "interactive",
                "forum"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "minLength": 3,
            "type": "string"
          },
          "kind": {
            "enum": [
              "ocw-archive",
              "video-lectures",
              "mooc-self-paced",
              "mooc-scheduled",
              "podcast",
              "interactive",
              "live-online"
            ],
            "type": "string"
          },
          "provider": {
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "type": "string"
          },
          "schedule": {
            "additionalProperties": false,
            "properties": {
              "endDate": {
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                "type": "string"
              },
              "enrolBy": {
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                "type": "string"
              },
              "pacing": {
                "enum": [
                  "archived",
                  "self-paced",
                  "scheduled"
                ],
                "type": "string"
              },
              "startDate": {
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                "type": "string"
              },
              "term": {
                "type": "string"
              },
              "year": {
                "maximum": 2100,
                "minimum": 1950,
                "type": "integer"
              }
            },
            "required": [
              "pacing"
            ],
            "type": "object"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "url",
          "kind",
          "formats",
          "access",
          "schedule"
        ],
        "type": "object"
      },
      "minItems": 1,
      "type": "array"
    },
    "provenance": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "metadataLicense": {
            "type": "string"
          },
          "sourceId": {
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "sourceId",
          "url"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "quality": {
      "maximum": 1,
      "minimum": 0,
      "type": "number"
    },
    "status": {
      "enum": [
        "active",
        "archived",
        "unavailable"
      ],
      "type": "string"
    },
    "subjects": {
      "additionalProperties": false,
      "properties": {
        "isced": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "method": {
          "enum": [
            "source-mapping",
            "rules",
            "manual",
            "none"
          ],
          "type": "string"
        },
        "topics": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "isced",
        "topics",
        "method"
      ],
      "type": "object"
    },
    "summary": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "titleEn": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "title",
    "institutions",
    "languages",
    "subjects",
    "offerings",
    "status",
    "quality",
    "firstSeen",
    "lastChanged",
    "provenance"
  ],
  "title": "Open Course Space course record (one line of courses.ndjson)",
  "type": "object"
}
