0% ont trouvé ce document utile (0 vote)
27 vues14 pages

2 Cours RDF BE 4P

Le document présente une introduction au RDF (Resource Description Framework), un modèle de données pour représenter les métadonnées sur le Web. Il aborde les concepts fondamentaux de RDF, les différentes sérialisations, ainsi que les agrégations et la sémantique associée. Des exemples illustrent l'utilisation des triplets (sujet, prédicat, objet) et des nœuds blancs pour modéliser des informations.

Transféré par

Hëníntsøa Rakøtø
Copyright
© © All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
27 vues14 pages

2 Cours RDF BE 4P

Le document présente une introduction au RDF (Resource Description Framework), un modèle de données pour représenter les métadonnées sur le Web. Il aborde les concepts fondamentaux de RDF, les différentes sérialisations, ainsi que les agrégations et la sémantique associée. Des exemples illustrent l'utilisation des triplets (sujet, prédicat, objet) et des nœuds blancs pour modéliser des informations.

Transféré par

Hëníntsøa Rakøtø
Copyright
© © All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd

Références

§ Livres, articles et rapports :


Introduction à RDF § O. Corby and F. Gandon and C. Faron-Zucker, Le Web sémantique : comment
(Resource Description Framework) lier les données et les schémas sur le web ? Dunod, 2012.
§ G. Antoniou, Van Harmelen F., A Semantic Web Primer, The MIT Press
Cambridge, Massachusetts London, England, 1999.
§ John Hebeler and Matthew Fisher and Ryan Blace and Andrew Perez-Lopez
Bernard ESPINASSE and Mike Dean, Semantic Web Programming, Wiley, 2009.
§ Web W3C :
Aix-Marseille Université § Page du W3C : http://www.w3.org/2004/OWL/
LIS UMR CNRS 7020
§ Référence : http://www.w3.org/TR/owl-ref/
Septembre 2019
§ Guide : http://www.w3.org/TR/owl-guide/
§…
§ Cours/tutoriaux :
• Introduction à RDF § Cours de M. Gagnon, Ecole Polytechnique de Montréal, 2007.
• Sérialisation § Cours de S. Staab, ISWeb – « Semantic Web », Univ. de Koblenz-Landau.
§ Cours de A.-C. Caron, Université de Lille, 2015.
• Agrégations : Container et collections § Cours de O. Papini, Aix-Marseille Université, 2014.
• Sémantique, inférences et vocabulaire § Cours de I-M. Bilasco, Université de Lille, 2018.
§…

Introduction à RDF - Bernard ESPINASSE - 1 Introduction à RDF - Bernard ESPINASSE - 2

Plan
§ 1. Introduction à RDF
§ Vers un Web plus structuré
§ Un modèle pour représenter les métadonnées
§ Graphe RDF
§ Identification des entités/ressources – IRI
§ Littéraux et nœuds blancs
§ 2. Sérialisations RDF
§ Sérialisation RDF/XML
§ Sérialisation N-Triples
§ Sérialisation Turtle
§ 3. Agrégations en RDF 1. Introduction à RDF
§ Collections
§ Containers § Vers un Web plus structuré
§ 4. Conclusion § Un modèle pour représenter les métadonnées
§ Sémantique de RDF
§ Inférences dans RDF
§ Graphe RDF
§ Vocabulaire RDF § Identification des entités/ressources – IRI
§ Langages de requête autour de RDF : SPARQL § Littéraux et nœuds blancs
§ Intérêts et limitations de RDF
§ 5. Exemple de base RDF

Introduction à RDF - Bernard ESPINASSE - 3 Introduction à RDF - Bernard ESPINASSE - 4


Vers un Web plus structuré Place de RDF dans le gâteau du WS …

§ Objectif général :

§ Rendre explicites les relations sémantiques qui existent


entre les différentes ressources qui constituent le Web

§ Définir un mécanisme pour décrire ces ressources par


des descripteurs sémantiques (métadonnées) :

§ Pour faciliter l’échange et le traitement automatique de


l’information sans faire d’hypothèses sur un domaine
particulier d’application

ð Objectif de RDF (Ressource Description


Source : W3C, T Berners-Lee, Ivan Herman
Framework)

Introduction à RDF - Bernard ESPINASSE - 5 Introduction à RDF - Bernard ESPINASSE - 6

Introduction à RDF Un modèle pour représenter les métadonnées


