{
    "title": "Schema for RESTful Open Annotation in JSON-LD",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "context": {
            "additionalProperties": true,
            "properties": {
                "@context": {
                    "description": "Used to define the short-hand names that are used throughout a JSON-LD document.",
                    "type": [
                        "object",
                        "string",
                        "array",
                        "null"
                    ]
                }
            }
        },
        "graph": {
            "additionalProperties": true,
            "properties": {
                "@graph": {
                    "description": "Used to express a graph.",
                    "type": [
                        "array",
                        "object"
                    ],
                    "additionalItems": {
                        "allOf": [
                            {
                                "$ref": "#/definitions/common"
                            },
                            {
                                "$ref": "#/definitions/oa"
                            }
                        ]
                    }
                }
            }
        },
        "oa": {
            "additionalProperties": false,
            "properties": {
                "body": {
                    "description": "the comment or other descriptive resource",
                    "type": "string",
                    "format": "uri"
                },
                "target": {
                    "description": "the body is somehow about",
                    "type": "string",
                    "format": "uri"
                },
                "annotatedBy": {
                    "description": "the agent creating the annotation",
                    "type": "string",
                    "format": "uri"
                },
                "serializedBy": {
                    "description": "the agent serialzing the annotation",
                    "type": "string",
                    "format": "uri"
                },
                "serializedAt": {
                    "description": "the time when the annotation is serialized",
                    "type": "string",
                    "format": "date-time"
                },
                "annotatedAt": {
                    "description": "the time when the annotation is created",
                    "type": "string",
                    "format": "date-time"
                }
            },
            "required": [
                "target"
            ]
        },
        "common": {
            "additionalProperties": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/common"
                    }
                ]
            },
            "properties": {
                "@id": {
                    "description": "Used to uniquely identify things that are being described in the document with IRIs or blank node identifiers.",
                    "type": "string",
                    "format": "uri"
                },
                "@value": {
                    "description": "Used to specify the data that is associated with a particular property in the graph.",
                    "type": [
                        "string",
                        "boolean",
                        "number",
                        "null"
                    ]
                },
                "@language": {
                    "description": "Used to specify the language for a particular string value or the default language of a JSON-LD document.",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "@type": {
                    "description": "Used to set the data type of a node or typed value.",
                    "type": [
                        "string",
                        "null"
                    ],
                    "enum": [
                        "@id"
                    ]
                },
                "@container": {
                    "description": "Used to set the default container type for a term.",
                    "type": [
                        "string",
                        "null"
                    ],
                    "enum": [
                        "@list",
                        "@index",
                        "@set"
                    ]
                },
                "@list": {
                    "description": "Used to express an ordered set of data."
                },
                "@set": {
                    "description": "Used to express an unordered set of data and to ensure that values are always represented as arrays."
                },
                "@reverse": {
                    "description": "Used to express reverse properties.",
                    "type": [
                        "string",
                        "object",
                        "null"
                    ],
                    "additionalProperties": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/common"
                            }
                        ]
                    }
                },
                "@base": {
                    "description": "Used to set the base IRI against which relative IRIs are resolved",
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "uri"
                },
                "@vocab": {
                    "description": "Used to expand properties and values in @type with a common prefix IRI",
                    "type": [
                        "string",
                        "null"
                    ],
                    "format": "uri"
                }
            }
        }
    },
    "anyOf": [
        {
            "$ref": "#/definitions/context"
        },
        {
            "$ref": "#/definitions/graph"
        },
        {
            "$ref": "#/definitions/common"
        }
    ],
    "type": [
        "object",
        "array"
    ],
    "additionalProperties": false
}