common.json 3.42 KB
Newer Older
canterafonsj's avatar
canterafonsj committed
{
canterafonsj's avatar
canterafonsj committed
  "title": "NGSI-LD Common Definitions",
  "description": "NGSI-LD Common",
  "definitions": {
    "Name": {
      "type": "string",
      "pattern": "^((\\d|[a-zA-Z]|_)+(:(\\d|[a-zA-Z]|_)+)?(#\\d+)?)$",
canterafonsj's avatar
canterafonsj committed
      "minLength": 1,
      "description": "NGSI-LD Name"
    },
    "PropertyNames": {
      "type": "string",
      "pattern": "^((\\d|[a-zA-Z]|_)+(:(\\d|[a-zA-Z]|_)+)?(#\\d+)?)$|^(@context)$"
    },
canterafonsj's avatar
canterafonsj committed
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "modifiedAt": {
      "type": "string",
      "format": "date-time"
    },
    "LdContext": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
      "oneOf": [
canterafonsj's avatar
canterafonsj committed
        {
          "type": "object"
        },
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "array",
          "minItems": 1,
          "items": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
            "oneOf": [
canterafonsj's avatar
canterafonsj committed
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "object"
              }
            ]
          }
        }
      ]
    },
    "Endpoint": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri"
        },
        "accept": {
          "type": "string",
          "enum": [
            "application/json",
            "application/ld+json"
          ]
        }
      }
    },
    "EntityInfo": {
      "type": "object",
      "properties": {
        "id": {
canterafonsj's avatar
canterafonsj committed
          "type": "string",
          "format": "uri"
        },
        "type": {
          "$ref": "#/definitions/Name"
        },
        "idPattern": {
          "type": "string",
          "format": "regex"
        }
      },
      "required": [
        "type"
      ]
    },
    "ProblemDetails": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "georel": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
      "oneOf": [
canterafonsj's avatar
canterafonsj committed
        {
          "type": "string",
          "enum": [
            "equals",
            "disjoint",
            "intersects",
            "within",
            "contains",
            "overlaps"
          ]
        },
        {
          "type": "string",
          "pattern": "^near;((maxDistance==\\d+)|(minDistance==\\d+))$"
        }
      ]
    },
    "coordinates": {
      "oneOf": [
        {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Geometry.json#/definitions/position"
canterafonsj's avatar
canterafonsj committed
        },
        {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Geometry.json#/definitions/positionArray"
canterafonsj's avatar
canterafonsj committed
        },
        {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Geometry.json#/definitions/lineString"
canterafonsj's avatar
canterafonsj committed
        },
        {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Geometry.json#/definitions/polygon"
canterafonsj's avatar
canterafonsj committed
        }
      ]
    },
    "geometry": {
      "type": "string",
canterafonsj's avatar
canterafonsj committed
      "enum": [
canterafonsj's avatar
canterafonsj committed
        "Point",
        "MultiPoint",
        "LineString",
        "MultiLineString",
        "Polygon",
        "MultiPolygon"
      ]
    },
canterafonsj's avatar
canterafonsj committed
    "timerel": {
      "type": "string",
canterafonsj's avatar
canterafonsj committed
      "enum": [
canterafonsj's avatar
canterafonsj committed
        "before",
        "after",
        "between"
      ]
    }
canterafonsj's avatar
canterafonsj committed
  }
Stefan Wiedemann's avatar
Stefan Wiedemann committed
}