{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "action": {
            "properties": {
                "interactions": {
                    "default": [],
                    "items": {
                        "$ref": "#/definitions/interaction"
                    },
                    "type": "array"
                },
                "publishedProperties": {
                    "default": [],
                    "items": {
                        "$ref": "#/definitions/property"
                    },
                    "type": "array"
                },
                "realizedFunctionalities": {
                    "default": [],
                    "items": {
                        "$ref": "#/definitions/functionality"
                    },
                    "type": "array"
                },
                "widget": {
                    "$ref": "#/definitions/widget"
                }
            },
            "required": [
                "widget"
            ],
            "type": "object"
        },
        "actionProvision": {
            "properties": {
                "precursorAction": {
                    "$ref": "#/definitions/action"
                },
                "propertyProvisions": {
                    "items": {
                        "$ref": "#/definitions/propertyProvision"
                    },
                    "minItems": 1,
                    "type": "array"
                },
                "requestedAction": {
                    "$ref": "#/definitions/action"
                }
            },
            "required": [
                "request"
            ],
            "type": "object"
        },
        "distance": {
            "default": 0,
            "description": "a value indicating the distance between two related concepts, the higher the value the more distant their relation is, value 0 means identical concepts",
            "min": 0,
            "type": "number"
        },
        "extensionLevel": {
            "properties": {
                "actionProvisions": {
                    "items": {
                        "$ref": "#/definitions/actionProvision"
                    },
                    "minItems": 1,
                    "type": "array"
                }
            },
            "required": [
                "actionProvisions"
            ],
            "type": "object"
        },
        "functionality": {
            "$ref": "#/definitions/identifiable"
        },
        "functionalityProvision": {
            "properties": {
                "distance": {
                    "$ref": "#/definitions/distance"
                },
                "offer": {
                    "$ref": "#/definitions/functionality"
                },
                "providingAction": {
                    "$ref": "#/definitions/action"
                },
                "request": {
                    "$ref": "#/definitions/functionality"
                }
            },
            "required": [
                "request",
                "offer",
                "providingAction"
            ],
            "type": "object"
        },
        "identifiable": {
            "description": "a uniquely identifiable entity",
            "oneOf": [
                {
                    "properties": {
                        "uri": {
                            "_format": "uri",
                            "description": "a URI identifying the entity",
                            "type": "string"
                        }
                    },
                    "required": [
                        "uri"
                    ]
                },
                {
                    "properties": {
                        "id": {
                            "description": "a value uniquely identifying the entity within a single plan, used when the entity cannot identified by a URI",
                            "type": "string"
                        }
                    },
                    "required": [
                        "id"
                    ]
                }
            ],
            "type": "object"
        },
        "initialLevel": {
            "properties": {
                "functionalityProvisions": {
                    "items": {
                        "$ref": "#/definitions/functionalityProvision"
                    },
                    "minItems": 1,
                    "type": "array"
                }
            },
            "required": [
                "functionalityProvisions"
            ],
            "type": "object"
        },
        "interaction": {
            "properties": {
                "instructionText": {
                    "type": "string"
                }
            },
            "required": [
                "instructionText"
            ],
            "type": "object"
        },
        "property": {
            "properties": {
                "name": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/type"
                }
            },
            "required": [
                "name",
                "type"
            ],
            "type": "object"
        },
        "propertyProvision": {
            "properties": {
                "distance": {
                    "$ref": "#/definitions/distance"
                },
                "offer": {
                    "$ref": "#/definitions/property"
                },
                "providingAction": {
                    "$ref": "#/definitions/action"
                },
                "request": {
                    "$ref": "#/definitions/property"
                }
            },
            "required": [
                "request",
                "offer",
                "providingAction"
            ],
            "type": "object"
        },
        "type": {
            "$ref": "#/definitions/identifiable"
        },
        "widget": {
            "$ref": "#/definitions/identifiable"
        }
    },
    "properties": {
        "extensionLevels": {
            "default": [],
            "items": {
                "$ref": "#/definitions/extensionLevel"
            },
            "type": "array"
        },
        "initialLevel": {
            "$ref": "#/definitions/initialLevel"
        }
    },
    "required": [
        "initialLevel"
    ],
    "type": "object"
}