Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Un ejemplo de esquema de definición de una Entidad sería similar a este ejemplo:

Code Block
languagejsjson
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "SensorTemp",
    "type": "object",
    "required": [
        "SensorTemp"
    ],
    "properties": {
        "SensorTemp": {
            "type": "string",
            "$ref": "#/datos"
        }
    },
    "datos": {
        "description": "Properties for DataModel SensorTemp",
        "type": "object",
        "required": [
            "measure",
            "units",
            "timestamp",
            "geoposition"
        ],
        "properties": {
            "measure": {
                "type": "number"
            },
            "units": {
                "type": "string"
            },
            "timestamp": {
                "type": "string",
                "format": "date-time"
            },
            "geoposition": {
                "type": "object",
                "required": [
                    "coordinates",
                    "type"
                ],
                "properties": {
                    "coordinates": {
                        "type": "array",
                        "items": [
                            {
                                "type": "number",
                                "maximum": 180,
                                "minimum": -180
                            },
                            {
                                "type": "number",
                                "maximum": 90,
                                "minimum": -90
                            }
                        ],
                        "minItems": 2,
                        "maxItems": 2
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "Point"
                        ]
                    }
                },
                "additionalProperties": false
            }
        }
    },
    "description": "Temperature ontology",
    "additionalProperties": true
}

...

Para el ejemplo anterior, una instancia válida de Entidad sería:

Code Block
languagejsjson
{"SensorTemp":{ "measure":28.6,"units":"C","timestamp":"2014-01-30T17:14:00Z","geoposition":{"coordinates":[4 ,28.6],"type":"Point"}}}

...