§ 3 concepts de base :
§ RDF pour Ressource Description Framework
§ Base du « Web des Données » § Ressource (subject – Sujet) à décrire (ressource Web ou objet du
§ Proposé par W3C (World Wide Web Consortium) : RDF 1 (2004), RDF 1.1 monde réel)
(2014) • Page Web, fragment de page, image, vidéo, tout ce qui a une
URI
Objectif de RDF : attacher à une ressource un ensemble de
propriétés (métadonnées) qui la caractérise au mieux et les partager § Propriété (predicate - Prédicat)
• une caractéristique, un attribut, ou
§ Pour cela RDF propose : • une relation spécifique entre ressources
§ un modèle de données standardisé
§ des formats d'échanges de données (N3, Turtle, N-Triples, …) § Valeur (object - Objet) de la propriété (ressources ou littéraux)
§ Documents de références W3C (https://www.w3.org/standards/techs/rdf#w3c_all) :
§ Un modèle de triplets (R, P, V)
§ RDF Schema 1.1 (2014) : connaissances de base du RDF § Une déclaration RDF est un triplet (R, P, V) :
§ Concepts and abstract syntax (2014) : syntaxe abstraite définissant le RDF
§ Semantics (2004) : Interprétation logique du RDF « la ressource R a la valeur V pour la propriété P »
§ A Datatype for RDF Plain Literals (2012) : Définition d’un type de donnée pour les chaînes de
caractères (langue, taille, etc.)
§ Linked Data Platform 1.0 (2015) : recommandations et bonnes pratiques pour utiliser le RDF
P
(comment nommer les URI, comment répondre à des requête HTTP, etc.) R V
§ Divers documents sur les différents formats de sérialisation (2014) : XML, Turtle, N-Triples, N-Quads,
Grids, …
§ Un graphe RDF est un ensemble de déclarations RDF

Introduction à RDF - Bernard ESPINASSE - 7 Introduction à RDF - Bernard ESPINASSE - 8


Exemple 1 Exemple 2
§ Une description c’est un ensemble de déclarations relatives à une même § Dans une description, une valeur peut être :
ressource : § une valeur littérale (rectangle) : une chaîne de caractères ou
Ressource (sujet ) - Propriété (prédicat) - Objet (valeur) § une autre ressource (un cercle) pouvant être décrit par des littéraux
Titre
Index.html Web sémantique Créateur
page.html

Titre Nom Email


Auteur
Bernard Espinasse
Bernard home page Bernard Espinasse [email protected]
(index.html , Titre, ‘Web sémantique’ )
(index.html , Auteur, ‘Bernard Espinasse’ ) Ici la personne dont le nom Bernard Espinasse, l’email [email protected]
est le créateur de la page page.html dont le titre est Bernard home page
§ Ainsi la valeur de la propriété Créateur est structurée, on la représente
§ La ressource index.html a comme valeur pour la propriété titre ‘Web comme une ressource
sémantique’
§ De façon générale on dira qu’un triplet est de la forme :
§ La ressource index.html a comme valeur pour la propriété auteur ‘Bernard
Espinasse’ (Sujet, Prédicat, Objet)

Introduction à RDF - Bernard ESPINASSE - 9 Introduction à RDF - Bernard ESPINASSE - 10

Graphe RDF Graphe RDF et base de données RDF


§ Les (méta)données sont représentées sous forme de graphe orienté § Un graphe RDF est un ensemble de triplets (Sujet, Prédicat, Objet) :
§ Un graphe RDF est un ensemble de triplets (Sujet, Prédicat, Objet) dans § le Sujet est une entité représentée par un identifiant,
lequel :
§ le Prédicat est une propriété de l’entité,
§ Sujets et Objets = nœuds
§ Prédicats = arcs § l’Objet est la valeur de la propriété pour ce sujet : cela peut être une
entité ou un littéral.
§ Les nœuds et arcs sont identifiés par des URI (Uniform Resource Identifier)
§ Attention !
§ Les nœuds peuvent aussi être :
- des nombres réels - RDF n'est pas une base de données, c'est un format.
- des chaines de caractères - Les données RDF peuvent être stockées dans des BD orientées graphe
- des dates ou converties vers des BD relationnelles.
- …
§ Remarques :
§ Quelques problèmes à résoudre dans les graphes RDF :
- Un document RDF qui décrit plusieurs graphes est appelé un Dataset
- Comment gérer les identifiants à l’échelle du Web ?
- Comment savoir ce que représente une valeur, c’est-à-dire son type, l’unité, la - Une base de données capable de gérer des données RDF = triple store.
langue, ... ?
- Comment savoir quelles propriétés (quels prédicats) utiliser ?
- Comment publier, échanger, interroger les données ?

Introduction à RDF - Bernard ESPINASSE - 11 Introduction à RDF - Bernard ESPINASSE - 12


I En RDF, les entités sont appelées également ressources, chacune est
identifiée par un IRI - International Resource Identifier, chaı̂ne de
caractères Unicode.
Identification des entités/ressources : IRI Les littéraux
I
§Allocation
En RDF, lesd’IRI
entités: sont
c’estappelées
le processus
égalementd’association d’un IRI
ressources, chacune estàidentifiée
une ressource § Les noeuds du graphe sont en général des entités, identifiées par des IRIs
que
par l’on
un IRIappelle son référent.
- International ResourceIlIdentifier
faut éviter absolument
(chaine lesUnicode)
de caractères collisions d’IRI, § Parfois le nœud à l’extrémité d’un arc est une simple valeur (un nombre, une date,
§i.e. un même
Allocation d’IRI IRI avec deux
: processus référents.
d’association d’un IRI à une ressource que l’on appelle ...), dans ce cas on utilise des littéraux.
son référent
I Une bonne manière d’expliquer quel est le référent d’un IRI est de fournir § Un littéral consiste en 2 ou 3 éléments :
§ Eviter qu’un même IRI ait 2 référents
une représentation de ce référent sous la forme d’un document Web, § 1. une forme lexicale : une chaine de caractères Unicode.
§ Référent d’un IRI fournit une représentation de ce référent sous la forme d’un
auquel
documenton Web,
accède en on
auquel interprétant l’IRI comme
accède en interprétant un URL.
l’IRI comme un URL On(IRI
parle d’IRI § 2. un IRI pour le type de données : cela permet de savoir comment
déréférençable.
déréférençable) interpréter la chaine de caractère.
§ 3. Quand le type de données est rdf:langString on associe un tag de langage
au littéral
§ Si on ne donne pas d’IRI de typage, alors le type par défaut est xsd:string, sauf s’il y
a un tag de langage (le type est alors rdf:langString).
§ Exemple :
"1990-07-04"^^xsd:date
"La Joconde"@fr
§ Une fois interprétés, ces éléments permettent d’associer une valeur à la forme
syntaxique du littéral

Introduction à RDF - Bernard ESPINASSE - 13


Autre utilisation des noeuds vides
Introduction à RDF - Bernard ESPINASSE - 14

RDF
Le modèle de données

8 / 24
Nœuds blancs (1) Nœuds blancs (2)
rdf §:Les
etentités
si la(IRIs)
ressource n’a pas d’uri ?
Noeuds§ Ilblancs et les littéraux sont suffisant pour décrire un graphe RDF Les noeuds
Lesvides
noeudssont
videségalement
ou nœud blancutilisées pourutilisés
sont également grouper des informations
pour grouper des
se peut que l’on ne dispose pas d’IRI pour la ressource dont on souhaite parler. Par informations, correspondant à l’expression d’une relation n-aire
Il se peut que dans
exemple, l’onles
neréseaux
dispose pasond’uri
sociaux, pourpaslad’IRI
ne dispose ressource dont on souhaitecomme dans l’exemple ci-dessous
pour les membres.
I §Les
parler. Parentités
On crée alors (IRIs)
exemple, un noeud
dansetblanc
les
les littéraux sontnoeud
(ou noeud vide,
réseaux suffisants
sociaux, anonyme,pour
“blankdécrire
on ne dispose node”). un
pas d’uri Exemple : utilisation d’un nœud blanc pour modéliser une adresse
§graphe
Ces noeudsRDF, mais
blancs parfois
peuvent il
être vus peut
commeêtre pratique
des variables d’utiliser des noeuds
pour les membres.
Parfois le nœud à
On crée d’un
l’extrémité
alorsarc
un
est
noeud
une
vide
simple
(noeud
valeur (un
blanc,
nombre, une
noeud
date, ...),
qui ne sont pas référencés globalement : on les appelle des noeuds
anonyme, “blank node”). on utilise alors des littéraux.
blancs.
Exemple : Utilisation de nœuds blancs dans un réseau social :
I Ces noeuds blancs peuvent être vus comme des variables

Une personne de nom Toby Segaran auteur du blog kiwitobes connait une personne nommée
Jamie Taylor dont l’email est [email protected]

Une personne
Introduction à RDF -de nom
Bernard Toby
ESPINASSE - Segaran auteur du blog kiwitobes connaı̂t
15 une Introduction à RDF - Bernard ESPINASSE - 16

personne nommée Jamie Taylor dont l’email est [email protected]


Réification (1) Réification (2)
§ En informatique, la réification = transformer un concept en un objet Graphe RDF :
informatique
Titre
§ Par exemple : avec un langage orienté objet avec mécanisme de réflexion, on Livre Le Web sémantique
peut réifier une classe, qui devient instance d’une (méta-)classe.
§ En RDF, la réification permet de considérer un triplet comme un noeud. Attribué

§ Exemple en RDF : Fabien

§ Soit le graphe G1 :
<ex:un_sujet> <ex:une_propriete> <ex:un_objet> .
Triplés associés :
§ Le graphe G2 ci-dessous est une réification de G1 :
• Triplet 1 : (#declaration, rdf:subjet, Livre)
_:xxx rdf:type rdf:Statement . • Triplet 2 : (#declaration, rdf:predicate, Titre)
• Triplet 3 : (#declaration, rdf:objet, "Le Web sémantique")
_:xxx rdf:subject <ex:un_sujet> . • Triplet 4 : (#declaration, Attribué, #Fabien)
_:xxx rdf:predicate <ex:une_propriete> . • Triplet 5 : (#declaration, rdf:type, rdf:statement)

_:xxx rdf:object <ex:un_objet> .

Introduction à RDF - Bernard ESPINASSE - 17 Introduction à RDF - Bernard ESPINASSE - 18

Datatypes RDF (1) Datatypes RDF (2)


§ Les littéraux standards sont des chaînes de caractères § Chaque littéral porte son datatype :
<!ENTITY xsd ”http://www.w3.org/2001/XMLSchema#” >
§ Pour typer les valeurs litérales, RDF repose sur les datatypes de XML
<c:Person>
Schema (xmlns:xsd=‘http://www.w3.org/2001/XMLSchema#’)
<c:age rdf:datatype=‘&xsd;integer’>43 </c:age>
§ Ces datatypes sont : </c:Person>
§ xsd:integer § Notation en triplet :
c:id1 c:age “43”^^xsd:integer
§ xsd:float
§ Exemple :
§ xsd:string <!ENTITY xsd ”http://www.w3.org/2001/XMLSchema#” >
§ xsd:dateTime <c:Person>
§ xsd:boolean <c:age rdf:datatype=‘&xsd;integer’>43 </c:age>
<c:date rdf:datatype=‘&xsd;dateTime’>2004-01-05 </c:date>
§ rdf:XMLLiteral rdfs:Literal
<c:name rdf:datatype=‘&xsd;string’>Laurent </c:name>
</c:Person>
§ Remarque :
“Bernard” ⇔ “Bernard”^^xsd:string

Introduction à RDF - Bernard ESPINASSE - 19 Introduction à RDF - Bernard ESPINASSE - 20


RDF
sérialisation

11 / 24

Sérialisation de RDF (1)


Sérialisation
§ Pour échanger des données,
Pour échanger on a on
des données, besoin de sérialiser. Il existe de
de sérialiser
a besoin
§ Il existenombreux formats
de nombreux de sérialisation.
formats de sérialisation :

2. Sérialisations RDF
§ Sérialisation RDF/XML
§ Sérialisation N-Triples Les plus connus :
• RDF/XML
§ Sérialisation Turtle • N-Triples
• Turtle
On peut passer de l’un à l’autre (http://www.easyrdf.org/converter )

Introduction à RDF - Bernard ESPINASSE - 21 Introduction à RDF - Bernard ESPINASSE - 22

Sérialisation de RDF (2) Sérialisation RDF/XML


Les plus connues : Exemple : Le cours LIS125 est assuré par un professeur dont la page web est http://www.lis-amu.fr/~espinasse
• RDF/XML et le nom est bernard espinasse
§ norme RDF/XML : syntaxe XML pour représenter un graphe RDF <?xml version="1.0" encoding="UTF-8"?>
§ élément Description pour décrire une ressource attribut about pour le sujet, <!DOCTYPE rdf:RDF [
<!ENTITY udem "http://www.univ-amu.fr/">
§ sous-élément pour la propriété, contenu du sous-élément pour la propriété (qui peut ]>
être parfois simplifié en attribut) <?oxygen RNGSchema="rdfxml.rnc" type="compact"?>
§ on peut regrouper dans un même élément Description toutes les propriétés dont <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
cette ressource est sujet. xmlns:foaf="http://xmlns.com/foaf/0.1/"
Ø Difficile à lire par un humain, réservé à la machine xmlns:udem="&udem;">
<!-- Description graphe RDF -->
• N-Triples <rdf:Description rdf:about="&udem;cours/LIS125">
§ sérialisation sous forme de triplets <udem:professeur>
<rdf:Description>
§ chaque triplet est écrit sous la forme : <foaf:homepage>
<IRI du sujet> <IRI du prédicat> <IRI de l’objet ou littéral> <rdf:Description rdf:about="http://www.lis.amu.fr/~espinasse"/>
Ex : <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> </foaf:homepage>
</rdf:Description>
Ø Plus facile à lire par un humain, </udem:professeur>
• Turtle (Terse RDF Triple Language) </rdf:Description>
<rdf:Description rdf:about="&udem;cours/LIS125">
§ dérivé de N-Triples, plus concis, avec des facilités syntaxiques pour rendre le code <udem:professeur>
plus lisible <rdf:Description>
<foaf:name>bernard espinasse</foaf:name>
Ø Plus concis, plus facile encore à lire par un humain </rdf:Description>
</udem:professeur>
• TriG </rdf:Description>
§ Extension de Turtle pour utiliser plusieurs graphes </rdf:RDF>

Introduction à RDF - Bernard ESPINASSE - 23 Introduction à RDF - Bernard ESPINASSE - 24


Sérialisation : Triplés et Graphe RDF Sérialisation N-Triple
Exemple : Le cours LIS125 est assuré par un professeur dont la page web est http://www.lis-amu.fr/~espinasse Utilisation de l’outil Easyrdf (http://www.easyrdf.org/converter ):
et le nom est bernard espinasse
<http://www.univ-amu.fr/cours/LIS125> <http://www.univ-amu.fr/professeur> _:genid1 .
Triplets (utilisation de l’outil Validator : https://www.w3.org/RDF/Validator/rdfval ):
<http://www.univ-amu.fr/cours/LIS125> http://www.univ-amu.fr/professeur _:genid2 .
Number Subject Predicate Object
_:genid1 <http://xmlns.com/foaf/0.1/homepage> <http://www.lis.amu.fr/~espinasse> .
http://www.univ-
1 http://www.univ-amu.fr/professeur genid:A62359
amu.fr/cours/LIS125 _:genid2 <http://xmlns.com/foaf/0.1/name> "bernard espinasse" .
2 genid:A62359 http://xmlns.com/foaf/0.1/homepage http://www.lis.amu.fr/~espinasse

3
http://www.univ-
amu.fr/cours/LIS125
http://www.univ-amu.fr/professeur genid:A62360 Sérialisation Turtle
4 genid:A62360 http://xmlns.com/foaf/0.1/name "bernard espinasse"
Utilisation de l’outil Easyrdf (http://www.easyrdf.org/converter ):

Graphe RDF (utilisation de l’outil Validator : https://www.w3.org/RDF/Validator/rdfval ): @prefix ns0: <http://www.univ-amu.fr/> .

@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://www.univ-amu.fr/cours/LIS125> ns0:professeur [ foaf:homepage


<http://www.lis.amu.fr/~espinasse> ], [ foaf:name "bernard espinasse" ] .

Introduction à RDF - Bernard ESPINASSE - 25 Introduction à RDF - Bernard ESPINASSE - 26

Container
§ Il est fréquent de devoir faire référence à plusieurs ressources (par
exemple : un livre écrit par plusieurs auteurs).
§ Les containers permettent de décrire des groupes
§ Les choses contenues dans un container sont appelées « membres du
groupe »
§ Il existe 3 types de containers prédéfinis :
§ rdf:Bag : liste non ordonnée de ressources ou de littéraux - multi-
ensemble de ressources ou littéraux
§ rdf:Seq : liste ordonnée de ressources ou de littéraux
3. Agrégations en RDF § rdf:Alt : liste de ressources ou de littéraux qui représentent des
alternatives pour une valeur unique
§ Containers § Pour indiquer qu’une ressource est un container, on utilise la propriété
§ Collections rdf:type
§ Remarques :
§ Les containers sont ouverts, i.e. il peut exister d’autres membres du container
que ceux indiqués par la description dont on dispose (qui s’y rajoutent …)
§ Les éléments du conteneur sont listés à l’aide de l’élément li ou _i avec (i > 0)
§ Pour le container alternative il doit y avoir au moins un élément _1 (élément par
défaut)

Introduction à RDF - Bernard ESPINASSE - 27 Introduction à RDF - Bernard ESPINASSE - 28


Containers: Bag Containers : Bag
(Source RDF Primer) § On peut spécifier ce graphe RDF en XML/RDF :
<?xml version="1.0"?>
Soit le graphe RDF suivant précisant les étudiants du cours 6.001 : <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#
xmlns:s="http://example.org/students/vocab#">
<rdf:Description rdf:about="http://example.org/courses/6.001">
<s:students>
<rdf:Bag>
<rdf:li rdf:resource="http://example.org/students/Amy"/>
<rdf:li rdf:resource ="http://example.org/students/Mohamed"/>
<rdf:li rdf:resource ="http://example.org/students/Johann"/>
<rdf:li rdf:resource ="http://example.org/students/Maria"/>
<rdf:li rdf:resource ="http://example.org/students/Phuong"/>
</rdf:Bag>
</s:students>
</rdf:Description>
</rdf:RDF>
§ On peut spécifier ce graphe RDF en Turtle :
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix s: <http://example.org/students/vocab#>.
@prefix stu: <http://example.org/students/>.
@prefix crs: <http://example.org/courses/>.
crs:6.001
s:students [

Container: Bag
a rdf:Bag; select ?student where {
rdf:_1 stu:Amy; crs:6.001 s:students [
rdf:_2 stu:Mohamed; rdfs:member ?student;
rdf:_3 stu:Johann; ]
rdf:_4 stu:Maria; }
rdf:_5 stu:Phuong;
].

Introduction à RDF - Bernard ESPINASSE - 29 Introduction à RDF - Bernard ESPINASSE - 30

Containers : Alt Containers : Alt


(Source RDF Primer) § On peut spécifier ce graphe RDF en XML/RDF :
<?xml version="1.0"?>
Soit le graphe RDF suivant précisant les sites alternatifs pour le téléchargement de <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
X11 : xmlns:s="http://example.org/packages/vocab#">
<rdf:Description rdf:about="http://example.org/packages/X11">
<s:DistributionSite>
<rdf:Alt>
<rdf:li rdf:resource="ftp://ftp.example.org"/>
<rdf:li rdf:resource="ftp://ftp1.example.org"/>
<rdf:li rdf:resource="ftp://ftp2.example.org"/>
</rdf:Alt>
</s:DistributionSite>
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . <?xml</rdf:Description>
version="1.0"?>
@prefix s: <http://example.org/students/vocab#>. </rdf:RDF>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@prefix stu: <http://example.org/students/>. xmlns:s="http://example.org/students/vocab#">
@prefix crs: <http://example.org/courses/>. § On peut spécifier ce graphe RDF en Turtle :
pkg:X11
<rdf:Description rdf:about="http://example.org/courses/6.001">

Container: Seq
crs:6.001 s:DistributionSite
<s:students> [
s:students [ a rdf:Alt;
<rdf:Bag>
a rdf:Bag; rdf:_1 <rdf:li
<ftp://ftp.example.org>;
rdf:resource="http://example.org/students/Amy"/>
rdf:_1 stu:Amy; rdf:_2 <rdf:li
<ftp://ftp1.example.org>;
rdf:resource="http://example.org/students/Mohamed"/>

Container: Alt
rdf:_2 stu:Mohamed; rdf:_3 <rdf:li
<ftp://ftp2.example.org>;
rdf:resource="http://example.org/students/Johann"/>
rdf:_3 stu:Johann; ]. <rdf:li rdf:resource="http://example.org/students/Maria"/>
rdf:_4 stu:Maria; <rdf:li rdf:resource="http://example.org/students/Phuong"/>
rdf:_5 stu:Phuong; § Interrogation du Alt en SPARQL sur Turtle :
</rdf:Bag>
].
Figure 14 du RDF Primer
</s:students>
select ?coll ?type ?elem where {
</rdf:Description>
</rdf:RDF> ?coll ?pred [a ?type;
rdfs:member ?elem]
}

Introduction à RDF - Bernard ESPINASSE - 31 Introduction à RDF - Bernard ESPINASSE - 32


Containers : Seq Collections (1)
§ Pour un conteneur rdf:Seq, les graphe RDF et les spécifications RDF/XML sont similaires à
ceux d'un conteneur rdf:Bag, la seule différence réside dans le type rdf:Seq. § En RDF, une collection est une liste (comme dans LISP) :
§ Remarque : bien qu'un conteneur rdf:Seq soit destiné à décrire une séquence, c'est aux § Une liste de type rdf:List avec
applications qui créent et traitent le graphe d'interpréter correctement la séquence des noms de
propriétés à valeur entière. § un premier élément rdf:first et
§ En XML/RDF :
<?xml version="1.0"?> § une suite rdf:rest.
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:s="http://example.org/packages/vocab#"> § La liste vide a la valeur rdf:nil.
<rdf:Description rdf:about="http://example.org/packages/X11">
<s:DistributionSite>
<rdf:Seq> § Exemple :
<rdf:li rdf:resource="ftp://ftp.example.org"/>
<rdf:li rdf:resource="ftp://ftp1.example.org"/> _:c1 rdf:first <ex:aaa> .
<rdf:li rdf:resource="ftp://ftp2.example.org"/>
</rdf:Seq>
</s:DistributionSite> _:c1 rdf:rest _:c2 .
</rdf:Description>
</rdf:RDF> _:c2 rdf:first <ex:bbb> .
§ En RDF Turtle :
pkg:X11 _:c2 rdf:rest rdf:nil .
s:DistributionSite [
a rdf:Seq;
rdf:_1 <ftp://ftp.example.org>;
§ Une collection est une liste fermée
rdf:_2 <ftp://ftp1.example.org>;
rdf:_3 <ftp://ftp2.example.org>;
§ Une collection forme un groupe contenant que les membres spécifiés lors
]. de la déclaration de la collection.

Introduction à RDF - Bernard ESPINASSE - 33 Introduction à RDF - Bernard ESPINASSE - 34

Collections (2) Collections (3)


(Source RDF Primer) § On peut spécifier cette collection en XML/RDF ainsi :
<?xml version="1.0"?>
Soit le graphe RDF suivant associé au cours 6.001 et ses étudiants : <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:s="http://example.org/students/vocab#">
<rdf:Description rdf:about="http://example.org/courses/6.001">
<s:students rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.org/students/Amy"/>
<rdf:Description rdf:about="http://example.org/students/Mohamed"/>
<rdf:Description rdf:about="http://example.org/students/Johann"/>
</s:students>
</rdf:Description>
</rdf:RDF>
§ On peut spécifier cette collection pour le cours 6.001 (liste1-L1) en Turtle ainsi :
crs:6.001
crs:6.001 s:students ( select ?cours ?student where {
stu:AmyL1
s:students ( ?cours s:students/rdf:rest*/rdf:first ?student
stu:MohamedL1
stu:AmyL1 stu:JohannL1 }

Collection
stu:MohamedL1 ).
stu:JohannL1 Ou pour le cours 6.0002 (liste2-L2) :
). crs:6.002 s:students _:v0.
_:v0
rdf:first stu:AmiL2;
rdf:rest _:v1.
_:v1
rdf:first stu:MohamedL2;
rdf:rest _:v2.
_:v2
crs:6.002 s:students _:v0. rdf:first stu:JohannL2;
rdf:rest _:nil.
_:v0
rdf:first stu:AmiL2;
Introduction à RDF - Bernard ESPINASSE - rdf:rest
35 _:v1. Introduction à RDF - Bernard ESPINASSE - 36
_:v1
rdf:first stu:MohamedL2; <?xml version="1.0"?>
rdf:rest _:v2. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
_:v2 xmlns:s="http://example.org/students/vocab#">
rdf:first stu:JohannL2;
Collections (4): exemple
§ Collection : quand la valeur d’une propriété est une collection de valeurs :
§ Exemple : soit le cours LIS125 :
<rdf:Description rdf:about=‘http://www.amu.fr/cours/LIS125’>
<ns:staff>
<rdf:Bag>
<rdf:li>Bernard Espinasse</rdf:li>
<rdf:li>Sébastien Fournier</rdf:li>
<rdf:li>Adrian Chifu</rdf:li>
</rdf:Bag>
4. Exemple d’une base RDF
</ns:staff> § Description d’un livre et de ses auteurs
</rdf:Description>

Introduction à RDF - Bernard ESPINASSE - 37 Introduction à RDF - Bernard ESPINASSE - 38

Description RDF d'un livre et son auteur : XML Description RDF d'un livre et son auteur
§ La ressource « Livre » a pour valeur pour la propriété « Titre » le littéral ou valeur
« Dune » ce qui donne le triplet RDF (Livre, Title, Dune), en XML : Pour distinguer dans la valeur de l’auteur « Frank Herbert » le nom du
<rdf:RDF prénom :
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" Livre
xmlns:dc= "http://purl.org/dc/elements/1.1/" > Title
§ On définie la propriété « Name » et la propriété « FirstName »
<rdf:Description rdf:about="Livre">
<dc:Title>Dune</dc:Title> Dune
§ On créé un noeud blanc (anonyme) « #Auteur1 »
</rdf:Description>
</rdf:RDF> § On caractérise ce nœud anonyme par les propriétés « Name » et
« FirstName »
§ Une autre propriété « Auteur » peut être associée à la ressource Livre, avec la valeur
« Frank Herbert », on a le triplet (Livre, Creator, Frank Herbert) : § On a ainsi les 3 triplets RDF : Livre

<rdf:RDF Creator
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" (Livre, Creator, #Auteur1) Auteur1
xmlns:dc= "http://purl.org/dc/elements/1.1/" > Livre
Name FirstName
<rdf:Description rdf:about="Livre"> Creator
(#Auteur1, Name, Herbert)
<dc:Title>Dune</dc:Title> Herbert Frank
<dc:Creator>Frank Herbert</dc:Creator> Frank
(#Auteur1, FirstName, Frank)
Herbert
</rdf:Description>

Introduction à RDF - Bernard ESPINASSE - 39 Introduction à RDF - Bernard ESPINASSE - 40


Description RDF d'un livre et son auteur : XML Description RDF d'un livre et son auteur : Turtle
Utilisation de EasyRDF (http://www.easyrdf.org/converter):
Soit en XML : Soit en Turtle :
<rdf:RDF
<rdf:RDF @prefix dc11: <http://purl.org/dc/elements/1.1/> .
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc= "http://purl.org/dc/elements/1.1/" @prefix ns0: <http://monexemple.> .
xmlns:ex= "http://monexemple.org">
Livre Livre
<rdf:Description rdf:about="Livre"> <http://njh.me/Livre>
<dc:Creator rdf:resource="Auteur1"/> Creator Creator
Title dc11:Creator <http://njh.me/Auteur1> ; Title
<dc:Title> L’homme des deux mondes </dc: Title > Auteur1 Auteur1
</rdf:Description> Name FirstName
dc11:Title "L’homme des deux mondes" . Name FirstName
<rdf:Description rdf:ID="auteur1"> L’hmme des L’hmme des
<ex:FirstName> Frank </ex: FirstName > deux mondes Herbert Frank
<http://njh.me/#Auteur1> deux mondes Herbert Frank

<ex:Name> Herbert </ex:Name>


ns0:orgFirstName "Frank" ;
</rdf:Description>
</rdf:RDF> ns0:orgName "Herbert" .

Introduction à RDF - Bernard ESPINASSE - 41 Introduction à RDF - Bernard ESPINASSE - 42

Description RDF d'un livre et ses auteurs (2) : Triplets Description RDF d'un livre et ses auteurs (2) : XML
<?xml version="1.0" encoding="utf-8" ?>
Considérons le livre L’Homme de deux mondes qui est le premier roman écrit par Frank <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ns0="http://www.monvoc.">
Herbert (disparu en 1986), en collaboration avec son fils Brian :
<rdf:Description rdf:about="http://#livre1">
<ns0:frauteur rdf:resource="http://auteur1"/>
<ns0:frtitre>Dune</ns0:frtitre>
Triplets RDF Graphe RDF </rdf:Description>

<rdf:Description rdf:about="http://#livre2">
<ns0:frauteur rdf:resource="http://auteur1"/>
(Livre, auteur, #Auteur1) <ns0:frauteur rdf:resource="http://auteur2"/>
Livre Auteur2
(Livre, auteur, #Auteur2) auteur <ns0:frtitre>L'homme de deux mondes</ns0:frtitre>
</rdf:Description>
(Livre, titre, L’homme des deux fils
mondes) auteur
nom <rdf:Description rdf:about="http://#auteur1">
prenom <ns0:frprenom>Frank</ns0:frprenom>
(#Auteur1, nom, Herbert) titre Auteur1 <ns0:frnom>Herbert</ns0:frnom>
(#Auteur1, prenom, Frank) Herbert Brian <ns0:frage rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">70</ns0:frage>
</rdf:Description>
(#Auteur2, nom, Herbert) nom
prenom age

(#Auteur2, prenom, Brian) L’hmme des


deux mondes Herbert Frank
<rdf:Description rdf:about="http://#auteur2">
<ns0:frprenom>Brian</ns0:frprenom>
(#Auteur2, fils, #Auteur1) <ns0:frnom>Herbert</ns0:frnom>
<ns0:frage rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">30</ns0:frage>
<ns0:frfils rdf:resource="http://auteur1"/>
</rdf:Description>

</rdf:RDF>

Introduction à RDF - Bernard ESPINASSE - 43 Introduction à RDF - Bernard ESPINASSE - 44


Description RDF d'un livre et ses auteurs (2) : Turtle Description RDF d'un livre et ses auteurs (2) : Graphe
Utilisation de EasyRDF (http://www.easyrdf.org/converter ): Graphe RDF associé (RDF Validator: https://www.w3.org/RDF/Validator/ ) :

@prefix dc11: <http://purl.org/dc/elements/1.1/> .


@prefix ns0: <http://monexemple.> .

<http://njh.me/Livre>
dc11:Creator <http://njh.me/Auteur1>, <http://njh.me/Auteur2> ;
dc11:Title " L’homme des deux mondes " .

<http://njh.me/#Auteur1>
ns0:orgFirstName " Frank " ;
ns0:orgName " Herbert " .

<http://njh.me/#Auteur2>
ns0:orgFirstName " Brian " ;
ns0:orgName " Herbert " ;
ns0:orgFils <http://njh.me/Auteur1> .

Introduction à RDF - Bernard ESPINASSE - 45 Introduction à RDF - Bernard ESPINASSE - 46

Description RDF d'un livre et ses auteurs (2) : Triplets Description RDF d'un livre et ses auteurs (2) :
simplifications
Triplets RDF associés (RDF Validator: https://www.w3.org/RDF/Validator/ ) :
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
Nb Subject Predicate Object
1 http://www.w3.org/RDF/Validator/run/Livre http://purl.org/dc/elements/1.1/Creator http://www.w3.org/RDF/Validator/run/Auteur1
xmlns:dc= "http://purl.org/dc/elements/1.1/"
2 http://www.w3.org/RDF/Validator/run/Livre http://purl.org/dc/elements/1.1/Creator http://www.w3.org/RDF/Validator/run/Auteur2 xmlns:ex= "http://monexemple.org.">
3 http://www.w3.org/RDF/Validator/run/Livre http://purl.org/dc/elements/1.1/Title "L’homme des deux mondes" <rdf:Description rdf:about="Livre">
http://www.w3.org/RDF/Validator/run/1569169791 <dc:auteur rdf:resource="Auteur1"/>
4 http://monexemple.orgFirstName "Frank"
477#Auteur1
http://www.w3.org/RDF/Validator/run/1569169791 <dc:auteur rdf:resource="Auteur2"/>
5 http://monexemple.orgName "Herbert"
477#Auteur1 <dc:titre> L’homme des deux mondes </dc:titre>
http://www.w3.org/RDF/Validator/run/1569169791
6
477#Auteur2
http://monexemple.orgFirstName "Brian" </rdf:Description>
http://www.w3.org/RDF/Validator/run/1569169791 <rdf:Description rdf:ID="Auteur1">
7 http://monexemple.orgName "Herbert"
477#Auteur2 <ex:prenom> Frank </ex:prenom>
http://www.w3.org/RDF/Validator/run/1569169791 http://www.w3.org/RDF/Validator/run/Aute
8
477#Auteur2
http://monexemple.orgFils
ur1
<ex:nom> Herbert </ex:nom>
</rdf:Description>
<rdf:Description rdf:ID="Auteur2">
<ex:prenom> Brian </ex:prenom>
<ex:nom> Herbert </ex:nom>
<ex:fils rdf:ressource= "Auteur1" />
</rdf:Description>
</rdf:RDF>

Introduction à RDF - Bernard ESPINASSE - 47 Introduction à RDF - Bernard ESPINASSE - 48


Description RDF d'un livre et son auteur (2) : Turtle
Utilisation de Easy RDF (http://www.easyrdf.org/converter ):

@prefix dc11: <http://purl.org/dc/elements/1.1/> .


@prefix ns0: <http://monexemple.org.> .

<http://njh.me/Livre>
dc11:auteur <http://njh.me/Auteur1>, <http://njh.me/Auteur2> ;
dc11:titre " L’homme des deux mondes " .

<http://njh.me/#Auteur1>
ns0:prenom " Frank " ; 5. Conclusion
ns0:nom " Herbert " .
§ Sémantique de RDF
<http://njh.me/#Auteur2> § Inférences dans RDF
ns0:prenom " Brian " ; § Vocabulaire RDF
ns0:nom " Herbert " ; § Langages de requête autour de RDF : SPARQL
ns0:fils <http://njh.me/Auteur1> . § Intérêts et limitations de RDF

Introduction à RDF - Bernard ESPINASSE - 49 Introduction à RDF - Bernard ESPINASSE - 50

Sémantique de RDF Vocabulaires RDF


§ La sémantique d'un document RDF peut être exprimée en théorie des § La structure de RDF est extrêmement générique et sert de base à un
ensembles en se donnant des contraintes sur le monde décrites en RDF certain nombre de schémas ou vocabulaires dédiés à des
applications spécifiques :
§ RDF hérite alors de la généricité et de l'universalité de la notion
d'ensemble • des vocabulaires sont spécifiés par le W3C :
§ Cette sémantique peut être aussi traduite en formule de logique du premier § les langages d'ontologie RDFS et OWL
ordre, positive, conjonctive et existentielle : § le vocabulaire SKOS pour la représentation des
{sujet, objet, prédicat} ⇔ prédicat(objet, sujet) thésaurus et autres vocabulaires structurés
§ ce qui est équivalent à :
§…
• d'autres vocabulaires RDF pas spécifiés par le W3C, sont
∃ objet, ∃ sujet tel que prédicat(objet, sujet)
néanmoins utilisés largement et constituent des standards de
fait dans la communauté du Web Sémantique
RDF et inférences
§ Exemple : FOAF destiné à la représentation des
§ Le W3C a prévu un mécanisme d'inférence pour la sémantique de RDF déduisant personnes
exclusivement et intégralement les conséquences des prédicats, sans que ce
§…
mécanisme ne fasse l'objet d'une recommandation.

Introduction à RDF - Bernard ESPINASSE - 51 Introduction à RDF - Bernard ESPINASSE - 52


Intérêts et limitation de RDF
Intérêts :
§ RDF = base du Web des données en proposant :
§ un modèle de données standardisé
§ des formats d'échanges de données (N3, Turtle, N-Triples, …)
§ Un langage de requêtes puissant : SPARQL

Limitations :
§ RDF permet de définir des graphes étiquetés - Graphes RDF, en utilisant
des ressources du web sans vraiment de sémantique
§ Pour donner de la sémantique des étiquettes du graphe RDF, il faut des
vocabulaires mieux définis (méta-données)
§ Pour formaliser cette sémantique il faut utiliser des ontologies

ð RDFS (RDF-Schema), extension de RDF permettant de


construire des ontologies légères en RDF

Introduction à RDF - Bernard ESPINASSE - 53

Vous aimerez peut-être aussi