Notions sur la sérialisation RDFS/XML
RDFS permet de définir un schéma (sémantique) d'une application spécifique. RDF Schema est défini par l'URI :
http://www.w3.org/2000/01/rdf-schema#, et le préfixe est rdfs.
Pour le vocabulaire introduit dans ce cours, on utilise la notation des triplets RDF pour définir plusieurs classes de documents comme suit :
cs:Publication cs:Book cs:JournalPaper cs:ConfPaper cs:ShortPaper cs:Book cs:JournalPaper cs:ConfPaper cs:ShortPaper cs:ShortPaper | rdf:type rdf:type rdf:type rdf:type rdf:type rdfs:subClassOf rdfs:subClassOf rdfs:subClassOf rdfs:subClassOf rdfs:subClassOf | rdfs:Class rdfs:Class rdfs:Class rdfs:Class rdfs:Class cs:Publication cs:Publication cs:Publication cs:JournalPaper cs :ConfPaper |
<rdf:RDF xml:base="http://www.cat.com/schema/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="Publication">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description>
<rdf:Description rdf:about="Book">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="Publication"/>
</rdf:Description>
<rdf:Description rdf:about="JournalPaper">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="Publication"/>
</rdf:Description>
<rdf:Description rdf:about="ConfPaper">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="Publication"/>
</rdf:Description>
<rdf:Description rdf:about="ShortPaper">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="JournalPaper"/>
<rdfs:subClassOf rdf:resource="ConfPaper"/>
</rdf:Description>
</rdf:RDF>
Syntaxe abrégée
<rdf:RDF xml:base="http://www.cat.com/schema/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdfs:Class rdf:about="Publication"/>
<rdfs:Class rdf:about="Book">
<rdfs:subClassOf rdf:resource="Publication"/>
</rdfs:Class>
<rdfs:Class rdf:about="JournalPaper">
<rdfs:subClassOf rdf:resource="Publication"/>
</rdfs:Class>
<rdfs:Class rdf:about="ConfPaper">
<rdfs:subClassOf rdf:resource="Publication"/>
</rdfs:Class>
<rdfs:Class rdf:about="ShortPaper">
<rdfs:subClassOf rdf:resource="JournalPaper"/>
<rdfs:subClassOf rdf:resource="ConfPaper"/>
</rdfs:Class>
</rdf:RDF>
Propriétés dans RDFS
Le prédicat (propriété) est une instance de la classe Property .
Exemple :
<rdf:RDF xml:base="http://www.cat.com/schema/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdfs:Class rdf:about="Publication"/>
<rdfs:Class rdf:about="Book">
<rdfs:subClassOf rdf:resource="Publication"/>
</rdfs:Class>
<rdfs:Class rdf:about="JournalPaper">
<rdfs:subClassOf rdf:resource="Publication"/>
</rdfs:Class>
<rdfs:Class rdf:about="ConfPaper">
<rdfs:subClassOf rdf:resource="Publication"/>
</rdfs:Class>
<rdfs:Class rdf:about="ShortPaper">
<rdfs:subClassOf rdf:resource="JournalPaper"/>
<rdfs:subClassOf rdf:resource="ConfPaper"/>
</rdfs:Class>
<rdf:Property rdf:about="noPages">
<rdfs:domain rdf:resource="Publication"/>
<rdfs:range rdf:resource="&xsd;positiveInteger"/>
</rdf:Property>
<rdf:Property rdf:about="placeOfPublication">
<rdfs:domain rdf:resource="ConfPaper"/>
<rdfs:range rdf:resource="&xsd;string"/>
</rdf:Property>
</rdf:RDF>
Instanciation d'un schéma RDF
Dans l'exemple de sérialisation, le catalogue des métadonnées des documents est basé sur 3 vocabulaires (espaces de noms)
http://www.cat.com/schema/ ==> schéma du catalogue (ensemble de classes et de propriétés)
http://www.cat.com/docs ==> ensemble des instances des classes et des propriétés définies dans le schéma du catalogue
http://www.cat.com/auth ==> liste des auteurs, publishers, ...
<rdf:RDF xml:base="http://www.cat.com/docs"
xmlns:cs="http://www.cat.com/schema/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<cs:Book rdf:about="#R20301">
<dc:creator rdf:resource="http://www.cat.com/auth#R051156"/>
<dc:title> SEMANTIC WEB: CONCEPTS AND TECHNOLOGIES
FOR THE GEOGRAPHIC INFORMATION SCIENCES </dc:title>
<dc:date rdf:datatype="&xsd;date"> 2021-01-20 </dc:date>
<cs:noPages> 324 </cs:noPages>
</cs:Book>
<cs:ConfPaper rdf:about="#R20302">
<dc:creator rdf:resource="http://www.cat.com/auth#R051156"/>
<dc:title> USING GAZETTEERS TO ANNOTATE GEOGRAPHIC
CATALOGUE ENTRIES
</dc:title>
<dc:date rdf:datatype="&xsd;date"> 2021-01-21 </dc:date>
<cs:noPages> 6 </cs:noPages>
<cs:placeOfPublication> Chipre </cs:placeOfPublication>
</cs:ConfPaper>
</rdf:RDF>