You are on page 1of 6

Correction RDF/RDFs/SPARQL

Lylia ABROUK
Exercice 3
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ex="http://donnees_perso/elements/1.0/" xml:base="http://donnees_perso/articles/"> <rdf:Description rdf:ID="LyliaAbrouk"> <rdf:type rdf:resource="http://donnees_perso/elements/1.0/personne" /> <ex:travaille rdf:resource="http://donnees_perso/elements/1.0/le2i" /> <ex:enseigne> <rdf:Bag> <rdf:li rdf:resource="http://donnees_perso/elements/1.0/Appli" /> <rdf:li rdf:resource="http://donnees_perso/elements/1.0/SI" /> </rdf:Bag> </ex:enseigne> <ex:connait> <rdf:Description> <ex:travaille> <rdf:Description> <rdf:type rdf:resource="http://donnees_perso/elements/1.0/Universit" /> </rdf:Description> </ex:travaille> </rdf:Description> </ex:connait> </rdf:Description> </rdf:RDF>

Exercice 4
<rdf:Description rdf:ID="Marie"> <ex:habite>Quebec</ex:habite>
1

<ex:habite_avec> <rdf:Bag> <rdf:li rdf:resource="http://donnees_perso/articles/Melanie" /> <rdf:li rdf:resource="http://donnees_perso/articles/Anne" /> </rdf:Bag> </ex:habite_avec> <ex:mere_de> <rdf:Bag> <rdf:li rdf:resource="http://donnees_perso/articles/Melanie" /> <rdf:li rdf:resource="http://donnees_perso/articles/Anne" /> </rdf:Bag> </ex:mere_de> </rdf:Description> </rdf:RDF>

Exercice 5

<?xml version='1.0' encoding='ISO-8859-15'?> <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> <!ENTITY techno "file:///home/genest/enseignement/m2p_websem/td/td1/techno.rdf#">] <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http:// <techno:CarteMere rdf:ID="P5GD1"> <techno:socket rdf:resource="&techno;Intel775"/> <techno:port rdf:resource="&techno;PCIExpress16x"/> <techno:port rdf:resource="&techno;PCIExpress"/> <techno:port rdf:resource="&techno;PCI"/> <techno:prix rdf:datatype="&xsd;integer">140</techno:prix> </techno:CarteMere> <techno:CarteMere rdf:ID="P4P800"> <techno:socket rdf:resource="&techno;Intel478"/> <techno:port rdf:resource="&techno;AGP"/> <techno:port rdf:resource="&techno;PCI"/> <techno:prix rdf:datatype="&xsd;integer">101</techno:prix> </techno:CarteMere> <techno:CarteGraphique rdf:ID="GF7800"> <techno:port rdf:resource="&techno;PCIExpress16x"/> <techno:ConnecteurVideo rdf:resource="&techno;VGA"/> <techno:ConnecteurVideo rdf:resource="&techno;DVI"/> <techno:prix rdf:datatype="&xsd;integer">200</techno:prix>
2

</techno:CarteGraphique> <techno:CarteGraphique rdf:ID="GF5200"> <techno:port rdf:resource="&techno;AGP"/> <techno:ConnecteurVideo rdf:resource="&techno;VGA"/> <techno:ConnecteurVideo rdf:resource="&techno;DVI"/> <techno:prix rdf:datatype="&xsd;integer">100</techno:prix> </techno:CarteGraphique> </rdf:RDF>

Exercice 1/td2
<?xml version="1.0"?> <rdf:RDF 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/" xmlns:ex="http://donnees_perso/elements/1.0/" xml:base="http://donnees_perso/articles/">

<rdf:Description rdf:ID="Personne"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> </rdf:Description>

<rdf:Description rdf:ID="Etudiant"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Personne"/> </rdf:Description>

<rdf:Description rdf:ID="Professeur"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Personne"/> </rdf:Description> <rdf:Description rdf:ID="Cours"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
3

</rdf:Description> <rdf:Property rdf:ID="nom"> <rdfs:domain rdf:resource="#Personne"/> <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> </rdf:Property> <rdf:Property rdf:ID="nationalite"> <rdfs:domain rdf:resource="#Personne"/> </rdf:Property> <rdf:Property rdf:ID="age"> <rdfs:domain rdf:resource="#Personne"/> <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/> </rdf:Property>

<rdf:Property rdf:ID="Langue_etrangere"> <rdfs:domain rdf:resource="#Personne"/> </rdf:Property>

<rdf:Property rdf:ID="universite"> <rdfs:domain rdf:resource="#Etudiant"/> <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> </rdf:Property>

<rdf:Property rdf:ID="Partenaire"> <rdfs:domain rdf:resource="#Etudiant"/> <rdfs:range rdf:resource="#Etudiant"/> </rdf:Property> <rdf:Property rdf:ID="Enseignant"> <rdfs:domain rdf:resource="#Cours"/> <rdfs:range rdf:resource="#Professeur"/> </rdf:Property>

<rdf:Property rdf:ID="titre"> <rdfs:domain rdf:resource="#Cours"/> <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> </rdf:Property> <rdf:Property rdf:ID="Etudie"> <rdfs:domain rdf:resource="#Cours"/> <rdfs:range rdf:resource="#Etudiant"/> </rdf:Property> <rdf:Property rdf:ID="lieu"> <rdfs:domain rdf:resource="#Cours"/> </rdf:Property> <rdf:Property rdf:ID="programme"> <rdfs:domain rdf:resource="#Cours"/> </rdf:Property> <rdfs:Datatype rdf:about="http://www.w3.org/2001/XMLSchema#integer"/> <rdfs:Datatype rdf:about="http://www.w3.org/2001/XMLSchema#string"/> <ex:Etudiant rdf:ID="Olivier"> <ex:nom>Olivier</ex:nom> <ex:age>20</ex:age> <ex:nationalite>Francaise</ex:nationalite> <ex:Langue_etrangere>Anglais</ex:Langue_etrangere> <ex:universite>UB</ex:universite> <ex:Partenaire rdf:resource="#Maria" /> </ex:Etudiant> <ex:Etudiant rdf:ID="Maria"> <ex:nom>Maria</ex:nom> <ex:nationalite>Espagnole</ex:nationalite> <ex:Langue_etrangere>Anglais</ex:Langue_etrangere> <ex:universite>UB</ex:universite> <ex:universite>UM2</ex:universite>
5

<ex:Partenaire rdf:resource="#Olivier" /> </ex:Etudiant> <ex:Etudiant rdf:ID="Mark"> <ex:nom>Mark</ex:nom> <ex:universite>EPFL</ex:universite> </ex:Etudiant> <ex:Course rdf:ID="CoursEsp"> <ex:title>Cours espagnol</ex:title> <ex:enseignant rdf:resource="#Garcia" /> <ex:programme>Jeudi</ex:programme> <ex:etudie> <rdf:Bag> <rdf:li rdf:resource="#Olivier" /> <rdf:li rdf:resource="#Mark" /> </rdf:Bag> </ex:etudie> <ex:lieu>UB centre de langues</ex:lieu> </ex:Course> <ex:Professeur rdf:ID="Garcia"> <ex:nom>Garcia</ex:nom> </ex:Professeur> <rdf:Statement rdf:about="#Maria_nom"> <rdf:subject rdf:resource="#Maria" /> <rdf:predicate rdf:resource="http://donnees_perso/articles/schema.txt#nom" /> <rdf:object>Maria</rdf:object> <dc:Creator rdf:resource="#Garcia" /> </rdf:Statement> </rdf:RDF>

You might also like