Vous êtes sur la page 1sur 103

Web Semantique

fg@lri.fr, http ://www.lri.fr/

goasdoue
Francois Goasdoue
Univ. Paris-Sud
24 avril 2013
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 1 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Idee : ajouter une description semantique des donnees du Web an de
faciliter leur exploitation (interrogation ou comparaison,. . . ).
le Web Semantique permet lexploitation semantique de donnees alors
que le Web classique permet dexploiter structurellement les donnees.
Pourquoi ?
Les donnees du Web sont decrites uniquement de facon structurelle :
HTML (statique ou dynamique) : texte libre formate

le but est de produire un rendu visuel de donnees textuelles

ce type de donnees nest pas facilement exploitable semantiquement


(text mining, web mining,. . . )
XML : BD sur le Web (XML+DTD/Schema+XPath/XQuery)

le but est de produire un espace de stockage de donnees (arborescent),


an de pouvoir facilement les retrouver, les mettre `a jours,. . . comme
dans un SGBD

il ny a pas de semantique dans lorganisation des donnees [eg. pas de


semantique pour limbrication delements] (schema mining)
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 2 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Comment ?
Lidee centrale du Web Semantique est dutiliser des ontologies pour
exploiter les donnees du Web dun point de vue semantique.
Ontologie
Une ontologie est une specication formelle dun domaine dapplication.
Elle denit un vocabulaire en termes duquel des donnees du Web seront
decrites.
Comment (bis), en pratique ?
Le W3C (World Wide Web Consortium) propose deux recommandations
(normes) pour mettre en uvre le Web Semantique : RDF(S) et OWL.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 3 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
RDF(S), OWL et logiques de description
RDF(S) ou Resource Description Framework (Schema) est la
recommandation (simpliste) pour decrire de facon sommaire des
donnees du Web
OWL ou Ontology Web Language est la recommandation (complexe)
pour decrire de fa con detaillee des donnees du Web
Le point commun de RDF(S) et OWL est que les langages dontologies qui
y sont associes se fondent sur les logiques de description.
RDF et OWL2 prole QL
Dans ce cours, nous etudierons le mod`ele de donnees RDF et OWL2
prole QL (la logique de description DL-lite
R
) qui est un bon
compromis entre RDF(S) et OWL : cest un sur-langage de RDF(S) et un
sous-langage de OWL1.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 4 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Ontologie DL-lite
R
(simple) pour le e-commerce
Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 5 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Indexation de pages Web en termes de lontologie
Pbd dvd(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition)
nom(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,Le fabuleux destin dAmelie Poulain)


