1
Lecture 7: Semantic Technologies and
Interoperability
EEEM048/COM3023- Internet of Things
Prof. Payam Barnaghi
Centre for Vision, Speech and Signal Processing (CVSSP)
Electrical and Electronic Engineering Department
University of Surrey
Autumn 2018
Wireless Sensor (and Actuator)
Networks
Sink
node Gateway
Core network
e.g. InternetGateway
End-user
Computer services
- The networks typically run Low Power Devices
- Consist of one or more sensors, could be different type of sensors (or actuators)
Operating
Systems?
Services?
Protocols?
Protocols?
In-network
Data
Processing
Data
Aggregation/
Fusion
Processing of
IoT data
Interoperable/
Machine-
interpretable
representations
Interoperable/
Machine-
interpretable
representations
“Web of Things”
Interoperable/
Machine-
interpretable
representations
3
What we are going to study
− The sensors (and in general “Things”) are increasingly being connected to
the Web.
− This can be supported by embedded devices that directly support IP and
web-based connection (e.g. 6LowPAN and CoAP) or devices that are
connected via gateway components.
− Broadening the IoT to the concept of “Web of Things”
− There are existing standards such as Sensor Web Enablement (SWE) set
developed by the Open Geospatial Consortium (OGC) that are being
adopted in industry and academia.
− While such frameworks provide some interoperability, semantic
technologies are increasingly seen as key enabler for machine to machine
data communication and integration of IoT data into the Web.
4
Observation and measurement data- annotation
Tags
Data formats
Location
Image source: Cosm.com
Observation and measurement data
15, C, 08:15, 51.243057, -0.589444
5
value
Unit of
measurement
Time
Longitude
Latitude
How to make the data representations more machine-readable
and machine-interpretable?
Observation and measurement data
15, C, 08:15, 51.243057, -0.589444
6
<value>
<unit>
<Time>
<Longitude>
<Latitude>
What about this?
<value>15</value>
<unit>C</unit>
<time>08:15</time>
<longitude>51.243057</longitude>
<latitude>-0.58944</latitude>
Extensible Markup Language (XML)
− XML is a simple, flexible text format that is used for data
representation and annotation.
− XML was originally designed for large-scale electronic
publishing.
− XML plays a key role in the exchange of a wide variety of data
on the Web and elsewhere.
− It is one of the most widely-used formats for sharing
structured information.
7
XML Document Example
<?xml version="1.0"?>
<measurement>
<value>15</value>
<unit>C</unit>
<time>08:15</time>
<longitude>51.243057</longitude>
<latitude>-0.58944</latitude>
</measurement>
8
XML Prologue- the XML declaration
XML elements
XML documents
MUST be “well
formed”
Root element
XML Document Example- with attributes
<?xml version="1.0“ encoding="ISO-8859-1"?>
<measurement>
<value type=“Decimal”>15</value>
<unit>C</unit>
<time>08:15</time>
<longitude>51.243057</longitude>
<latitude>-0.58944</latitude>
</measurement>
9
Well Formed XML Documents
− A "Well Formed" XML document has correct XML syntax;
− XML documents must have a root element;
− XML elements must have a closing tag;
− XML tags are case sensitive;
− XML elements must be properly nested;
− XML attribute values must be quoted.
− A "Valid" XML document is a "Well Formed" XML document,
which conforms to the structure of the document defined in
an XML Schema.
− XML Schema defines the structure and a list of defined
elements for an XML document.
10Source: W3C Schools, http://www.w3schools.com/
XML Schema- example
<xs:element name=“measurement">
<xs:complexType>
<xs:sequence>
<xs:element name=“value" type="xs:decimal"/>
<xs:element name=“unit" type="xs:string"/>
<xs:element name=“time" type="xs:time"/>
<xs:element name=“longitude" type="xs:double"/>
<xs:element name=“latitude" type="xs:double"/>
</xs:sequence>
</xs:complexType>
</xs:element>
11
- XML Schema defines the structure and elements
- An XML document then becomes an instantiation of the document defined by
the schema;
XML Documents– revisiting the example
<?xml version="1.0"?>
<measurement>
<value>15</value>
<unit>C</unit>
<time>08:15</time>
<longitude>51.243057</longitude>
<latitude>-0.58944</latitude>
</measurement>
12
<?xml version="1.0"?> “But what about this description?”
<sensor_data>
<reading>15</reading>
<u>C</u>
<timestamp>08:15</timestamp>
<long>51.243057</long>
<lat>-0.58944</lat>
</sensor_data>
13
XML
− Meaning of XML-Documents is intuitively clear
− due to "semantic" Mark-Up
− tags are domain-terms
− However, tag-names do not provide semantics for machines.
− DTDs or XML Schema specify the structure of documents, not
the meaning of the document contents.
− XML lacks a semantic model
− has only a "surface model”, i.e. provide a hierarchical structure (or a
tree model).
Adapted from: Semantic Web, John Davies, BT, 2003.
XML: limitations for semantic markup
− XML representation makes no commitment on:
− Domain specific ontological vocabulary
− Which words shall we use to describe a given set of concepts?
− Ontological modelling primitives
− How can we combine these concepts, e.g. “ambient_temperature is a-kind-of
(subclass-of) environmental_data”
 requires pre-arranged agreement on vocabulary and
