Guide for Extensions

1 Getting aligned with FIESTA-IoT’s semantic data models

1.5 Implementation of Testbed to FIESTA-IoT annotators

After having defined all the mappings between your platform’s assets (both in terms of resource descriptions and observations), including the possible modifications that may be brought about on the ontology, it is time to talk about the implementation of the annotator between your datasets and those of FIESTA-IoT.

For that, you can choose among a number of different RDF serialization formats, as the ones listed below (annotated according to the “Content-type” field of the HTTP header):

  • application/ld+json
  • application/n-quads
  • application/n-triples
  • application/n3
  • application/rdf+json
  • application/rdf+thrift
  • application/rdf+xml
  • application/trig
  • application/trix
  • application/trix+xml
  • application/turtle
  • application/x-trig
  • application/x-turtle
  • null/rdf
  • text/csv
  • text/n-quads
  • text/n3
  • text/nquads
  • text/plain
  • text/rdf+n3
  • text/trig
  • text/turtle

In order to show you a pragmatic example of how to annotate a resource or an observation, in the following notes we have included an illustrative example of one of the SmartSantander’s resources, using json-ld as the serialization format. Besides, you can dynamically query another content type by means of the IoT-Registry API (FIESTA-IoT Consortium, 2016).

In case you want to check whether your annotations are compliant with our ontology, you can use the FIESTA-IoT Ontology Validator (for resource or observation) to receive a real-time validation report. Moreover, in case your annotated document does not 100% match the correct format, this report not only return the binary correct/error output, but also a detailed explanation of the actual source(s) of the error(s).

 

Notes:

Resource description:

{

  "@context": {

    "owl": "http://www.w3.org/2002/07/owl#",

    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",

    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",

    "rdfa": "http://www.w3.org/ns/rdfa#",

    "xhv": "http://www.w3.org/1999/xhtml/vocab#",

    "xml": "http://www.w3.org/XML/1998/namespace",

    "xsd": "http://www.w3.org/2001/XMLSchema#",

    "dul": "http://www.loa.istc.cnr.it/ontologies/DUL.owl#",

    "ssn": "http://purl.oclc.org/NET/ssnx/ssn#",

    "iot-lite": "http://purl.oclc.org/NET/UNIS/fiware/iot-lite#",

    "geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",

    "time": "http://www.w3.org/2006/time#",

    "qu-unit": "http://purl.oclc.org/NET/ssnx/qu/unit#",

    "qu-quantity": "http://purl.oclc.org/NET/ssnx/qu/quantity#",

    "m3-lite": "http://purl.org/iot/vocab/m3-lite#",

    "sms-srd": "http://api.smartsantander.eu#",

    "sms-srd-href": "http://api.smartsantander.eu/v2/resources/"

  },

  "@graph": [

    {

      "@id": "sms-srd:SmartSantanderTestbed",

      "@type": "ssn:Deployment"

    },

    {

      "@id": "sms-srd:platform.urn:x-iot:smartsantander:u7jcfa:t3230",

      "@type": "ssn:Platform",

      "geo:location": {

        "@id": "sms-srd:location.urn:x-iot:smartsantander:u7jcfa:t3230"

      }

    },

    {

      "@id": "sms-srd:location.urn:x-iot:smartsantander:u7jcfa:t3230",

      "@type": "geo:Point",

      "geo:lat": {

        "@type": "xsd:float",

        "@value": "43.46769"

      },

      "geo:long": {

        "@type": "xsd:float",

        "@value": "-3.81217"

      }

    },

    {

      "@id": "sms-srd-href:urn:x-iot:smartsantander:u7jcfa:t3230",

      "@type": "ssn:Device",

      "ssn:hasDeployment": {

        "@id": "sms-srd:SmartSantanderTestbed"

      },

      "ssn:hasSubSystem": [

        {

          "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor"

        },

        {

          "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

        },

        {

          "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor"

        }

      ],

      "ssn:onPlatform": {

        "@id": "sms-srd:platform.urn:x-iot:smartsantander:u7jcfa:t3230"

      }

    },

    {

      "@id": "sms-srd:service.urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor",

      "@type": "iot-lite:Service",

      "iot-lite:endpoint": {

        "@type": "xsd:anyURI",

        "@value": "https://api-dev.smartsantander.eu:10443/v2/measurements/batteryLevel/urn/urn:x-iot:smartsantander:u7jcfa:t3230/last?format=jsonld"

      },

      "iot-lite:interfaceType": "REST"

    },

    {

      "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor",

      "@type": "m3-lite:ElectricalSensor",

      "iot-lite:exposedBy": {

        "@id": "sms-srd:service.urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor"

      },

      "iot-lite:hasQuantityKind": {

        "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor"

      },

      "iot-lite:hasUnit": {

        "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor"

      }

    },

    {

      "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor",

      "@type": "m3-lite:BatteryLevel"

    },

    {

      "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.batteryLevel.sensor",

      "@type": "m3-lite:Percent"

    },

    {

      "@id": "sms-srd:service.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor",

      "@type": "iot-lite:Service",

      "iot-lite:endpoint": {

        "@type": "xsd:anyURI",

        "@value": "https://api-dev.smartsantander.eu:10443/v2/measurements/temperature:ambient/urn/urn:x-iot:smartsantander:u7jcfa:t3230/last?format=jsonld"

      },

      "iot-lite:interfaceType": "REST"

    },

    {

      "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor",

      "@type": "m3-lite:AirThermometer",

      "iot-lite:exposedBy": {

        "@id": "sms-srd:service.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

      },

      "iot-lite:hasQuantityKind": {

        "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

      },

      "iot-lite:hasUnit": {

        "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

      }

    },

    {

      "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor",

      "@type": "m3-lite:TemperatureAmbient"

    },

    {

      "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor",

      "@type": "m3-lite:DegreeCelsius"

    },

    {

      "@id": "sms-srd:service.urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor",

      "@type": "iot-lite:Service",

      "iot-lite:endpoint": {

        "@type": "xsd:anyURI",

        "@value": "https://api-dev.smartsantander.eu:10443/v2/measurements/relativeHumidity/urn/urn:x-iot:smartsantander:u7jcfa:t3230/last?format=jsonld"

      },

      "iot-lite:interfaceType": "REST"

    },

    {

      "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor",

      "@type": "m3-lite:HumiditySensor",

      "iot-lite:exposedBy": {

        "@id": "sms-srd:service.urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor"

      },

      "iot-lite:hasQuantityKind": {

        "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor"

      },

      "iot-lite:hasUnit": {

        "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor"

      }

    },

    {

      "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor",

      "@type": "m3-lite:RelativeHumidity"

    },

    {

      "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.relativeHumidity.sensor",

      "@type": "m3-lite:Percent"

    }

  ]

}

