{
  "id": "https://github.com/cristianvasquez/H-Eye/crud-operations#",
  "$schema": "http://json-schema.org/draft-06/schema#",
  "description": "schema for a feature entry",
  "type": "object",
  "properties": {
    "Content-Type:": {
      "description": "Defaults: application/x-json+ld",
      "enum": [
        "text/turtle",
        "application/x-json+ld"
      ]
    }
  },
  "oneOf": [
    {
      "$ref": "#/definitions/redirect"
    },
    {
      "$ref": "#/definitions/query-feature"
    },
    {
      "$ref": "#/definitions/raw"
    },
    {
      "$ref": "#/definitions/inference"
    },
    {
      "$ref": "#/definitions/imports"
    }
  ],
  "definitions": {
    "resource": {
      "type": "string",
      "format": "uri-template"
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri-template"
      },
      "uniqueItems": true
    },
    "redirect": {
      "description": "The default operation",
      "type": "string",
      "format": "uri-template"
    },
    "query-feature": {
      "description": "A Sparql query",
      "type": "object",
      "properties": {
        "query": {
          "type": "object",
          "properties": {
            "endpoint": {
              "type": "string",
              "format": "uri-template"
            },
            "default-graph-uri": {
              "type": "string"
            },
            "sparql": {
              "$ref": "#/definitions/resource"
            },
            "Accept": {
              "type": "string"
            }
          },
          "required": [
            "endpoint",
            "query"
          ]
        }
      },
      "required": [
        "query"
      ]
    },
    "raw": {
      "description":"raw data",
      "type": "object",
      "properties": {
        "raw": {
          "type": "string"
        }
      },
      "required": [
        "raw"
      ]
    },
    "inference": {
      "description":"inference feature",
      "type": "object",
      "properties": {
        "inference": {
          "type": "object",
          "properties": {
            "data": {
              "oneOf": [
                {
                  "$ref": "#/definitions/resource"
                },
                {
                  "$ref": "#/definitions/resources"
                }
              ]
            },
            "query": {
              "$ref": "#/definitions/resource"
            }
          },
          "required": [
            "data",
            "query"
          ]
        }
      },
      "required": [
        "inference"
      ]
    },
    "imports": {
      "description":"imports another feature",
      "type": "object",
      "properties": {
        "imports": {
          "type": "string",
          "format": "uri-template"
        },
        "add": {
          "type": "object"
        },
        "replace": {
          "type": "object"
        },
        "remove": {
          "type": "object"
        }
      },
      "required": [
        "imports"
      ]
    }
  }
}