primitives
 Only feasible for closed collaboration
 agents in a small & stable community
 pages on a small & stable intranet
.. not for sharable Web-resources
Source: Semantic Web, John Davies, BT, 2003.
14
Sematic Web technologies
−XML provides a basic metadata framework.
−It defines the elements but does not provide any
modelling primitive nor describes the meaningful
relations between different elements.
−Using semantic technologies can help to solve
some of these issues.
15
The Semantic Web
− “The Semantic Web is an extension of the current web in
which information is given well-defined meaning, better
enabling computers and people to work in co-operation.“
(Tim Berners-Lee et al, 2001)
16
Image source: Miller 2004
Resource Description Framework (RDF)
− A world Wide Web Consortium (W3C) recommendation
− Relationships between documents
− Consisting of triples or sentences:
− <subject, property, object>
− <“Sensor”, hasType, “Temperature”>
− <“Node01”, hasLocation, “Room_BA_01” >
− RDFS extends RDF with standard “ontology vocabulary”:
− Class, Property
− Type, subClassOf
− domain, range
17
RDF for semantic annotation
− RDF provides metadata about resources
− Object -> Attribute-> Value triples or
− Object -> Property-> Subject
− It can be represented in XML
− The RDF triples form a graph
18
RDF Graph
19
xsd:decimal
Measurement
hasValue
hasTime
xsd:double
xsd:time
xsd:double
xsd:string
hasLongitude hasLatitude
hasUnit
RDF Graph- an instance
20
15
Measurement#0
001
hasValue
hasTime
-0.589444
08:15
51.243057
C
hasLongitude hasLatitude
hasUnit
RDF/XML (shown in a simplified form)
<rdf:RDF>
<rdf:Description
rdf:about=“Measurment#0001">
<hasValue>15</hasValue>
<hasUnit>C</hasUnit>
<hasTime>08:15</hasTime>
<hasLongitude>51.243057</hasLongitude>
<hasLatitude>-0.589444</hasLatitude>
</rdf:Description>
</rdf:RDF>
21
Let’s add a bit more structure (modularity)
22
xsd:decimal
Location
hasValue
hasTime
xsd:double
xsd:time
xsd:double
xsd:string
hasLongitude
hasLatitude
hasUnit
Measurement
hasLocation
An instance of our model
23
15
Location
#0126
hasValue
hasTime
51.243057
08:15
-0.589444
C
hasLongitude
hasLatitude
hasUnit
Measurement#0
001
hasLocation
RDF: Basic Ideas
−Resources
−Every resource has a URI (Universal Resource Identifier)
−A URI can be a URL (a web address) or a some other kind
of identifier;
−An identifier does not necessarily enable access to a
resources
−We can think of a resources as an object that we want to
describe it.
−Sensor, Actuator
−Road, Home
−Places, etc.
24
RDF: Basic Ideas
− Properties
− Properties are special kind of resources;
− Properties describe relations between resources.
− For example: “hasLocation”, “hasType”, “hasID”, “sratTime”,
“deviceID”,.
− Properties in RDF are also identified by URIs.
− This provides a global, unique naming scheme.
− For example:
− “hasLocation” can be defined as:
− URI: http://www.loanr.it/ontologies/DUL.owl#hasLocation
− SPARQL is a query language for the RDF data.
− SPARQL provide capabilities to query RDF graph patterns along with
their conjunctions and disjunctions.
− We are not going to discuss SPARQL in this module.
25
Ontologies
− The term ontology is originated from philosophy. In that
context it is used as the name of a subfield of philosophy,
namely, the study of the nature of existence.
− In the Semantic technolgies:
−An ontology is a formal specification of a domain; concepts
in a domain and relationships between the concepts (and
some logical restrictions).
26
Ontologies and Semantic Web
− In general, an ontology formally describes the (important)
concepts and their relations in a domain.
− An ontology consists of a finite list of terms and the
relationships between the terms.
− The terms denote important concepts (classes of objects) of
the domain.
− For example, in a university setting, students, staff members,
modules, lecture theatres, and departments are some of the
important concepts.
27
Example: A Simple Sensor Ontology
28
Web Ontology Language (OWL)
− RDF(S) is useful to describe the concepts and their
relationships, but does not solve all possible requirements
− Complex applications may want more possibilities:
− similarity and/or differences of terms (properties or classes)
− construct classes, not just name them
− can a program reason about some terms? e.g.:
− each «Sensor» resource «A» has at least one «hasLocation»
− each «Sensor» resource «A» has maximum one ID
− This has led to the development of Web Ontology Language
or OWL.
29
OWL
−OWL provide more concepts to express meaning
and semantics than XML and RDF(S)
−OWL provides more constructs for stating logical
expressions such as: Equality, Property
Characteristics, Property Restrictions, Restricted
Cardinality, Class Intersection, Annotation
Properties, Versioning, etc.
Source: http://www.w3.org/TR/owl-features/ 30
Ontology engineering
− An ontology includes: classes and properties (also referred to
as schema ontology)
− Knowledge base: a set of individual instances of classes and
their relationships
− Steps for developing an ontology:
− defining classes in the ontology and arranging the classes in a
taxonomic (subclass–superclass) hierarchy
− defining properties and describing allowed values and restriction for
these properties
− Adding instances and individuals
Basic rules for designing ontologies
− There is no one correct way to model a domain; there are
always possible alternatives and there are also best practices.
− The best solution almost always depends on the application that you
have in mind and the required scope and details.
− Ontology development is often an iterative process.
− The ontologies provide a sharable and extensible form to represent a
domain model.
− Concepts that you choose in an ontology should be close to
physical or logical objects and relationships in your domain of
interest (using meaningful nouns and verbs).
A simple methodology - I
1) Determine the domain and scope of the model that you
want to design your ontology.
2) Consider reusing existing concepts/ontologies; this will help
to increase the interoperability of your ontology.
3) Enumerate important terms in the ontology; this will
determine what are the key concepts that need to be
defined in an ontology.
4) Define the classes and the class hierarchy; decide on the
classes and the parent/child relationships.
33
A simple methodology - II
5) Define the properties of classes; define the properties that
relate the classes.
6) Define features of the properties; decide if you are going to
add restrictions/logical expressions.
7) Define/add the instances.
34
Other representation forms- JSON
− JSON (JavaScript Object Notation) is a lightweight data-
interchange/representation format.
− JSON is easy to read and publish for human users.
− It is also easy for machines to parse and generate.
− JSON is based on the JavaScript Programming Language.
− JSON is built on two structures:
− A collection of name/value pairs. In various languages, this is realised
as an object, record, struct, dictionary, hash table, keyed list, or
associative array.
− An ordered list of values. In most languages, this is realised as an array,
vector, list, or sequence.
35Source: http://www.json.org
Example
36
JSON
XML
JSON-LD
− JSON-LD is a lightweight syntax to serialise Linked Data (e.g.
RDF data connected to other resources) in JSON.
− JSON-LD allows existing JSON to be interpreted as Linked
Data with minimal changes.
− It is primarily intended to be a way to use Linked Data in
Web-based programming environments, to build
interoperable Web services, and to store Linked Data in
JSON-based storage engines.
− JSON-LD is 100% compatible with JSON and the large
number of JSON parsers and libraries available today can be
reused.
37
Source: https://www.w3.org/TR/json-ld/
JSON-LD Example
38
A context is used to map terms to IRIs (Internationalized Resource
Identifiers). Terms are case sensitive and any valid string that is not a
reserved JSON-LD keyword can be used as a term.
JSON-LD Context: https://www.w3.org/TR/json-ld/#the-context
The Context in JSON-LD
− When two people communicate with one another, the
conversation takes place in a shared environment, typically
called "the context of the conversation".
− This shared context allows people to use shortcut terms, like
the first name of a mutual friend, to communicate more
quickly but without losing accuracy.
− A context in JSON-LD works in the same way. It allows two
applications to use shortcut terms to communicate with one
another more efficiently, but without losing accuracy.
39
Source: https://www.w3.org/TR/json-ld/#the-context
The Context in JSON LD - Example
40
Source: https://www.w3.org/TR/json-ld/#the-context
Semantic Technologies in IoT
−Applying semantic technologies to IoT can support:
−interoperability
−effective data access and integration
−resource discovery
−processing of IoT data
−information extraction (for automated decision making
and management)
41
Semantic modelling
− Lightweight: experiences show that a lightweight ontology
model that well balances expressiveness and inference
complexity is more likely to be widely adopted and reused;
also large number of IoT resources and huge amount of data
need efficient processing
− Compatibility: an ontology needs to be consistent with those
well designed, existing ontologies to ensure compatibility
wherever possible.
− Modularity: modular approach to facilitate ontology evolution,
extension and integration with external ontologies.
42
43
Example: Semantic Sensor Networks (SSN )Ontology
Ontology Link: http://www.w3.org/2005/Incubator/ssn/ssnx/ssn
M. Compton et al, "The SSN Ontology of the W3C Semantic Sensor Network Incubator Group", Journal of Web Semantics, 2012.
New version of SSN: https://www.w3.org/TR/vocab-ssn/
Web of Things
− Integrating the real world data into the
Web and providing Web-based
interactions with the IoT resources is
also often discussed under umbrella
term of “Web of Things” (WoT).
− WoT data is not only large in scale
and volume, but also continuous, with
spatiotemporal dependency.
44
Web of Things
WSN
WSN
WSN
WSN
WSN
Network-enabled
Devices
Semantically
annotate data
45
Gateway
CoAP
HTTP
CoAP
CoAP
HTTP
6LowPAN
Semantically
annotate data
http://mynet1/snodeA23/readTemp?
WSN
MQTT
MQTT
Gateway
IoT data: semantic related issues
− The current IoT data communications often rely on binary or
syntactic data models which lack of providing machine
interpretable meanings to the data.
−Syntactic representation or in some cases XML-based data
−Often no general agreement on annotating the data;
−requires a pre-agreement between different parties to
be able to process and interpret the data;
−Limited interpretation based on the content and context
data;
−Limited interoperability in data and resource/device
description level;
−Data integration and fusion issues.
Requirements
−Structured representation of concepts
− Machine-interpretable descriptions
− Processing and interpretation mechanisms
−Access mechanism to heterogeneous resource
descriptions with diverse capabilities.
−Automated interactions and integration with existing
applications.
What are the challenges?
− The models provide the basic description frameworks, but
alignment between different models and frameworks are
required.
− Semantics are the starting point, analysis and interpretation of
data is required for automated processes.
− Real interoperability happens when data/services from
different frameworks and various providers can be
interchanged and used with minimised manual intervention.
Possible solutions
− Using machine-readable and machine-interpretable meta-data
− Important not: all machine-readable are machine-interpretable.
− Well-defined standards and description frameworks: RDF, OWL, SPARQL.
− Variety of open-source, commercial tools for creating/managing/querying and
accessing semantic data.
− Some of the tools/libraries include: Jena Libraries, Protégé Ontology Tool, …
− An Ontology defines conceptualisation of a domain.
− Terms and concepts
− A common vocabulary
− Relationships between the concepts
− There are several existing and emerging ontologies in the IoT domain.
− Complimentary tools and steps such as automated annotation methods…;
How to adapt the solutions
− Creating ontologies and defining data models are not enough
− tools to create and annotate data
− data handling components
− Complex models and ontologies may look good, but
− design lightweight versions for constrained environments
− think of practical issues
− make the semantic/ontology models as much as possible compatible and/or
linked to the other existing concepts/model.
− Domain knowledge and instances
− Common terms and vocabularies
− Location, unit of measurement, type, theme, …
− Link it to other resources
− In many cases, semantic annotations and semantic processing should be
intermediary not the end product.
Practice Question
− Let’s assume an IoT framework with two different types of
data:
− Ambient temperature
− Body temperature
− Body temperature is a type of physiological observation and
monitoring (O&M) data;
− Ambient temperature is a type of environmental O&M data;
− Device A with manufacturer ID=000AB23 measures the body
temperature
− Device B with manufacturer ID=123AB23 measures the ambient
temperature.
− Using a graph model, design a simple ontology for these concepts;
Ontology model
52
Practice Question
− Show this body temperature data in JSON and XML formats.
37, C, 08:36, Device_A, John Smith
53
JSON/XML
54
55
Questions?

