IRSW - Semantic Web Introduction
IRSW - Semantic Web Introduction
… an intermediate one …
10
… or this one
15
… on flickr …
17
… on Google …
18
A “mashup” example:
24
Semantic web
Semantic web have set of standards and best
practices for sharing data and the
semantics of that data over the web for use
by applications.
A set of standards:
• The RDF Data Model.
• The SPARQL query Language.
• OWL Standards for storing vocabularies and ontologies.
The best practices for sharing data over
web
• The use of URIs to name things
• The use of standards such as RDF and SPARQL
31
In what follows…
We will use a simplistic example to introduce the
main technical concepts
The details will be for later during the course
32
6 ID Auteur
7 ISBN-0-00-651409-X A12
11 Nom
12 Ghosh, Amitav
13 Besse, Christianne
36
Is that surprising?
It may look like it but, in fact, it should not be…
What happened via automatic means is done every
day by Web users!
The difference: a bit of extra rigour so that
machines could do this, too
49
RDF HISTORY
54
Views of RDF
56
<rdf:Description
<rdf:Description rdf:about="http://…/isbn/2020386682">
rdf:about="http://…/isbn/2020386682">
<f:titre
<f:titre xml:lang="fr">Le palais
xml:lang="fr">Le palais des
des mirroirs</f:titre>
mirroirs</f:titre>
<f:original
<f:original rdf:resource="http://…/isbn/000651409X"/>
rdf:resource="http://…/isbn/000651409X"/>
</rdf:Description>
</rdf:Description>
This graph shows several nodes that represent entities such as the
Beatles band and one of their studio albums.
Each edge has an identifier that tells us what relationship holds between
those nodes. For example, the :member edge links bands to its
members. The rdf:type edge represent a special kind of relationship.
These edges are sometimes called “attributes” of the node and are often
used to represent the characteristics of the nodes.
This simple, flexible data model has a lot of expressive power to
represent complex situations, relationships, and other things of interest,
while also being appropriately abstract,
62
RDf in turtle
63
RDF
RDF NODES
•Blank node: Nodes without a user-visible identifier are called blank nodes
(“bnode” for short). A blank node is appropriate when the node does not need
to be referenced directly. Blank nodes can be reached by following its incident
edges from other nodes.
•Literal: Literals are concrete values used to represent datatypes like strings,
numbers, and dates.
In the example Beatles graph, we have several IRIs: :The_Beatles and :John_Lennon are
two examples. Literals in our example include the string "The Beatles", the date "1963-03-22",
and the integer 125
IRI 65
IRIs, just like the URIs and URLs they generalize, are long strings that are not
easy to read or write. A full IRI can be serialized by simply enclosing it in
angle brackets:
Suppose we extend our example. We have a new use case that requires us to
capture, for all the tracks in an album, which side they belong to–when applicable
for albums released on media with “sides”, i.e., vinyl, cassettes, etc.–and the order
of the song on the album/side. We can introduce a blank node between the album
and the song to attach this data:
Blank nodes do not have globally unique identifiers so when they are serialized a locally
unique, non-persistent label is used. These blank node names are serialized after
the special prefix _:.
67
Literals
Literals are serialized as their lexical value in double quotes followed by the datatype
after double carets (^^). The datatype is typically a built-in datatype from
XML Schema Datatypes (XSD) that defines many commonly used datatypes but
custom datatype IRIs can also be used. Some of the XSD datatypes can be
serialized without the explicit datatype or the quotes. The following table shows
examples of serializing different datatypes:
RDf in turtle
The
serialization of
the Beatles
graph in Turtle
syntax looks
like this:
70
•Multiple objects: If two triples share the same subject and the same predicate the
objects can be separated with , without repeating the subject or the predicate.
•Types: The letter a can be used in place of rdf:type; you can read this as “is a”,
basically. For example, “Love Me Do is a song.”
71
72
Named Graph
Sometimes it is useful to assign a name to an RDF
graph for the purposes of sane data management,
access control, or to attach metadata to the overall
graph rather than to individual nodes. The notion of
named graphs in RDF allows us to do that.
73
RDF Class
Property is a relation between subjects and objects. We have already seen many
examples of properties; :album, for example. We can use the rdf:Property class to
declare properties:
:track a rdf:Property .
:length a rdf:Property .
should
The range of the track property is defined to be a Song class, so the objects be resources th
are instances of this class.
The range of the length property, on the other hand, is defined to be the built-in datatype xsd:integer
so the objects should be integer literals.
76
RDF Metadata