diff --git a/TD1/avatar.xml b/TD0/seance1/avatar.rdf similarity index 100% rename from TD1/avatar.xml rename to TD0/seance1/avatar.rdf diff --git a/TD1/titanic.xml b/TD0/seance1/titanic.rdf similarity index 100% rename from TD1/titanic.xml rename to TD0/seance1/titanic.rdf diff --git a/TD0/seance2/titanic.rdf b/TD0/seance2/titanic.rdf new file mode 100644 index 0000000..e69de29 diff --git a/TD0/seance2/titanic.ttl b/TD0/seance2/titanic.ttl new file mode 100644 index 0000000..569246b --- /dev/null +++ b/TD0/seance2/titanic.ttl @@ -0,0 +1,28 @@ +@prefix ex: . +@prefix rdfs: . +@prefix rdf: . + +ex:Film rdf:type rdfs:class . +ex:Person rdf:type rdfs:class . +ex:Actor rdf:type rdfs:class . +ex:PrincipalActior rdf:type rdfs:class . +ex:Director rdf:type rdfs:class . +ex:CreaticeWork rdf:type rdfs:class . + +ex:Actor rdfs:subClassOf ex:Person . +ex:PrincipalActor rdfs:subClassOf ex:Actor . + +ex:hasRoleIn rdf:type rdf:Property . +ex:hasRoleIn rdfs:domain ex:Actor . +ex:hasRoleIn rdfs:domain ex:Director . +ex:hasRoleIn rdfs:range ex:Film . + +ex:hasPrincipalRoleIn rdfs:subPropertyOf ex:hasRoleIn . + +ex:starring a rdf:Property ; +rdfs:domain ex:Director; +rdfs:rand ex:Film . + +ex:Titanic rdf:type ex:Film . +ex:Leonardo_DiCaprio rdf:type ex:Actor . +ex:Kate_Winslet rdf:type ex:Actor . diff --git a/TD1/exercice1.rdf b/TD1/exercice1.rdf new file mode 100644 index 0000000..674076a --- /dev/null +++ b/TD1/exercice1.rdf @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + 02/26/1802 + + + \ No newline at end of file diff --git a/TD1/exercice2.ttl b/TD1/exercice2.ttl new file mode 100644 index 0000000..b398556 --- /dev/null +++ b/TD1/exercice2.ttl @@ -0,0 +1,8 @@ +@prefix rdf: . +@prefix foaf: . +@prefix ex: . + + +ex:Jean a foaf:person . +ex:Marie a foaf:person . +ex:Jean ex:Aime ex:Marie . diff --git a/TD1/exercise3.rdf b/TD1/exercise3.rdf new file mode 100644 index 0000000..3082f2a --- /dev/null +++ b/TD1/exercise3.rdf @@ -0,0 +1,32 @@ + + + + + + + + + 09-01-2023 + + + + Benjamin + Ben@yahoo.fr + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TD1/exercise4.rdf b/TD1/exercise4.rdf new file mode 100644 index 0000000..75f252a --- /dev/null +++ b/TD1/exercise4.rdf @@ -0,0 +1,41 @@ + + + + + + + + + + 2005 + + + + 2012 + + + + + 2021 + + + + + 48 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TD2/human_2007_09_11.rdfs.xml b/TD2/human_2007_09_11.rdfs.xml new file mode 100644 index 0000000..71b023b --- /dev/null +++ b/TD2/human_2007_09_11.rdfs.xml @@ -0,0 +1,208 @@ + + + + ]> + + + + + + a living organism characterized by voluntary movement. + + être vivant doué de sensibilite de mobilité. + + + + + + an animal that produces gametes (spermatozoa) that can fertilize female gametes (ova). + + individu appartenant au sexe qui possède le pouvoir de fécondation. + + + + + + an animal that produces gametes (ova) that can be fertilized by male gametes (spermatozoa). + + animal appartenant au sexe apte à produire des ovules. + + + + + + + an adult male person + + mâle adulte de l'espèce humaine. + + + + + + + + a member of the human species + + + + + un membre de l'espèce humaine. + + + + + + someone who lectures professionally + + personne qui enseigne une discipline, une technique, un art. + + + + + + + + a person who devotes himself to doing research + + + personne adonnée à des recherches spécialisées. + + + + + + + an adult female person + + femelle adulte de l'espèce humaine. + + + + + + + relation between an animal and another animal from which it is descended. + + relation entre un animal et un autre animal duquel il descend. + + + + + + relation between an animal and another animal which gave birth to it. + + relation entre un animal et un autre animal qui lui a donné naissance. + + + + + relation between an animal and another animal to which it gave birth. + + relation entre un animal et un autre animal auquel il a donné naissance. + + + + + + + to have for parent a male. + + avoir pour parent un mâle. + + + + + + + to have for parent a female. + + avoir pour parent un femmelle. + + + + + + + relation with a male who has the same parents. + + relation avec un mâle ayant les mêmes parents. + + + + + + + relation with a female who has the same parents. + + relation avec une femelle ayant les mêmes parents. + + + + + + + relation between a person and another person he or she knows well and regards with affection and trust. + + relation entre une personne et une autre personne qui est l'objet d'un attachement privilégié. + + + + + + designation of something. + désignation de quelque chose. + + + + + + + + express in some way the approximate length of the shoes for a person. + taille, exprimée en points, des chaussures d'une personne. + + + + + + complete existence duration. + durée complète d'existence. + + + + + + + + + express in some way the approximate dimensions of the shirts of a person. + dimensions approximatives des chemises portées par une personne. + + + + + + + + + express in some way the approximate dimensions of the trousers of a person. + dimensions approximatives des pantalons portés par une personne. + + + + + + + + a person's partner in marriage. + le partenaire d'une personne dans un mariage. + + + + diff --git a/TD2/td.MD b/TD2/td.MD new file mode 100644 index 0000000..e86a79e --- /dev/null +++ b/TD2/td.MD @@ -0,0 +1,6 @@ +# TD2 + +# Exercice 1 + +1. http://www.inria.fr/2007/09/11/humans.rdfs +2. diff --git a/TD3/cours.sparqlbook b/TD3/cours.sparqlbook new file mode 100644 index 0000000..fa99759 --- /dev/null +++ b/TD3/cours.sparqlbook @@ -0,0 +1,13 @@ +prefix ex: +premix rdf <...> + +SELECT ?creation_date +WHERE + ?ex:Film:ex:name Titanic + +SELECT ?film_name +WHERE { + ?ex:creation_date ?creation_date . + ex:name : ?film_name + FILTER (?creation_date > "1998-01-01"^^xsd:dateTime) +} \ No newline at end of file diff --git a/TD4/books.ttl b/TD4/books.ttl new file mode 100644 index 0000000..97f6438 --- /dev/null +++ b/TD4/books.ttl @@ -0,0 +1,51 @@ +@prefix books: . +@prefix booksschema: . +@prefix rdf: . +@prefix foaf: . +@prefix dcterms: . + + +books:Book1 a booksschema:Book; + booksschema:hasGenre booksschema:Romance_novel, booksschema:Fiction ; + dcterms:title "Sauve-Moi"@fr; + dcterms:creator books:Musso; + dcterms:date "2013"; + booksschema:hasPrice 8. + +books:Book5 a booksschema:Book; + booksschema:hasGenre booksschema:Romance_novel, booksschema:Fiction ; + dcterms:title "Central Park"@fr; + dcterms:creator books:Musso; + dcterms:date "2014"; + booksschema:hasPrice 9. + +books:Book2 a booksschema:Book; + booksschema:hasGenre booksschema:Romance_novel, booksschema:Young_adult_fiction ; + dcterms:title "Nos etoile contraire"@fr, "The Fault in Our Stars"@en; + dcterms:creator books:Green; + dcterms:date "2012"; + booksschema:hasPrice 10. + +books:Book3 a booksschema:Book; + booksschema:hasGenre booksschema:Romance_novel; + dcterms:title "Tout le bleu du ciel"@fr; + dcterms:creator books:DaCosta; + dcterms:date "2019". + +books:Book4 a booksschema:Book; + booksschema:hasGenre booksschema:Youth_comics; + dcterms:title "5 Monde?"@fr; + dcterms:date "2017"; + booksschema:hasPrice 20. + +books:Musso rdf:type foaf:Person; +foaf:name "Guillaume Musso"; +foaf:age "48" . + +books:Green rdf:type foaf:Person; +foaf:name "John Green"; +foaf:age "47" . + +books:DaCosta rdf:type foaf:Person; +foaf:name "Melissa Da Costa"; +foaf:age "32" . diff --git a/TD4/corese-gui-4.3.3.jar b/TD4/corese-gui-4.3.3.jar new file mode 100644 index 0000000..1fd6d20 Binary files /dev/null and b/TD4/corese-gui-4.3.3.jar differ diff --git a/TD4/rep.sql b/TD4/rep.sql new file mode 100644 index 0000000..807b632 --- /dev/null +++ b/TD4/rep.sql @@ -0,0 +1,145 @@ +--1 +select * where { + ?name ?type ?value +} + +--2 +select ?name ?value where { + ?name rdf:type ?value +} + +--3 +@prefix booksschema: . +select ?name ?value where { + ?name rdf:type booksschema:Book . + ?name booksschema:hasGenre ?value . +} + + +--4 +@prefix booksschema: . +@prefix dcterms: . + +select ?name ?gender ?value where { + ?name rdf:type booksschema:Book . + ?name booksschema:hasGenre ?gender . +OPTIONAL {?name dcterms:title ?value} +} + +--5 +@prefix booksschema: . +@prefix dcterms: . + +select ?name ?value where { + ?name rdf:type booksschema:Book . +OPTIONAL {?name dcterms:title ?value} +FILTER(lang(?value)='fr') +} + +--6 +@prefix dcterms: . +@prefix booksschema: . + + +select * where { + ?name rdf:type booksschema:Book . + OPTIONAL { ?name booksschema:hasPrice ?price } + FILTER(?price > 8) . +} + +--7 +@prefix booksschema: . +@prefix dcterms: . + +select (count(?name) as ?PriceBooks) where { + ?name rdf:type booksschema:Book +} + +--8 +@prefix booksschema: . +@prefix dcterms: . + +select (count(?book) as ?nbBook) ?genre where { + ?book booksschema:hasGenre ?genre +} +group by ?genre +having (?nbBook >= 2) + +--9 +@prefix booksschema: . +@prefix dcterms: . + +select ?title ?author where { + ?b dcterms:title ?title + ?b dcterms:creator ?author + filter(contains(LCase(?title), "contraire")) +} + +--10 +@prefix booksschema: . +@prefix dcterms: . + +select ?title ?author { + ?b dcterms:creator ?author . + ?b dcterms:title ?title . + { + ?author foaf:name "Guillaume Musso". + } + UNION + { + ?author foaf:name "Melissa Da Costa". + } +} + +--11 +@prefix booksschema: . +@prefix dcterms: . + +select (avg(?price) as ?AvgPrice) where { + ?book booksschema:hasPrice ?price +} + + + +--12 +@prefix dcterms: . +@prefix books: . + + +INSERT { + ?book dcterms:creator books:siegel +} +WHERE { + ?book dcterms:title ?title . + FILTER(contains (?title, "5 Monde?")) +} + +--13 +@prefix dcterms: . +@prefix booksschema: . +@prefix books: . + +INSERT { + ?book booksschema:hasPrice "15" . +} WHERE { + ?book dcterms:creator ?author . + ?author foaf:name "Melissa Da Costa" . +} + + +--14 +@prefix dcterms: . +@prefix booksschema: . + +@prefix books: . + +DELETE { + ?book booksschema:hasPrice "15" . +} +INSERT { + ?book booksschema:hasPrice "8" . +} WHERE { + ?book dcterms:creator ?author . + ?author foaf:name "Melissa Da Costa" . +} +