prix(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,9.98)
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-Playstation-3-80-
Go)
. . .
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go)
nom(http ://www.amazon.fr/Console-Playstation-3-80-Go,Playstation 3)
prix(http ://www.amazon.fr/Console-Playstation-3-80-Go,450)
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 6 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Interrogation semantique de donnees en termes de lontologie
Quels sont les DVD/Blu-ray `a moins de 20 euros compatibles avec la
PS3 ? Q(d) : bd dvd(d) prix(d, p) p 20 compatible(d, l ) nom(l , Playstation 3)
d=http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition
d=http ://www.amazon.fr/Harry-potter-lecole-sorciers-Blu-ray
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 7 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Interrogation semantique de donnees en termes de lontologie
Quels sont les noms et references des produits hi `a moins de 500 euros ?
Q(n, r ) : Phi(ph) nom(ph, n) ref (ph, r ) prix(ph, p) p 500
n=Playstation 3 et r=B00005R6XJ
n=Philips - 32PFL5403D/12 et r=B001ANOX7C
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 8 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Interet du Web Semantique
`
A partir de donnees decrites structurellement sur le Web, on peut
construire leur description semantique grace `a une ontologie. Ceci permet
de poser des requetes naturelles pour un utilisateur lambda, alors
quobtenir les memes informations en interrogeant les donnees par leur
structure serait impossible (HTML) ou tr`es dicile (XML).
Pour mettre en uvre le Web Semantique, plusieurs probl`emes se posent
et doivent donc etre etudies theoriquement et algorithmiquement.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 9 / 103
Introduction au Web Semantique
Le Web Semantique en quelques mots. . .
Les enjeux du Web Semantique
Comment construire une ontologie ?
Comment garantir un certain niveau de qualite pour une ontologie ?

Facilite de comprehension, Satisabilite dune ontologie, etc.


Comment indexer des donnees du Web via une ontologie ?
Comment garantir un certain niveau de qualite pour lindexation des
donnees du Web via une ontologie ?

Consistance des donnees indexees par rapport `a lontologie.


Comment interroger des donnees du Web via une ontologie ?

Theorie et algorithmique du calcul des reponses `a une requete.


Comment comparer des donnees de dierentes sources via une
ontologie ?
Comment comparer/integrer des ontologies ?
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 10 / 103
Premi`ere partie I
Gestion semantique de donnees avec RDF
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 11 / 103
: Resource Description Framework
RDF is a graph-based data model. An RDF database is made of :
a schema (i.e., an ontology) written using RDF Schema (optional)
a dataset
An RDF database is queried using (an SQL-like)
Other standardized data models
relational model : relation/table-based, schema (required) + dataset
XML : tree-based, schema (optional) + dataset
On the usage of RDF
RDF is obviously appropriate to model data that are graphs, but RDF is
also used as a simple user-friendly meta-model for having an abstract
homogeneous view of data from one or more (heterogeneous) sources.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 12 / 103
RDF Schema (by example)
RDF schema for e-commerce
CultP rdfs :subClassOf Prod . name rdfs :domain Prod .
Concole rdfs :subClassOf CultP . name rdfs :range rdf :Literal .
BD dvd rdfs :subClassOf CultP . ref rdfs :domain Prod .
HihiP rdfs :subClassOf Prod . ref rdfs :range rdf :Literal .
Bd dvd player rdfs :subClassOf HihiP . price rdfs :domain Prod .
Tv rdfs :subClassOf HihiP . price rdfs :range rdf :Literal .
compatible rdfs :domain Bd dvd . redPrice rdfs :subProperty price .
compatible rdfs :range Bd dvd player .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 13 / 103
RDF data (by example)
RDF data for e-commerce wrt the above schema
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin


dAmelie Poulain .
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98 .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http ://www.amazon.fr/Console-Playstation-3-80-Go .
. . .
http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console .
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3 .
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450 .
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399 .
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 14 / 103
RDF querying (by example)
SPARQL querying
Which DVDs/Blu-rays cost less than 20 euros and are compatible with the
PS3 ?
SELECT ?d FROM db WHERE { ?d rdf:type Bd dvd . ?d price ?p . ?d compatible ?pl . ?pl
name "Playstation 3" . FILTER(?p 20) }
---
?d
---
http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition
http://www.amazon.fr/Harry-potter-lecole-sorciers-Blu-ray
...
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 15 / 103
RDF querying (by example)
SPARQL querying needs reasoning !
What are the names and references of Hi products that cost less than
400 euros ?
SELECT ?n ?r FROM db WHERE { ?hp rdf:type HifiP . ?hp name ?n . ?hp ref ?r . ?hp
price ?p . FILTER(?p 400) }
------
?n ?r
------
"Playstation 3" "B00005R6XJ"
...
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 16 / 103
Outline of the course about RDF
1
The RDF data model
2
The SPARQL query language
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 17 / 103
The RDF data model
The RDF data model allows writting labeled graph using triples.
Denition (Triple)
A triple is made of three components :
1
a subject : URI or a blank node (unnamed URI)
2
a property or predicate : URI
3
an object : URI, blank node, or literal (string)
A triple is written : subject property object .
Denition (Graph)
An RDF graph is a set of triples (a database).
Its nodes are (labeled with) the subjects and objects of the triples.
Its edges are (labeled with) the properties of the triples.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 18 / 103
The RDF data model
Graph of an RDF database
http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf:type Bd dvd .


http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name "Le fabuleux


destin dAmelie Poulain" .
http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price "9.98" .


http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http://www.amazon.fr/Console-Playstation-3-80-Go .
http://www.amazon.fr/Console-Playstation-3-80-Go rdf:type Console .
http://www.amazon.fr/Console-Playstation-3-80-Go name "Playstation 3" .
http://www.amazon.fr/Console-Playstation-3-80-Go price "450" .
http://www.amazon.fr/Console-Playstation-3-80-Go redPrice "399" .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 19 / 103
The RDF data model
Graph of an RDF/XML database
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns# xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd/>
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<pr i c e >9.98</ pr i c e >
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cons ol e/>
<name>Pl a y s t a t i o n 3</name>
<pr i c e >450</pr i c e >
<r e dPr i c e >399</r e dPr i c e>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 20 / 103
RDF data model
Note that from a logical viewpoint, a triple is a fact (in the rst order logic
sense) and a RDF graph is a set of facts.
Graph of an RDF database
RDF :
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin dAmelie Poulain .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98 .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http ://www.amazon.fr/Console-Playstation-3-80-Go .
http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console .
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3 .
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450 .
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399 .
FOL :
Bd dvd(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition)
name(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition, Le fabuleux destin dAmelie Poulain)


price(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition, 9.98)
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,
http ://www.amazon.fr/Console-Playstation-3-80-Go)
Console(http ://www.amazon.fr/Console-Playstation-3-80-Go)
name(http ://www.amazon.fr/Console-Playstation-3-80-Go, Playstation 3)
price(http ://www.amazon.fr/Console-Playstation-3-80-Go, 450)
redPrice(http ://www.amazon.fr/Console-Playstation-3-80-Go, 399)
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 21 / 103
The RDF data model
An RDF database can have a schema.
Denition (Schema)
The schema of an RDF database states the semantic relationships that
hold between the classes and properties to which the data belongs.
The an RDF schema allows dening four semantic relationships.
Semantic relationship RDFS notation FOL notation Relational notation
Class inclusion C
1
rdfs :subClassOf C
2
. X(C
1
(X) C
2
(X)) C
1
C
2
Property inclusion P
1
rdfs :subPropertyOf P
2
. XY(P
1
(X, Y) P
2
(X, Y)) P
1
P
2
Domain typing of a property P rdfs :domain C . XY(P(X, Y) C(X))
domain
(P) C
Range typing of a property P rdfs :range C . XY(P(X, Y) C(Y))
range
(P) C
WARNING!
In contrast with the relational data model, RDFS relationships are not
integrity constraints enforced in the database (see next slides).
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 22 / 103
RDF data model
RDF schema for e-commerce
CultP rdfs :subClassOf Prod . name rdfs :domain Prod .
Concole rdfs :subClassOf CultP . name rdfs :range rdf :Literal .
Bd dvd rdfs :subClassOf CultP . ref rdfs :domain Prod .
HihiP rdfs :subClassOf Prod . ref rdfs :range rdf :Literal .
Bd dvd player rdfs :subClassOf HihiP . price rdfs :domain Prod .
Tv rdfs :subClassOf HihiP . price rdfs :range rdf :Literal .
compatible rdfs :domain Bd dvd . redPrice rdfs :subProperty price .
compatible rdfs :range Bd dvd player .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 23 / 103
RDF data model
RDF schema for e-commerce
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns : r d f s =ht t p : //www. w3 . or g /2000/01/ r df schema#
xml ns=ht t p : //www. l r i . f r#>
<r d f s : Cl a s s r d f : about=ht t p : //www. l r i . f r#Cul tP>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</r d f s : Cl as s>
<r d f s : Cl a s s r d f : about=ht t p : //www. l r i . f r#Cons ol e>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f s : Cl as s>
<r d f s : Pr oper t y r d f : about=ht t p : //www. l r i . f r#p r i c e>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f s : Pr oper t y>
<r d f s : Pr oper t y r d f : about=ht t p : //www. l r i . f r#r e d Pr i c e>
<r d f s : s ubPr oper t yOf r d f : r e s o ur c e=ht t p : //www. l r i . f r#p r i c e />
</r d f s : Pr oper t y>
<r d f s : Cl a s s r d f : about=ht t p : //www. l r i . f r#Bd dvd>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f s : Cl as s>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 24 / 103
RDF data model
RDF schema for e-commerce
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 25 / 103
The RDF data model
RDF database for e-commerce : schema statements are not ICs
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin dAmelie Poulain .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98 .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http ://www.amazon.fr/Console-Playstation-3-80-Go .
http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console .
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3 .
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450 .
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399 .
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition does not have to also be explicitly stored into CultP


and Prod, though it is implicitly stored in those classes.
http ://www.amazon.fr/Console-Playstation-3-80-Go does not have to also be explicitly stored into CultP, Prod,
Bd dvd player, HiP, though it is implicitly stored in those classes.
(http ://www.amazon.fr/Console-Playstation-3-80-Go,399) does not have to also be explicitly stored into Price,
though it is implicitly stored in that property.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 26 / 103
The RDF data model
Reasoning mechanisms
A direct consequence of the fact that RDFS semantic relationships are not
integrity constraints is the need of reasoning mechanisms to exhibit all the
required implicit data wrt a data management task (e.g., query answering).
Querying the RDF database for e-commerce
If we want to know all the Hi products in the database, looking only at
the data below, we get no answer. Though,
http://www.amazon.fr/Console-Playstation-3-80-Go is an answer
if we also consider the schema associated to the data.
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin dAmelie Poulain .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98 .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http ://www.amazon.fr/Console-Playstation-3-80-Go .
http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console .
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3 .
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450 .
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399 .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 27 / 103
The RDF data model
To make explicit all the implicit triples of a database, we can saturate it.
One can saturate :
the schema

does not make much sense, except for asking queries at the schema
level
the data based on its associated schema

to guarantee the completeness of query answering against the database


Of course, one can saturate both the schema and the data.
Pros and cons of saturation
Pros : easy to achieve
Cons : require space, not robust to update (induce maintenance cost)
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 28 / 103
The RDF data model
The saturation of a RDF schema is obtained by applying exhaustively the
following rules.
Saturation rules for an RDF schema o (partial)
If C1 rdfs:subClassOf C2 . and C2 rdfs:subClassOf C3 . are in o
Then add C1 rdfs:subClassOf C3 . to o
If P1 rdfs:subPropertyOf P2 . and P2 rdfs:subPropertyOf P3 .
Then add P1 rdfs:subPropertyOf P3 . to o
If P1 rdfs:subPropertyOf P2 . and P2 rdfs:domain C . are in o
Then add P1 rdfs:domain C . to o
If P1 rdfs:subPropertyOf P2 . and P2 rdfs:range C . are in o
Then add P1 rdfs:range C . to o
If P1 rdfs:domain C1 . and C1 rdfs:subClassOf C2 . are in o
Then add P1 rdfs:domain C2 . to o
If P1 rdfs:range C1 . and C1 rdfs:subClassOf C2 . are in o
Then add P1 rdfs:range C2 . to o
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 29 / 103
The RDF data model
Saturation of the RDF schema for e-commerce
CultP rdfs :subClassOf Prod . name rdfs :domain Prod .
Concole rdfs :subClassOf CultP . name rdfs :range rdf :Literal .
BD dvd rdfs :subClassOf CultP . ref rdfs :domain Prod .
HihiP rdfs :subClassOf Prod . ref rdfs :range rdf :Literal .
Bd dvd player rdfs :subClassOf HihiP . price rdfs :domain Prod .
Tv rdfs :subClassOf HihiP . price rdfs :range rdf :Literal .
compatible rdfs :domain Bd dvd . redPrice rdfs :subProperty price .
compatible rdfs :range Bd dvd player .
The saturation of the above schema adds (among other triples) :
Console rdfs :subClassOf Prod .
redPrice rdfs :domain Prod . and redPrice rdfs :range rdf :Literal .
compatible rdfs :domain CultP ., compatible rdfs :domain Prod .,
compatible rdfs :range HiP ., and compatible rdfs :domain Prod .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 30 / 103
The RDF data model
The saturation of RDF data wrt the associated RDF schema is obtained
by applying exhaustively the following rules.
Saturation rules for an RDF dataset T wrt an RDF schema o
If d rdf:type C1 . is in T and C1 rdfs:subClassOf C2 . is in o
Then add d rdf:type C2 . to T
If d1 P1 d2 . is in T and P1 rdfs:subPropertyOf P2 . is in o
Then add d1 P2 d2 . to T
If d1 P1 d2 . is in T and P1 rdfs:domain C . is in o
Then add d1 rdf : type C . to T
If d1 P1 d2 . is in T and P1 rdfs:range C . is in o
Then add d2 rdf : type C . to T
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 31 / 103
The RDF data model
Saturation of the RDF schema for e-commerce
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin dAmelie Poulain .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98 .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http ://www.amazon.fr/Console-Playstation-3-80-Go .
http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console .
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3 .
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450 .
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399 .
The saturation of the dataset wrt the schema adds (among other triples) :
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type CultP .


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Prod .


http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type HiP .
http ://www.amazon.fr/Console-Playstation-3-80-Go price 399 .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 32 / 103
The RDF data model
Concluding remark
The saturation of the dataset of an RDF database wrt its schema precisely
corresponds to what would have been obtained if RDFS relationships were
integrity constraints.
Pros : its more user-friendly (you only say what you want, the rest in
inferred).
Cons : the price to pay is a reasoning overhead.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 33 / 103
RDF in pratice : RDF/XML
How to put triples on the Web ?
RDF triples are serialized into an XML notation for RDF : RDF/XML.
AN RDF/XML document being an XML document, it is made of (at
least) :
1
a prolog <?xml version=1.0?>
2
and a body
<rdf:RDF xmlns:rdf="http:
//www.w3.org/1999/02/22-rdf-syntax-ns#">

</rdf:RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 34 / 103
RDF/XML
The element rdf:Description is central in RDF/XML as it allows
writing triple(s).
rdf:Description
A triple s p o . is written :
when s and o are URIs
<rdf:Description rdf:about=s>
<p rdf:resource=o />
</rdf:Description>
when s is an URI and o is a literal
<rdf:Description rdf:about=s>
<p> o </p>
</rdf:Description>
or (caution !)
<rdf:Description rdf:about=s p=o />
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 35 / 103
RDF/XML
rdf:Description allows writing several triples if they have the same
subject.
Factorizing triples
N triples s p1 o1 .,. . . ,s pN oN . can be written :
<rdf:Description rdf:about=s>
<p1 rdf:resource=o1 />
...
<pN rdf:resource=oN />
</rdf:Description>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 36 / 103
RDF/XML
Graph of an RDF database
http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf:type Bd dvd .


http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name "Le fabuleux


destin dAmelie Poulain" .
http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price "9.98" .


http://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible
http://www.amazon.fr/Console-Playstation-3-80-Go .
http://www.amazon.fr/Console-Playstation-3-80-Go rdf:type Console .
http://www.amazon.fr/Console-Playstation-3-80-Go name "Playstation 3" .
http://www.amazon.fr/Console-Playstation-3-80-Go price "450" .
http://www.amazon.fr/Console-Playstation-3-80-Go redPrice "399" .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 37 / 103
RDF/XML
Graph of an RDF/XML database
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns# xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd/>
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<pr i c e >9.98</ pr i c e >
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cons ol e/>
<name>Pl a y s t a t i o n 3</name>
<pr i c e >450</pr i c e >
<r e dPr i c e >399</r e dPr i c e>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 38 / 103
RDF/XML
Graph of an RDF schema
CultP rdfs :subClassOf Prod . name rdfs :domain Prod .
Concole rdfs :subClassOf CultP . name rdfs :range rdf :Literal .
Bd dvd rdfs :subClassOf CultP . ref rdfs :domain Prod .
HihiP rdfs :subClassOf Prod . ref rdfs :range rdf :Literal .
Bd dvd player rdfs :subClassOf HihiP . price rdfs :domain Prod .
Tv rdfs :subClassOf HihiP . price rdfs :range rdf :Literal .
compatible rdfs :domain Bd dvd . redPrice rdfs :subProperty price .
compatible rdfs :range Bd dvd player .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 39 / 103
RDF/XML
Graph of an RDF/XML schema
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns : r d f s =ht t p : //www. w3 . or g /2000/01/ r df schema#
xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Cul tP>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Cons ol e>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#p r i c e>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#r e d Pr i c e>
<r d f s : s ubPr oper t yOf r d f : r e s o ur c e=ht t p : //www. l r i . f r#p r i c e />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Bd dvd>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 40 / 103
RDF/XML
About blank nodes
A blank node is created whenever rdf:nodeID=label is used in
place of rdf:about=URI as the subject of a triple (i.e., in an
rdf :Description) or rdf:resource=label as the object of a triple
(i.e., in a property).
How to use rdf:nodeID ?
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns# xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#bd dvd/>
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<pr i c e >9.98</ pr i c e >
<c ompat i bl e r d f : nodeI D=xbox/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : nodeI D=xbox>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cons ol e/>
<name>XBOX 360</name>
<pr i c e >249</pr i c e >
<r e dPr i c e >179</r e dPr i c e>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 41 / 103
RDF/XML-ABBREV
A more compact notion of RDF/XML exists : RDF/XML-ABBREV.
RDF/XML-ABBREV
In that notation, rdf:Description is replaced by a type of the
description.
RDF data in RDF/XML
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns# xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd/>
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<pr i c e >9.98</ pr i c e >
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cons ol e/>
<name>Pl a y s t a t i o n 3</name>
<pr i c e >450</pr i c e >
<r e dPr i c e >399</r e dPr i c e>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 42 / 103
RDF/XML-ABBREV
RDF data in RDF/XML-ABBREV
<?xml v e r s i o n =1.0?>
<r d f : RDF
xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns=ht t p : //www. l r i . f r#>
<Bd dvd r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
<pr i c e >9.98</ pr i c e >
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
</Bd dvd>
<Cons ol e r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r e dPr i c e >399</r e dPr i c e>
<pr i c e >450</pr i c e >
<name>Pl a y s t a t i o n 3</name>
</Consol e>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 43 / 103
RDF/XML-ABBREV
RDF schema in RDF/XML
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns : r d f s =ht t p : //www. w3 . or g /2000/01/ r df schema#
xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Cul tP>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Cons ol e>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#p r i c e>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#r e d Pr i c e>
<r d f s : s ubPr oper t yOf r d f : r e s o ur c e=ht t p : //www. l r i . f r#p r i c e />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Bd dvd>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 44 / 103
RDF/XML-ABBREV
RDF schema in RDF/XML-ABBREV
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns : r d f s =ht t p : //www. w3 . or g /2000/01/ r df schema#
xml ns=ht t p : //www. l r i . f r#>
<r d f s : Cl a s s r d f : about=ht t p : //www. l r i . f r#Cul tP>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</r d f s : Cl as s>
<r d f s : Cl a s s r d f : about=ht t p : //www. l r i . f r#Cons ol e>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f s : Cl as s>
<r d f s : Pr oper t y r d f : about=ht t p : //www. l r i . f r#p r i c e>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f s : Pr oper t y>
<r d f s : Pr oper t y r d f : about=ht t p : //www. l r i . f r#r e d Pr i c e>
<r d f s : s ubPr oper t yOf r d f : r e s o ur c e=ht t p : //www. l r i . f r#p r i c e />
</r d f s : Pr oper t y>
<r d f s : Cl a s s r d f : about=ht t p : //www. l r i . f r#Bd dvd>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f s : Cl as s>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 45 / 103
RDF/XML(-ABBREV)
The XML notations of RDF allow enforcing type checking on literals using
the property rdf :datatype.
How to use data types ?
A data type is specied in the triple notation using s p o^^URI, where
URI is the URI of the desired XML Schema data type.
The corresponding RDF/XML notation is :
<rdf:Description rdf:about=s>
<p rdf:datatype=URI>string</p>
</rdf:Description>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 46 / 103
RDF/XML(-ABBREV)
Using data types in RDF data
ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n r d f : t ype Bd dvd .
ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n
name Le f a bul e ux d e s t i n d Amel i e Poul ai n .
ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n
p r i c e 9.98<ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t > .
ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEdi t i o n
c ompat i bl e ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go .
ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go r d f : t ype Cons ol e .
ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go name Pl a y s t a t i o n 3 .
ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go
p r i c e 450<ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t > .
ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go
r e d Pr i c e 399<ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t > .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 47 / 103
RDF/XML(-ABBREV)
Using data types in RDF/XML data
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns# xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd/>
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >9.98</ pr i c e >
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cons ol e/>
<name>Pl a y s t a t i o n 3</name>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >450</pr i c e >
<r e d Pr i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >399</r e dPr i c e>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 48 / 103
The SPARQL query language
SPARQL (SPARQL Protocol and RDF Query Language) is a W3C
recommendation since 2008.
SPARQL Protocol and RDF Query Language
The SPARQL recommendation contains both a protocol to access remote
RDF data and a query language.
WARNING!
In this course, we focus on the RDF query language only.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 49 / 103
The SPARQL query language
From a theoretical viewpoint, SPARQL mainly models a restriction of rst
order logic (FOL) queries over a single relation : the saturated triple table.
FOL query
A query if a FOL formula ( x), where x is the (possibly empty) set of the
free variables in (those that are not quantied). The arity of a query is
the cardinality of x, e.g., 0 for a boolean query (a yes/no query).
Triple table
The triple table t(s, p, o) is a table that stored RDF triples, where the s,
p, o attributes respectively denote the subject, property, and object for a
triple/tuple.
SPARQL queries FOL queries
SPARQL has the expressive power of the relational algebra.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 50 / 103
The SPARQL query language
FOL query answering
The answer set of a query Q : ( x) of arity n 1 against a dataset T is
ans(Q, T) =

t (
n
[ T [= ( x)
[ x

t]
and ( is the set of constant
occuring in T.
By convention, when Q : ( x) is boolean ( x is empty)
ans(Q, T) = true if T [= ()
ans(Q, T) = false otherwise.
RDF/SPARQL vs FOL query answering
Let Q : ( x) be a SPARQL query (thus a FOL query) and T an RDF
dataset associated to a schema o.
The answer set of Q wrt the database o, T, denoted ans(Q, o, T), is :
ans(Q, saturate(o, T)).
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 51 / 103
The SPARQL query language
Saturated triple table for the e-commerce example
t s p o
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin dAmelie Poulain


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible http ://www.amazon.fr/Console-Playstation-3-80-Go


http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399
. . . . . . . . .
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type CultP


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Prod


http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type HiP
http ://www.amazon.fr/Console-Playstation-3-80-Go price 399
. . . . . . . . .
Is there an Hi product that is compatible with a cultural product ?
SPARQL :
ASK FROM db WHERE ?hp rdf:type HifiP . ?cp compatible ?hp . ?cp
rdf:type CultP .
FOL :
Q() : xy t(x, rdf : type, HiP) t(y, compatible, x) t(y, rdf : type, CultP)
ans(Q, saturate(o, T)) =?
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 52 / 103
The SPARQL query language
Saturated triple table for the e-commerce example
t s p o
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Bd dvd


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition name Le fabuleux destin dAmelie Poulain


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition price 9.98


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition compatible http ://www.amazon.fr/Console-Playstation-3-80-Go


http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type Console
http ://www.amazon.fr/Console-Playstation-3-80-Go name Playstation 3
http ://www.amazon.fr/Console-Playstation-3-80-Go price 450
http ://www.amazon.fr/Console-Playstation-3-80-Go redPrice 399
. . . . . . . . .
http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type CultP


http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition rdf :type Prod


http ://www.amazon.fr/Console-Playstation-3-80-Go rdf :type HiP
http ://www.amazon.fr/Console-Playstation-3-80-Go price 399
. . . . . . . . .
What Hi product has at least two dierent prices ?
SPARQL :
SELECT FROM db WHERE ?hp rdf:type HifiP . ?hp price ?p1 . ?hp
price ?p2 . FILTER(?p1 != ?p2)
FOL :
Q(x) : yz t(x, rdf : type, HiP) t(x, price, y) t(x, price, z) y ,= z
ans(Q, saturate(o, T)) =?
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 53 / 103
SPARQL in practice
SPARQL Query
A SPARQL query has :
1
A prolog
2
A section that denes the output
3
A section that denes the data sources to query
4
A section that denes the constraints the output must match
5
A section that denes the order of the results in the output
6
A section that denes which results are in the output
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 54 / 103
SPARQL : prolog
The prolog is optional and is stated using the keywords :
1
BASE
2
PREFIX
BASE
BASE allows dening a base URI <uri> that will be used to expand
relative URIs occurring in the query.
PREFIX
PREFIX allows dening a namespace PREFIX ns: <uri>. PREFIX can be
used as many times as necessary.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 55 / 103
SPARQL : output & data sources
The output of a query is dened using :
SELECT [DISTINCT] ?variable
1
?variable
n
or SELECT [DISTINCT] *
This denes a projection (in the relational sense) on variables used in
the constraints dening the query.
ASK
This indicates a boolean query.
The sources to query are given using :
FROM <uri> (can be repeated)
When FROM <uri> is repeated, the union of the datasets is queried.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 56 / 103
SPARQL : constraints
Constraints are given using combinations of graphs made of triples.
Note that triples can contain variables.
Contraints are dened using :
WHERE graph
where graph is

a simple graph : a set of triples t


1
. t
n
. (with variables, blank
nodes,. . . ) that must appear in the data (up to assigning variables to
constants).

a conjunction of graphs g
1
g
n
that must appear in the data.

a union de graphs g
1
UNION UNION g
n
one of which must
appear in the data.

an optional graph : OPTIONAL g that may appear in the data.


Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 57 / 103
SPARQL : constraints
Additional constraints can be expressed on a graph using FILTER
(condition) :
boolean combinations ||, &&, !, ()
arithmetic comparisons =, !=, <, >, <=, >=
arithmetic operations +,-,*,/
many others
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 58 / 103
SPARQL : order of the results in the output
Ordering the results in the output is optional. This is done using :
ORDER BY [ASC(|DESC(]?v
1
[)] ...[ASC(|DESC(]?v
n
[)]
where v
1
. . . v
n
is the sequence w.r.t. which the results are ordered
(v
1
. . . v
n
must be in the SELECT !). By default, the values of the
variables are ordered from the smallest to the biggest. Modiers are
used to state the order to be used : : ASC(?v) to order the values of
?v from the smallest to the biggest and DESC(?v) to order them
from the biggest to the smallest.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 59 / 103
SPARQL : which results are in the output ?
Dening which results go in the output is optional.
This is done using :
LIMIT l
where l is an integer stating the maximal number of results in the
output (the others are discarded).
and/or OFFSET o
where o is an integer stating from which results the output starts.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 60 / 103
SPARQL : examples
The RDF database : schema
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns : r d f s =ht t p : //www. w3 . or g /2000/01/ r df schema#
xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Cul tP>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Hi f i P>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Cons ol e>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Bd dvd>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#Bd dvd pl aye r>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Hi f i P/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#TV>
<r d f s : s ubCl as s Of r d f : r e s o ur c e=ht t p : //www. l r i . f r#Hi f i P/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#name>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#r e f >
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#p r i c e>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#L i t e r a l />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#r e d Pr i c e>
<r d f s : s ubPr oper t yOf r d f : r e s o ur c e=ht t p : //www. l r i . f r#p r i c e />
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. l r i . f r#c ompat i bl e>
<r d f s : domai n r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd/>
<r d f s : r ange r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd pl aye r />
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 61 / 103
SPARQL : examples
The RDF database : data
<?xml v e r s i o n =1.0?>
<r d f : RDF xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns# xml ns=ht t p : //www. l r i . f r#>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd/>
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >9.98</ pr i c e >
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
</r d f : De s c r i pt i on>
<r d f : De s c r i p t i o n r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cons ol e/>
<name>Pl a y s t a t i o n 3</name>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >450</pr i c e >
<r e d Pr i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >399</r e dPr i c e>
</r d f : De s c r i pt i on>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 62 / 103
SPARQL : examples
The saturated data
<?xml v e r s i o n =1.0?>
<r d f : RDF
xml ns : r d f =ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#
xml ns=ht t p : //www. l r i . f r #
xml ns : r d f s =ht t p : //www. w3 . or g /2000/01/ r df schema#>
<Bd dvd r d f : about=ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEd i t i o n>
<c ompat i bl e r d f : r e s o ur c e=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go/>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >9.98</ pr i c e >
<name>Le f a bul e ux d e s t i n d Amel i e Poul ai n </name>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
</Bd dvd>
<Cons ol e r d f : about=ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
<r e d Pr i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >399</r e dPr i c e>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >450</pr i c e >
<name>Pl a y s t a t i o n 3</name>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Cul tP/>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Prod/>
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Bd dvd pl aye r />
<r d f : t ype r d f : r e s o ur c e=ht t p : //www. l r i . f r#Hi f i P/>
<p r i c e r d f : dat at ype=ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t >399</pr i c e >
</Consol e>
</r d f : RDF>
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 63 / 103
SPARQL : examples
Is there a Bd dvd player ?
PREFIX r d f :<ht t p : //www. w3 . or g /1999/02/22r df s ynt ax ns#>
PREFIX l r i :<ht t p : //www. l r i . f r#>
ASK
WHERE
?bdp r d f : t ype l r i : Bd dvd pl aye r .

w/o saturation : Ask => No ;


w/ saturation : Ask => Yes
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 64 / 103
SPARQL : examples
Is there more than one product ?
PREFIX r d f :<ht t p : //www. w3 . or g /1999/02/22r df s ynt ax ns#>
PREFIX l r i :<ht t p : //www. l r i . f r#>
ASK
WHERE
?p1 r d f : t ype l r i : Prod .
?p2 r d f : t ype l r i : Prod .
FILTER(? p1 != ?p2 )

w/o saturation : Ask => No ;


w/ saturation : Ask => Yes
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 65 / 103
SPARQL : examples
Is there a product with two prices ?
PREFIX r d f :<ht t p : //www. w3 . or g /1999/02/22r df s ynt ax ns#>
PREFIX l r i :<ht t p : //www. l r i . f r#>
ASK
WHERE
?hp r d f : t ype l r i : Hi f i P .
?hp l r i : p r i c e ?v .

w/o saturation : Ask => No ;


w/ saturation : Ask => Yes
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 66 / 103
SPARQL : examples
What are the products and their prices ?
PREFIX r d f :<ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#>
PREFIX l r i :<ht t p : //www. l r i . f r#>
SELECT ? pr od ? p r i c e
WHERE {
? pr od r d f : t ype l r i : Prod .
? pr od l r i : p r i c e ? p r i c e .
}
w/o s a t u r a t i o n :

| pr od | p r i c e |
================

w/ s a t u r a t i o n :

| pr od | p r i c e |
===========================================================================
| <ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go> | 399 |
| <ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go> | 450 |
| <ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEdi t i on> | 9. 98 |

Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 67 / 103


SPARQL : examples
What are the products and their prices <= 400, ordered by prices ?
PREFIX r d f :<ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#>
PREFIX l r i :<ht t p : //www. l r i . f r#>
SELECT ? pr od ? p r i c e
WHERE {
? pr od r d f : t ype l r i : Prod .
? pr od l r i : p r i c e ? p r i c e .
FILTER (? p r i c e <= 400)
}
ORDER BY ? p r i c e
w/o s a t u r a t i o n :

| pr od | p r i c e |
================

w/ s a t u r a t i o n :

| pr od
| p r i c e |
=====================================================================================================================
| <ht t p : //www. amazon . f r / Fabul euxde s t i ndAmel i ePoul ai nEdi t i on> | 9.98<ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t > |
| <ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
| 399<ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t > |

Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 68 / 103


SPARQL : examples
What is the second product and its price, provided that products are
ordered by prices ?
PREFIX r d f :<ht t p : //www. w3 . or g /1999/02/22r df s ynt axns#>
PREFIX l r i :<ht t p : //www. l r i . f r#>
SELECT ? pr od ? p r i c e
WHERE {
? pr od r d f : t ype l r i : Prod .
? pr od l r i : p r i c e ? p r i c e .
}
ORDER BY ? p r i c e
OFFSET 1
LIMIT 1
w/o s a t u r a t i o n :

| pr od | p r i c e |
================

w/ s a t u r a t i o n :

| pr od
| p r i c e |
=====================================================================================================================
| <ht t p : //www. amazon . f r / Consol ePl a y s t a t i on 380Go>
| 399<ht t p : //www. w3 . or g /2001/XMLSchema#f l o a t > |

Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 69 / 103


Deuxi`eme partie II
Gestion semantique de donnees avec OWL2
prole QL (DL-lite
1
)
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 70 / 103
DL-lite
1
Un peu dhistoire. . .
La logique DL-lite
R
appartient `a la famille de logiques de description
DL-lite, qui a ete proposee par les equipes de Bases de donnees et
Representation des connaissances des universites de Bozen-Bolzano et
Rome (Italie) :
Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, Riccardo Rosati,
Tractable Reasoning and Efficient Query Answering in Description Logics : The DL-Lite Family.
Journal of Automated Reasoning 39(3) : 385-429 (2007)
Gen`ese de DL-lite et DL-lite
R
La famille de LD DL-lite a ete con cue pour faire de la gestion de donnees
en temps polynomial dans la taille des donnees (passage `a lechelle).
DL-lite
R
et gestion semantique de donnees
Il a ete montre (dans larticle ci-dessus) que DL-lite
R
est un dialect de
la famille DL-lite garantisant une gestion ecaces de grandes masses de
donnees.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 71 / 103
DL-lite
1
Syntaxe des formules de DL-lite
R
Les relations que lon peut utiliser dans les formules sont darite 1 ou 2.
Syntaxe des concepts et roles atomiques
Une relation A darite 1 est appelee concept atomique.
Une relation P darite 2 est appelee role atomique.
Concepts et roles atomiques servent `a construire des concepts et roles de
bases.
Syntaxe des concepts et roles de base
Un concept de base B est un concept atomique A ou une
quantication existentielle non qualiee sur un role de base R.
Un role de base R est un role atomique P ou son inverse P

.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 72 / 103
DL-lite
1
Syntaxe des formules de DL-lite
R
Enn, ces concepts et roles de base servent `a construire des concepts et
roles generaux.
Syntaxe des concepts et roles generaux
Un concept general C est un concept de base B ou sa negation B.
Un role general E est un role de base R ou sa negation R.
Maintenant que nous avons une syntaxe pour les formules de DL-lite
R
(c`ad pour les concepts et roles de DL-lite
R
), il faut leur associer un
sens (c`ad ce que modelise ces formules) !
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 73 / 103
DL-lite
1
Semantique des formules de DL-lite
R
La semantique des formules de DL-lite
R
se denit inductivement `a partir
de la semantique des concepts et roles atomiques.
Semantique des concepts et r oles atomiques
La semantique des concepts et roles atomiques est donnee en termes
dinterpretations logiques. Une interpretation logique I est un couple
(
I
, .
I
), o` u
I
est un ensemble dobjets appele domaine dinterpretation
et .
I
est une fonction dinterpretation qui associe :
un sous ensemble de
I
`a tout concept atomique A : A
I

I
une relation binaire sur
I
`a tout role atomique P : P
I

I

I
.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 74 / 103
DL-lite
1
Semantique des formules de DL-lite
R
La semantique des concepts et roles de base et generaux de DL-lite
R
se
denit inductivement `a partir de la semantique des concepts et roles
atomiques.
Semantique des concepts et r oles de base et generaux
concept atomique A : A
I

I
role atomique P : P
I

I

I
role inverse P

: (x, y) [ (y, x) P
I

quantication universelle sur un role de base R : x [ (x, y) R


I

negation de concept de base C :


I
C
I
negation de role de base R :
I

I
R
I
Mod`ele dune relation et relation satisable
Une interpretation I est un mod`ele dune relation r ssi r
I
,= .
Une relation r est satisable ssi elle a un mod`ele.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 75 / 103
DL-lite
1
Syntaxe des Tboxes de DL-lite
R
Dans DL-lite
R
, les Tbox sont faites dinclusions entre concepts de la
forme B _ C et dinclusions entre roles de la forme R _ E.
Attention !
Les relations (concepts ou roles) en partie gauche dune inclusion sont
necessairement de base ! Seules les relations en partie droite dune
inclusion sont generales !
Inclusions positives et negatives
On distingue les inclusions positives (PI) et les inclusions negative (NI) :
une PI est de la forme B
1
_ B
2
ou R
1
_ R
2
une NI est de la forme B
1
_ B
2
ou R
1
_ R
2
Une PI modelise une inclusion entre concepts (resp. roles) alors quune NI
modelise deux concepts (resp. roles) disjoints.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 76 / 103
DL-lite
1
Semantique des Tboxes de DL-lite
R
Les PI et NI sont des contraintes entre concepts (resp. roles).
Semantique dune inclusion et dune Tbox
Etant donnee une interpretation I de concepts et roles atomiques :
I est un mod`ele dune inclusion B
1
_ C
2
(resp. R
1
_ E
2
) ssi B
I
1
C
I
2
(resp. R
I
1
E
I
2
). Une inclusion satisable a un mod`ele.
I est un mod`ele dune Tbox T ssi cest un mod`ele de chacune des
inclusions de T . Une Tbox satisable a un mod`ele.
Une Tbox est la donnee explicite de contraintes dinclusion. Or de ces
contraintes explicites, on peut deduire de nouvelles contraintes qui sont
implicites `a la Tbox : les contraintes logiquement impliquees par la Tbox.
Contrainte dinclusion impliquee par une Tbox
Une contrainte dinclusion (PI ou NI) est impliquee par une Tbox T ,
notee T [= , ssi tout mod`ele de T est aussi un mod`ele de .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 77 / 103
DL-lite
1
Exemple de Tbox de DL-lite
R
et dinclusions impliquees par une Tbox de DL-lite
R
Tbox (ou ontologie) DL-lite
R
pour le e-commerce
Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd
La Tbox T ci-dessus implique par exemple :
les PI : Ptv _ Pprod et compatible _ Pcult
les NI : Pconsole _ Plect bd dvd et compatible _ compatible

Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 78 / 103


DL-lite
1
Syntaxe des Aboxes de DL-lite
R
Une Abox est un ensemble de faits ou assertions dappartenance de
donnees `a des concepts atomiques de la forme A(a) et roles atomiques de
la forme P(a, b).
Attention ! ! !
En DL-lite
R
, les assertions ne sont que pour les concepts et roles
atomiques.
Exemple de Abox DL-lite
R
Pbd dvd(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition)
nom(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,Le fabuleux destin dAmelie Poulain)


prix(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,9.98)
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-Playstation-3-80-
Go)
. . .
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go)
nom(http ://www.amazon.fr/Console-Playstation-3-80-Go,Playstation 3)
prix(http ://www.amazon.fr/Console-Playstation-3-80-Go,450)
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 79 / 103
DL-lite
1
Semantique des Aboxes de DL-lite
R
La semantique dune Abox est denie en termes dinterpretations logiques.
Pour cela, on etend la notion dinterpretation I =
I
, .
I
de concepts et
roles atomiques aux constantes, en assignant `a chaque constante a un
objet distinct dans
I
: a
I

I
.
Attention ! ! !
En DL-lite
R
, on fait lhypoth`ese du nom unique sur les constantes.
Semantique dune assertion et dune Abox de DL-lite
R
Une interpretation I =
I
, .
I
dun ensemble de concepts et roles
atomiques est :
un mod`ele dune assertion A(a) ssi a
I
A
I
;
un mod`ele dune assertion P(a, b) ssi (a
I
, b
I
) P
I
;
un mod`ele dune Abox / ssi I satisfait toutes les assertions de /.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 80 / 103
DL-lite
1
Syntaxe et semantique des bases de connaissances de DL-lite
R
Une base de connaissances / de DL-lite
R
est un couple T , /, o` u T
est une Tbox de DL-lite
R
et / est une Abox de DL-lite
R
.
La semantique dune base de connaissances / = T , / est donnee en
termes dinterpretations.
Semantique dune base de connaissances de DL-lite
R
Une interpretation I est un mod`ele de / ssi I est `a la fois un mod`ele
de T et de /.
Une base de connaissances / est satisable ssi elle a un mod`ele.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 81 / 103
DL-lite
1
Syntaxe et semantique des bases de connaissances de DL-lite
R
Une base de connaissances est la donnee explicite de contraintes
dinclusion (Tbox) et dassertions de faits (Abox). Or de ces connaissances
explicites, on peut deduire de nouvelles connaissances implicites `a la base
de connaissances : les inclusions et assertions logiquement impliquees par
la base de connaissances.
Inclusions et assertions impliquees par une base de connaissances
Une inclusion (PI ou NI) est impliquee par une base de
connaissances / = T , /, notee / [= , ssi T [= .
Une assertion est impliquee par une base de connaissances
/ = T , /, notee / [= , ssi tout mod`ele de / est un mod`ele de .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 82 / 103
DL-lite
1
Syntaxe et semantique des bases de connaissances de DL-lite
R
Assertions impliquees par une base de connaissances de DL-lite
R
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
A = { Pbd dvd(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition)
nom(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,Le fabuleux destin dAmelie Poulain)


prix(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,9.98)
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-Playstation-3-80-
Go)
. . .
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go)
nom(http ://www.amazon.fr/Console-Playstation-3-80-Go,Playstation 3)
prix(http ://www.amazon.fr/Console-Playstation-3-80-Go,450)
. . . }
K |= Plect bd dvd(http : //www.amazon.fr /Console Playstation 3 80 Go)
K |= Texte(Playstation3)
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 83 / 103
DL-lite
1
Probl`emes lies `a la gestion de donnees en DL-lite
R
: consistance
En DL-lite
R
, la gestion de donnees seectue relativement `a une base de
connaissances / = T , /. Pour cela, T doit etre satisable. Cest
toujours le cas en DL-lite
R
.
En revanche, une base de connaissances peut etre insatisable, on dit aussi
inconsistante (en gestion de donnees).
Probl`eme de consistance dune base de connaissances
Est-ce que la Abox dune base de connaissances satisfait les contraintes de
la Tbox ?
Cest-`a-dire, formellement, est-ce que la base de connaissances est
satisable.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 84 / 103
DL-lite
1
Probl`emes lies `a la gestion de donnees en DL-lite
R
: consistance
Base de connaissances inconsistante
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
A = { Pbd dvd(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition)
nom(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,Le fabuleux destin dAmelie Poulain)


prix(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,9.98)
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-Playstation-3-80-
Go)
. . .
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go)
nom(http ://www.amazon.fr/Console-Playstation-3-80-Go,Playstation 3)
prix(http ://www.amazon.fr/Console-Playstation-3-80-Go,450) . . . }
K |= Pconsole(http : //www.amazon.fr /Console Playstation 3 80 Go)
K |= Plect bd dvd(http : //www.amazon.fr /Console Playstation 3 80 Go)
K |= Plect bd dvd Pconsole K est inconsistante !
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 85 / 103
DL-lite
1
Probl`emes lies `a la gestion de donnees en DL-lite
R
: repondre `a une requete
Rappel sur les requetes et levaluation de requetes.
Requetes du premier ordre
Une requete est une formule ( x) de la logique du premier ordre, o` u x est
lensemble (potentiellement vide) des variables libres de .
Larite dune requete est la cardinalite de x, par ex. lorsque x = , la
requete est booleenne.
Langages de requetes pour la gestion de donnees
Pour des raisons deectivite et decacite (decidabilite/complexite), on
limite la puissance des langages de requetes en recherchant un bon
compromis entre expressivite des requetes et ecacite de leur evaluation.
En base de donnees en general, et dans ce cours en particulier, nous
considerons le langage (dunion) de requetes conjonctives, permettant
dexprimer (lunion,) la selection, la projection et la jointure.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 86 / 103
DL-lite
1
Probl`emes lies `a la gestion de donnees en DL-lite
R
: repondre `a une requete
Union de requetes conjonctives
Une union de requetes conjonctives Q se note Q :

n
i =1
q
i
( x), o` u chaque
requete conjonctive q
i
est une conjonction datomes dont les seules
variables sont celles de x et des variables existentielles.
Ici, les requetes sont posees sur une base de connaissances de DL-lite
R
,
c`ad que les relations utilisees dans les requetes sont des concepts et des
roles atomiques.
Attention ! ! !
Seuls des concepts et roles atomiques sont utilises dans les requetes sur
une base de connaissances de DL-lite
R
.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 87 / 103
DL-lite
1
Probl`emes lies `a la gestion de donnees en DL-lite
R
: repondre `a une requete
Semantique/evaluation dune requete
La reponse `a une requete Q : ( x) darite n 1 posee sur une base de
connaissances / = T , / est ans(Q, /) =

t (
n
[ / [= ( x)
[ x

t]
et (
est lensemble des constantes de /.
Par convention, lorsque la requete est booleenne Q : ( x)
ans(Q, /) = () si / [= (), o` u () est le tuple vide, et
ans(Q, /) = sinon.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 88 / 103
DL-lite
1
Probl`emes lies `a la gestion de donnees en DL-lite
R
: repondre `a une requete
Interrogation semantique de donnees en termes dune base de
connaissances DL-lite
R
Quels sont les noms et references des produits hi `a moins de 500 euros ?
Q : [php]Phi(ph) nom(ph, n) ref (ph, r ) prix(ph, p) p 500
n=Playstation 3 et r=B00005R6XJ
n=Philips - 32PFL5403D/12 et r=B001ANOX7C
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 89 / 103
Algorithmes de gestions de donnees
Test de consistance dune base de connaissances de DL-lite
R
Idee de lalgorithme : pour une base de connaissances de DL-lite
R
, on
va tester si tout couple de relations devant etre disjointes au niveau de la
Tbox ont eectivement des instances disjointes dans la Abox. Pour cela, on
va calculer toutes les NI impliquees de la Tbox et les verier dans la Abox !
Cl oture des NI (= calcul des NI impliquees) dune Tbox de DL-lite
R
Soit T une Tbox de DL-lite
R
. La cloture des NI de T , notee cln(T ), est
denie inductivement comme suit :
1
Toutes les NI de T sont aussi dans cln(T ).
2
Si B
1
B
2
T et B
2
B
3
cln(T ) (ou B
3
B
2
cln(T ))
alors B
1
B
3
cln(T ).
3
Si R
1
R
2
T et R
2
B cln(T ) (ou B R
2
cln(T ))
alors R
1
B cln(T ).
4
Si R
1
R
2
T et R

2
B cln(T ) (ou B R

2
cln(T ))
alors R

1
B cln(T ).
5
Si R
1
R
2
T et R
2
R
3
cln(T ) (ou R
3
R
2
cln(T ))
alors R
1
R
3
cln(T ).
6
Si R R cln(T ) ou R

cln(T ) ou R R cln(T )
alors ces trois NI sont dans cln(T ).
Fran cois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 90 / 103
Algorithmes de gestions de donnees
Test de consistance dune base de connaissances de DL-lite
R
Maintenant que nous avons les NI impliquees par la Tbox une base de
connaissances, il faut verier si celles-ci sont satisfaites par la Abox.
Pour cela, on va verier que la Abox ne fournit pas de contre-exemples `a
(au moins) une NI, en evaluant leurs traductions sur la Abox.
Traduction dune NI
La traduction dune NI est denie par :
(B
1
_ B
2
) = x
1
(x)
2
(x) tel que


i
(x) = A
i
(x) si B
i
= A
i


i
(x) = y
i
P
i
(x, y
i
) if B
i
= P
i


i
(x) = y
i
P
i
(y
i
, x) if B
i
= P

i
(R
1
_ R
2
) = x, y
1
(x, y)
2
(x, y) tel que


i
(x, y) = P
i
(x, y) if R
i
= P
i


i
(x, y) = P
i
(y, x) if R
i
= P

i
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 91 / 103
Algorithmes de gestions de donnees
Test de consistance dune base de connaissances de DL-lite
R
Lalgorithme ci-contre eectue le test
de consistance dun base de connais-
sances / = T , /. Pour cela,
1
il construit une union (booleenne) de
requetes conjonctives q
unsat
initialisee `a
faux (),
2
puis q
unsat
est etendue an de modeliser
la recherche d(au moins) un
contre-exemple `a une NI impliquee de T ,
3
enn si q
unsat
ne produit pas un
contre-exemple `a lune des NI impliquee
lorsquelle est evaluee sur A alors K est
consistante, et inconsistantes sinon.
Propriete de lalgorithme Consistent
Lalgorithme Consistent est correct, c`ad / est consistante ssi
Consistent(/) retourne true.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 92 / 103
Algorithmes de gestions de donnees
Test de consistance dune base de connaissances de DL-lite
R
Base de connaissances inconsistante
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
q
unsat
= (Phi Pcult) (Ptv Pcult) (Plect bd dvd Pcult) (compatible

Pcult)
(Pconsole Phi) (Pbd dvd Phi) (compatible Phi) (Pconsole compatible

)
q
unsat
=
x(Phi(x) Pcult(x)) x(Ptv(x) Pcult(x)) x(Plect bd dvd(x) Pcult(x)) x(y compatible(y, x) Pcult(x))
x(Pconsole(x) Phi(x)) x(Pbd dvd(x) Phi(x)) x(y compatible(x, y) Phi(x))
x(Pconsole(x) y compatible(y, x))
Sur lexemple utilise jusqu`a present dans ce cours, on a :
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-
Playstation-3-80-Go) A
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go) A
Donc x(Pconsole(x) y compatible(y, x)) est vrai dans A, do` u q
db(A)
unsat
= {()}, donc Consistent(K) = false.
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 93 / 103
Algorithmes de gestions de donnees
Reformulation de requetes posees sur une base de connaissances de DL-lite
R
Idee de lalgorithme de reponse `a une requete : le but est de
reformuler une requete posee par un utilisateur sur une base de
connaissances, de fa con `a extraire toutes les informations pertinentes de la
Abox relativement aux PI de la Tbox.
Reformulation de requetes relativement `a une base de connaissances
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
Si un utilisateur pose la requete Q : Phi(x) nom(x, y) prix(x, z), la requete devant etre evaluee sur la Abox est
Q

: (Phi(x) nom(x, y) prix(x, z)) (Ptv(x) nom(x, y) prix(x, z)) (Plect bd dvd(x) nom(x, y) prix(x, z))
(t compatible(t, x) nom(x, y) prix(x, z))
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 94 / 103
Algorithmes de gestions de donnees
Reformulation de requetes posees sur une base de connaissances de DL-lite
R
Pour reformuler une requete posee par un utilisateur, on denit la notion de PI applicable `a un
atome dune requete. Une PI I est applicable `a un atome A(x) dune requete si I a A dans sa
partie droite et I est applicable `a un atome P(x
1
, x
2
) si (i ) x
2
= et P est en partie droite de
I ; ou x
1
= et P

est en partie droite de I ; ou I a soit P soit P

en partie droite. est une


variable existentielle sur laquelle il ny a pas de jointure.
Application dune PI `a un atome
Soit I une PI applicable `a un atome g. Le resultat de lapplication de I `a g, note gr (g, I ), est latome deni comme suit :
si g = A(x) et I = A
1
A, alors gr (g, I ) = A
1
(x)
si g = A(x) et I = P A, alors gr (g, I ) = P(x, )
si g = A(x) et I = P

A, alors gr (g, I ) = P( , x)
si g = P(x, ) et I = A P, alors gr (g, I ) = A(x)
si g = P(x, ) et I = P
1
P, alors gr (g, I ) = P
1
(x, )
si g = P(x, ) et I = P

1
P, alors gr (g, I ) = P
1
( , x)
si g = P( , x) et I = A P

, alors gr (g, I ) = A(x)


si g = P( , x) et I = P
1
P

, alors gr (g, I ) = P
1
(x, )
si g = P( , x) et I = P

1
P

, alors gr (g, I ) = P
1
( , x)
si g = P(x
1
, x
2
) et soit I = P
1
P ou I = P

1
P

alors gr (g, I ) = P
1
(x
1
, x
2
)
si g = P(x
1
, x
2
) et soit I = P
1
P

ou I = P

1
P alors gr (g, I ) = P
1
(x
2
, x
1
)
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 95 / 103
Algorithmes de gestions de donnees
Reformulation de requetes posees sur une base de connaissances de DL-lite
R
Pour reformuler une requete, PerfectRef eectue
jusqu`a trouver un point xe
1
lapplication, de facon iterative, de toutes
les PI aux reformulations en cours de
construction (boucle (a)).
2
La simplication des reformulations
produites (boucle (b)) de sorte que des PI
qui netaient pas applicables `a certaines
reformulations le deviennent.
remplace les variables existentielles sur les-
quelles il ny a pas de jointure par .
reduce remplace deux atomes uniables par leur
plus grand unicateur commun.
Propriete de lalgorithme PerfectRef
Soit q une requete conjonctive posee relativement `a une Tbox T de
DL-lite
R
: q
T
PerfectRef (q, T ).
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 96 / 103
Algorithmes de gestions de donnees
Reformulation de requetes posees sur une base de connaissances de DL-lite
R
Reformulation de requetes relativement `a une base de connaissances
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
Si un utilisateur pose la requete Q : Phi(x) nom(x, y) prix(x, z), alors
PerfectRef (Q, T ) = {Phi(x) nom(x, y) prix(x, z),
Ptv(x) nom(x, y) prix(x, z), Plect bd dvd(x) nom(x, y) prix(x, z),

compatible( , x) nom(x, y) prix(x, z)

}
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 97 / 103
Algorithmes de gestions de donnees
Reformulation de requetes posees sur une base de connaissances de DL-lite
R
Reformulation de requetes relativement `a une base de connaissances
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
Si un utilisateur pose la requete Q : y Plect bd dvd(x) compatible(y, x) Pcult(y), alors PerfectRef (Q, T ) = {
y Plect bd dvd(x) compatible(y, x) Pcult(y),
y compatible( , x) compatible(y, x) Pcult(y), y Plect bd dvd(x) compatible(y, x) Pconsole(y),
y Plect bd dvd(x) compatible(y, x) Pbd dvd(y),
y compatible(y, x) Pcult(y),
y compatible( , x) compatible(y, x) Pconsole(y), y compatible( , x) compatible(y, x) Pbd dvd(y),
y Plect bd dvd(x) compatible(y, x) compatible(y, ), y compatible(y, x) Pconsole(y),
y compatible(y, x) Pbd dvd(y),
Plect bd dvd(x) compatible( , x),
y compatible( , x) compatible(y, x) compatible(y, ), y compatible(y, x) compatible(y, ),
compatible( , x) compatible( , x),
y compatible( , x) compatible(y, x), y compatible(y, x) compatible(y, x), compatible( , x),

}
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 98 / 103
Algorithmes de gestions de donnees
Repondre `a une requete posee sur une base de connaissances de DL-lite
R
Repondre `a une requete posee sur une base de connaissances se fait
maintenant en utilisant Consistent et PerfectRef .
Pour cela, Answer teste avec
Consistent si / est inconsistante
1
si cest le cas, tout les tuples de larite de
Q sont retournes (Alltup(Q, K)),
2
sinon les tuples resultant de levaluation
de lunion des requetes conjonctives
renvoyees par PerfectRef sont retournes.
Propriete de lalgorithme Answer
Soit Q une union de requetes conjonctives posee relativement `a une base
de connaissances / = T , / de DL-lite
R
: ans(Q, /) = Answer (Q, /).
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 99 / 103
Algorithmes de gestions de donnees
Repondre `a une requete posee sur une base de connaissances de DL-lite
R
Requetes sur une base de connaissances inconsistante
T = {Pcult Pprod Phi Pprod
Phi Pcult
nom Pprod nom

Texte
Pprod nom
ref Pprod ref

Texte
Pprod ref
prix Pprod prix

Texte
Pprod prix
Pconsole Pcult Plect bd dvd Phi
Pbd dvd Pcult Ptv Phi
compatible Pbd dvd compatible

Plect bd dvd}
q
unsat
= (Phi Pcult) (Ptv Pcult) (Plect bd dvd Pcult) (compatible

Pcult)
(Pconsole Phi) (Pbd dvd Phi) (compatible Phi) (Pconsole compatible

)
q
unsat
=
x(Phi(x) Pcult(x)) x(Ptv(x) Pcult(x)) x(Plect bd dvd(x) Pcult(x)) x(y compatible(y, x) Pcult(x))
x(Pconsole(x) Phi(x)) x(Pbd dvd(x) Phi(x)) x(y compatible(x, y) Phi(x))
x(Pconsole(x) y compatible(y, x))
Sur lexemple utilise jusqu`a present dans ce cours, on a :
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-
Playstation-3-80-Go) A
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go) A
Donc x(Pconsole(x) y compatible(y, x)) est vrai dans A, do` u q
db(A)
unsat
= {()}, donc Consistent(K) = false.
Par consequent, pour toute requete Q sur cette base de connaissances, Answer retourne Alltup(Q, K) !
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 100 / 103
Algorithmes de gestions de donnees
Repondre `a une requete posee sur une base de connaissances de DL-lite
R
Indexation (consistante) de pages Web en termes de lontologie
Pbd dvd(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition)
nom(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,Le fabuleux destin dAmelie Poulain)


prix(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,9.98)
compatible(http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition,http ://www.amazon.fr/Console-Playstation-3-80-Go)
. . .
Pconsole(http ://www.amazon.fr/Console-Playstation-3-80-Go)
nom(http ://www.amazon.fr/Console-Playstation-3-80-Go,Playstation 3)
prix(http ://www.amazon.fr/Console-Playstation-3-80-Go,450)
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 101 / 103
Algorithmes de gestions de donnees
Repondre `a une requete posee sur une base de connaissances de DL-lite
R
Interrogation semantique de donnees en termes de lontologie
Quels sont les DVD/Blu-ray `a moins de 20 euros compatibles avec la
PS3 ? Q(d) : bd dvd(d) prix(d, p) p 20 compatible(d, l ) nom(l , Playstation 3)
d=http ://www.amazon.fr/Fabuleux-destin-dAmelie-Poulain-

Edition
d=http ://www.amazon.fr/Harry-potter-lecole-sorciers-Blu-ray
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 102 / 103
Algorithmes de gestions de donnees
Repondre `a une requete posee sur une base de connaissances de DL-lite
R
Interrogation semantique de donnees en termes de lontologie
Quels sont les noms et references des produits hi `a moins de 500 euros ?
Q(n, r ) : Phi(ph) nom(ph, n) ref (ph, r ) prix(ph, p) p 500
n=Playstation 3 et r=B00005R6XJ
n=Philips - 32PFL5403D/12 et r=B001ANOX7C
. . .
Francois Goasdoue (Univ. Paris-Sud) Web Semantique 24 avril 2013 103 / 103

Vous aimerez peut-être aussi