Lecture 7: Semantic Technologies and Interoperability

  • 1.
    1 Lecture 7: SemanticTechnologies and Interoperability EEEM048/COM3023- Internet of Things Prof. Payam Barnaghi Centre for Vision, Speech and Signal Processing (CVSSP) Electrical and Electronic Engineering Department University of Surrey Autumn 2018
  • 2.
    Wireless Sensor (andActuator) Networks Sink node Gateway Core network e.g. InternetGateway End-user Computer services - The networks typically run Low Power Devices - Consist of one or more sensors, could be different type of sensors (or actuators) Operating Systems? Services? Protocols? Protocols? In-network Data Processing Data Aggregation/ Fusion Processing of IoT data Interoperable/ Machine- interpretable representations Interoperable/ Machine- interpretable representations “Web of Things” Interoperable/ Machine- interpretable representations
  • 3.
    3 What we aregoing to study − The sensors (and in general “Things”) are increasingly being connected to the Web. − This can be supported by embedded devices that directly support IP and web-based connection (e.g. 6LowPAN and CoAP) or devices that are connected via gateway components. − Broadening the IoT to the concept of “Web of Things” − There are existing standards such as Sensor Web Enablement (SWE) set developed by the Open Geospatial Consortium (OGC) that are being adopted in industry and academia. − While such frameworks provide some interoperability, semantic technologies are increasingly seen as key enabler for machine to machine data communication and integration of IoT data into the Web.
  • 4.
    4 Observation and measurementdata- annotation Tags Data formats Location Image source: Cosm.com
  • 5.
    Observation and measurementdata 15, C, 08:15, 51.243057, -0.589444 5 value Unit of measurement Time Longitude Latitude How to make the data representations more machine-readable and machine-interpretable?
  • 6.
    Observation and measurementdata 15, C, 08:15, 51.243057, -0.589444 6 <value> <unit> <Time> <Longitude> <Latitude> What about this? <value>15</value> <unit>C</unit> <time>08:15</time> <longitude>51.243057</longitude> <latitude>-0.58944</latitude>
  • 7.
    Extensible Markup Language(XML) − XML is a simple, flexible text format that is used for data representation and annotation. − XML was originally designed for large-scale electronic publishing. − XML plays a key role in the exchange of a wide variety of data on the Web and elsewhere. − It is one of the most widely-used formats for sharing structured information. 7
  • 8.
    XML Document Example <?xmlversion="1.0"?> <measurement> <value>15</value> <unit>C</unit> <time>08:15</time> <longitude>51.243057</longitude> <latitude>-0.58944</latitude> </measurement> 8 XML Prologue- the XML declaration XML elements XML documents MUST be “well formed” Root element
  • 9.
    XML Document Example-with attributes <?xml version="1.0“ encoding="ISO-8859-1"?> <measurement> <value type=“Decimal”>15</value> <unit>C</unit> <time>08:15</time> <longitude>51.243057</longitude> <latitude>-0.58944</latitude> </measurement> 9
  • 10.
    Well Formed XMLDocuments − A "Well Formed" XML document has correct XML syntax; − XML documents must have a root element; − XML elements must have a closing tag; − XML tags are case sensitive; − XML elements must be properly nested; − XML attribute values must be quoted. − A "Valid" XML document is a "Well Formed" XML document, which conforms to the structure of the document defined in an XML Schema. − XML Schema defines the structure and a list of defined elements for an XML document. 10Source: W3C Schools, http://www.w3schools.com/
  • 11.
    XML Schema- example <xs:elementname=“measurement"> <xs:complexType> <xs:sequence> <xs:element name=“value" type="xs:decimal"/> <xs:element name=“unit" type="xs:string"/> <xs:element name=“time" type="xs:time"/> <xs:element name=“longitude" type="xs:double"/> <xs:element name=“latitude" type="xs:double"/> </xs:sequence> </xs:complexType> </xs:element> 11 - XML Schema defines the structure and elements - An XML document then becomes an instantiation of the document defined by the schema;
  • 12.
    XML Documents– revisitingthe example <?xml version="1.0"?> <measurement> <value>15</value> <unit>C</unit> <time>08:15</time> <longitude>51.243057</longitude> <latitude>-0.58944</latitude> </measurement> 12 <?xml version="1.0"?> “But what about this description?” <sensor_data> <reading>15</reading> <u>C</u> <timestamp>08:15</timestamp> <long>51.243057</long> <lat>-0.58944</lat> </sensor_data>
  • 13.
    13 XML − Meaning ofXML-Documents is intuitively clear − due to "semantic" Mark-Up − tags are domain-terms − However, tag-names do not provide semantics for machines. − DTDs or XML Schema specify the structure of documents, not the meaning of the document contents. − XML lacks a semantic model − has only a "surface model”, i.e. provide a hierarchical structure (or a tree model). Adapted from: Semantic Web, John Davies, BT, 2003.
  • 14.
    XML: limitations forsemantic markup − XML representation makes no commitment on: − Domain specific ontological vocabulary − Which words shall we use to describe a given set of concepts? − Ontological modelling primitives − How can we combine these concepts, e.g. “ambient_temperature is a-kind-of (subclass-of) environmental_data”  requires pre-arranged agreement on vocabulary and primitives  Only feasible for closed collaboration  agents in a small & stable community  pages on a small & stable intranet .. not for sharable Web-resources Source: Semantic Web, John Davies, BT, 2003. 14
  • 15.
    Sematic Web technologies −XMLprovides a basic metadata framework. −It defines the elements but does not provide any modelling primitive nor describes the meaningful relations between different elements. −Using semantic technologies can help to solve some of these issues. 15
  • 16.
    The Semantic Web −“The Semantic Web is an extension of the current web in which information is given well-defined meaning, better enabling computers and people to work in co-operation.“ (Tim Berners-Lee et al, 2001) 16 Image source: Miller 2004
  • 17.
    Resource Description Framework(RDF) − A world Wide Web Consortium (W3C) recommendation − Relationships between documents − Consisting of triples or sentences: − <subject, property, object> − <“Sensor”, hasType, “Temperature”> − <“Node01”, hasLocation, “Room_BA_01” > − RDFS extends RDF with standard “ontology vocabulary”: − Class, Property − Type, subClassOf − domain, range 17
  • 18.
    RDF for semanticannotation − RDF provides metadata about resources − Object -> Attribute-> Value triples or − Object -> Property-> Subject − It can be represented in XML − The RDF triples form a graph 18
  • 19.
  • 20.
    RDF Graph- aninstance 20 15 Measurement#0 001 hasValue hasTime -0.589444 08:15 51.243057 C hasLongitude hasLatitude hasUnit
  • 21.
    RDF/XML (shown ina simplified form) <rdf:RDF> <rdf:Description rdf:about=“Measurment#0001"> <hasValue>15</hasValue> <hasUnit>C</hasUnit> <hasTime>08:15</hasTime> <hasLongitude>51.243057</hasLongitude> <hasLatitude>-0.589444</hasLatitude> </rdf:Description> </rdf:RDF> 21
  • 22.
    Let’s add abit more structure (modularity) 22 xsd:decimal Location hasValue hasTime xsd:double xsd:time xsd:double xsd:string hasLongitude hasLatitude hasUnit Measurement hasLocation
  • 23.
    An instance ofour model 23 15 Location #0126 hasValue hasTime 51.243057 08:15 -0.589444 C hasLongitude hasLatitude hasUnit Measurement#0 001 hasLocation
  • 24.
    RDF: Basic Ideas −Resources −Everyresource has a URI (Universal Resource Identifier) −A URI can be a URL (a web address) or a some other kind of identifier; −An identifier does not necessarily enable access to a resources −We can think of a resources as an object that we want to describe it. −Sensor, Actuator −Road, Home −Places, etc. 24
  • 25.
    RDF: Basic Ideas −Properties − Properties are special kind of resources; − Properties describe relations between resources. − For example: “hasLocation”, “hasType”, “hasID”, “sratTime”, “deviceID”,. − Properties in RDF are also identified by URIs. − This provides a global, unique naming scheme. − For example: − “hasLocation” can be defined as: − URI: http://www.loanr.it/ontologies/DUL.owl#hasLocation − SPARQL is a query language for the RDF data. − SPARQL provide capabilities to query RDF graph patterns along with their conjunctions and disjunctions. − We are not going to discuss SPARQL in this module. 25
  • 26.
    Ontologies − The termontology is originated from philosophy. In that context it is used as the name of a subfield of philosophy, namely, the study of the nature of existence. − In the Semantic technolgies: −An ontology is a formal specification of a domain; concepts in a domain and relationships between the concepts (and some logical restrictions). 26
  • 27.
    Ontologies and SemanticWeb − In general, an ontology formally describes the (important) concepts and their relations in a domain. − An ontology consists of a finite list of terms and the relationships between the terms. − The terms denote important concepts (classes of objects) of the domain. − For example, in a university setting, students, staff members, modules, lecture theatres, and departments are some of the important concepts. 27
  • 28.
    Example: A SimpleSensor Ontology 28
  • 29.
    Web Ontology Language(OWL) − RDF(S) is useful to describe the concepts and their relationships, but does not solve all possible requirements − Complex applications may want more possibilities: − similarity and/or differences of terms (properties or classes) − construct classes, not just name them − can a program reason about some terms? e.g.: − each «Sensor» resource «A» has at least one «hasLocation» − each «Sensor» resource «A» has maximum one ID − This has led to the development of Web Ontology Language or OWL. 29
  • 30.
    OWL −OWL provide moreconcepts to express meaning and semantics than XML and RDF(S) −OWL provides more constructs for stating logical expressions such as: Equality, Property Characteristics, Property Restrictions, Restricted Cardinality, Class Intersection, Annotation Properties, Versioning, etc. Source: http://www.w3.org/TR/owl-features/ 30
  • 31.
    Ontology engineering − Anontology includes: classes and properties (also referred to as schema ontology) − Knowledge base: a set of individual instances of classes and their relationships − Steps for developing an ontology: − defining classes in the ontology and arranging the classes in a taxonomic (subclass–superclass) hierarchy − defining properties and describing allowed values and restriction for these properties − Adding instances and individuals
  • 32.
    Basic rules fordesigning ontologies − There is no one correct way to model a domain; there are always possible alternatives and there are also best practices. − The best solution almost always depends on the application that you have in mind and the required scope and details. − Ontology development is often an iterative process. − The ontologies provide a sharable and extensible form to represent a domain model. − Concepts that you choose in an ontology should be close to physical or logical objects and relationships in your domain of interest (using meaningful nouns and verbs).
  • 33.
    A simple methodology- I 1) Determine the domain and scope of the model that you want to design your ontology. 2) Consider reusing existing concepts/ontologies; this will help to increase the interoperability of your ontology. 3) Enumerate important terms in the ontology; this will determine what are the key concepts that need to be defined in an ontology. 4) Define the classes and the class hierarchy; decide on the classes and the parent/child relationships. 33
  • 34.
    A simple methodology- II 5) Define the properties of classes; define the properties that relate the classes. 6) Define features of the properties; decide if you are going to add restrictions/logical expressions. 7) Define/add the instances. 34
  • 35.
    Other representation forms-JSON − JSON (JavaScript Object Notation) is a lightweight data- interchange/representation format. − JSON is easy to read and publish for human users. − It is also easy for machines to parse and generate. − JSON is based on the JavaScript Programming Language. − JSON is built on two structures: − A collection of name/value pairs. In various languages, this is realised as an object, record, struct, dictionary, hash table, keyed list, or associative array. − An ordered list of values. In most languages, this is realised as an array, vector, list, or sequence. 35Source: http://www.json.org
  • 36.
  • 37.
    JSON-LD − JSON-LD isa lightweight syntax to serialise Linked Data (e.g. RDF data connected to other resources) in JSON. − JSON-LD allows existing JSON to be interpreted as Linked Data with minimal changes. − It is primarily intended to be a way to use Linked Data in Web-based programming environments, to build interoperable Web services, and to store Linked Data in JSON-based storage engines. − JSON-LD is 100% compatible with JSON and the large number of JSON parsers and libraries available today can be reused. 37 Source: https://www.w3.org/TR/json-ld/
  • 38.
    JSON-LD Example 38 A contextis used to map terms to IRIs (Internationalized Resource Identifiers). Terms are case sensitive and any valid string that is not a reserved JSON-LD keyword can be used as a term. JSON-LD Context: https://www.w3.org/TR/json-ld/#the-context
  • 39.
    The Context inJSON-LD − When two people communicate with one another, the conversation takes place in a shared environment, typically called "the context of the conversation". − This shared context allows people to use shortcut terms, like the first name of a mutual friend, to communicate more quickly but without losing accuracy. − A context in JSON-LD works in the same way. It allows two applications to use shortcut terms to communicate with one another more efficiently, but without losing accuracy. 39 Source: https://www.w3.org/TR/json-ld/#the-context
  • 40.
    The Context inJSON LD - Example 40 Source: https://www.w3.org/TR/json-ld/#the-context
  • 41.
    Semantic Technologies inIoT −Applying semantic technologies to IoT can support: −interoperability −effective data access and integration −resource discovery −processing of IoT data −information extraction (for automated decision making and management) 41
  • 42.
    Semantic modelling − Lightweight:experiences show that a lightweight ontology model that well balances expressiveness and inference complexity is more likely to be widely adopted and reused; also large number of IoT resources and huge amount of data need efficient processing − Compatibility: an ontology needs to be consistent with those well designed, existing ontologies to ensure compatibility wherever possible. − Modularity: modular approach to facilitate ontology evolution, extension and integration with external ontologies. 42
  • 43.
    43 Example: Semantic SensorNetworks (SSN )Ontology Ontology Link: http://www.w3.org/2005/Incubator/ssn/ssnx/ssn M. Compton et al, "The SSN Ontology of the W3C Semantic Sensor Network Incubator Group", Journal of Web Semantics, 2012. New version of SSN: https://www.w3.org/TR/vocab-ssn/
  • 44.
    Web of Things −Integrating the real world data into the Web and providing Web-based interactions with the IoT resources is also often discussed under umbrella term of “Web of Things” (WoT). − WoT data is not only large in scale and volume, but also continuous, with spatiotemporal dependency. 44
  • 45.
    Web of Things WSN WSN WSN WSN WSN Network-enabled Devices Semantically annotatedata 45 Gateway CoAP HTTP CoAP CoAP HTTP 6LowPAN Semantically annotate data http://mynet1/snodeA23/readTemp? WSN MQTT MQTT Gateway
  • 46.
    IoT data: semanticrelated issues − The current IoT data communications often rely on binary or syntactic data models which lack of providing machine interpretable meanings to the data. −Syntactic representation or in some cases XML-based data −Often no general agreement on annotating the data; −requires a pre-agreement between different parties to be able to process and interpret the data; −Limited interpretation based on the content and context data; −Limited interoperability in data and resource/device description level; −Data integration and fusion issues.
  • 47.
    Requirements −Structured representation ofconcepts − Machine-interpretable descriptions − Processing and interpretation mechanisms −Access mechanism to heterogeneous resource descriptions with diverse capabilities. −Automated interactions and integration with existing applications.
  • 48.
    What are thechallenges? − The models provide the basic description frameworks, but alignment between different models and frameworks are required. − Semantics are the starting point, analysis and interpretation of data is required for automated processes. − Real interoperability happens when data/services from different frameworks and various providers can be interchanged and used with minimised manual intervention.
  • 49.
    Possible solutions − Usingmachine-readable and machine-interpretable meta-data − Important not: all machine-readable are machine-interpretable. − Well-defined standards and description frameworks: RDF, OWL, SPARQL. − Variety of open-source, commercial tools for creating/managing/querying and accessing semantic data. − Some of the tools/libraries include: Jena Libraries, Protégé Ontology Tool, … − An Ontology defines conceptualisation of a domain. − Terms and concepts − A common vocabulary − Relationships between the concepts − There are several existing and emerging ontologies in the IoT domain. − Complimentary tools and steps such as automated annotation methods…;
  • 50.
    How to adaptthe solutions − Creating ontologies and defining data models are not enough − tools to create and annotate data − data handling components − Complex models and ontologies may look good, but − design lightweight versions for constrained environments − think of practical issues − make the semantic/ontology models as much as possible compatible and/or linked to the other existing concepts/model. − Domain knowledge and instances − Common terms and vocabularies − Location, unit of measurement, type, theme, … − Link it to other resources − In many cases, semantic annotations and semantic processing should be intermediary not the end product.
  • 51.
    Practice Question − Let’sassume an IoT framework with two different types of data: − Ambient temperature − Body temperature − Body temperature is a type of physiological observation and monitoring (O&M) data; − Ambient temperature is a type of environmental O&M data; − Device A with manufacturer ID=000AB23 measures the body temperature − Device B with manufacturer ID=123AB23 measures the ambient temperature. − Using a graph model, design a simple ontology for these concepts;
  • 52.
  • 53.
    Practice Question − Showthis body temperature data in JSON and XML formats. 37, C, 08:36, Device_A, John Smith 53
  • 54.
  • 55.