Observation description:

{

  "@context": {

    "owl": "http://www.w3.org/2002/07/owl#",

    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",

    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",

    "rdfa": "http://www.w3.org/ns/rdfa#",

    "xhv": "http://www.w3.org/1999/xhtml/vocab#",

    "xml": "http://www.w3.org/XML/1998/namespace",

    "xsd": "http://www.w3.org/2001/XMLSchema#",

    "dul": "http://www.loa.istc.cnr.it/ontologies/DUL.owl#",

    "ssn": "http://purl.oclc.org/NET/ssnx/ssn#",

    "iot-lite": "http://purl.oclc.org/NET/UNIS/fiware/iot-lite#",

    "geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",

    "time": "http://www.w3.org/2006/time#",

    "qu-unit": "http://purl.oclc.org/NET/ssnx/qu/unit#",

    "qu-quantity": "http://purl.oclc.org/NET/ssnx/qu/quantity#",

    "m3-lite": "http://purl.org/iot/vocab/m3-lite#",

    "sms-srd": "http://api.smartsantander.eu#",

    "sms-srd-href": "http://api.smartsantander.eu/v2/resources/"

  },

  "@graph": [

    {

      "@id": "_:b66",

      "@type": "ssn:Observation",

      "ssn:observationResult": {

        "@id": "_:b69"

      },

      "ssn:observationSamplingTime": {

        "@id": "_:b67"

      },

      "ssn:observedBy": {

        "@id": "sms-srd:urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

      },

      "ssn:observedProperty": {

        "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

      },

      "geo:location": {

        "@id": "_:b68"

      }

    },

    {

      "@id": "sms-srd:quantity.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor",

      "@type": "m3-lite:TemperatureAmbient"

    },

    {

      "@id": "_:b67",

      "@type": "time:Instant",

      "time:inXSDDateTime": {

        "@type": "xsd:dateTime",

        "@value": "2016-03-08T17:41:40.853Z"

      }

    },

    {

      "@id": "_:b68",

      "@type": "geo:Point",

      "geo:lat": {

        "@type": "xsd:float",

        "@value": 43.46769

      },

      "geo:long": {

        "@type": "xsd:float",

        "@value": -3.81217

      }

    },

    {

      "@id": "_:b69",

      "@type": "ssn:SensorOutput",

      "ssn:hasValue": {

        "@id": "_:b70"

      }

    },

    {

      "@id": "_:b70",

      "@type": "ssn:ObservationValue",

      "iot-lite:hasUnit": {

        "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor"

      },

      "dul:hasDataValue": {

        "@type": "xsd:float",

        "@value": 9.95

      }

    },

    {

      "@id": "sms-srd:unit.urn:x-iot:smartsantander:u7jcfa:t3230.temperature-ambient.sensor",

      "@type": "m3-lite:DegreeCelsius"

    }

  ]

}