SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
Web sémantique – les requête
         SPARQL
      Yijun CHEN et Jixiao DU
Requête No.1
Objectif: Trouver la ville la plus grande d’allemagne
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dbo: <http://dbpedia.org/ontology/>

SELECT distinct
    ?ville WHERE
{
:Germany dbpedia2:largestCity ?ville.
} ORDER BY ?ville

Résultat:
 Ville
"capital"@en
Requête No.2
Objectif: Trouver le capital d’Allemagne



PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT distinct ?ville WHERE
{
  :Germany dbpedia2:capital ?ville.
} ORDER BY ?ville



Résultat:

SPARQL results:
ville
:Berlin
Requête No.3
Objectif: Trouver tous les pays et ses langues officielle et capital.
 PREFIX dbo: <http://dbpedia.org/ontology/>
select *
where{
  ?x dbo:officialLanguage ?z.
  ?x dbo:capital ?y.
}
Résultat:       X                        Y                        Z
(ici, on liste :Vietnam                :Vietnamese_language :Hanoi
que des
               :Azerbaijan             :Azerbaijani_language :Baku
premiers
lignes du                                                        :Nakhchivan_%28city%2
               :Nakhchivan             :Azerbaijani_language
                                                                 9
résultat)
               :Madagascar             :Malagasy_language        :Antananarivo
             :Nepal                  :Nepali_language        :Kathmandu
             :Cambodia               :Khmer_language         :Phnom_Penh
             :Czech_Republic         :Czech_language         :Prague
Requête No.4
Objectif: Trouver les pays dont la langue officielle est français

PREFIX dbo: <http://dbpedia.org/ontology/>

select *
where{
  ?x dbo:officialLanguage :French_language.
  ?x dbo:capital ?y. X                                              Y
}
                     :Republic_of_the_Congo                     :Brazzaville
Résultat:
(ici, on liste       :Gabon                                     :Libreville
que des              :Togo                                      :Lom%C3%A9
premiers
                     :Benin                                     :Porto-Novo
lignes du
                     :Chad                                      :N%27Djamena
résultat)
                     :Haiti                                     :Port-au-Prince
                     :French_Southern_and_Antarctic_Lands :Port-aux-Fran%C3%A7ais
Étudier la classe ville
Requête No.5
Objectif: Afficher les listes de twin city qui a plus de 1000000 de personnes
PREFIX dbo: <http://dbpedia.org/ontology/>

select *
where{
  ?ville dbo:twinCity ?ville_twin.
  ?ville dbo:populationTotal ?populationTotal.
  filter (1000000<?populationTotal)
}
Requête No.5
Résultat:


                    ville             ville_twin               populationTotal
       :Cape_Town            :Nice                         3497097
       :Harare               :Prato                        1600000
       :Makassar             :Aden                         1334090
       :Cape_Town            :Haifa                        3497097
       :Harare               :Lago                         1600000
       :Cape_Town            :Aachen                       3497097
       :Nairobi              :Denver                       3138295
       :Harare               :Munich                       1600000
       :Makassar             :Hakodate,_Hokkaid%C5%8D      1334090
       :Harare               :Nottingham                   1600000
       :Makassar             :Wellington                   1334090
       :Cape_Town            :Saint_Petersburg             3497097
       :Cape_Town            :Miami-Dade_County,_Florida   3497097
       :Harare               :Cincinnati                   1600000
       :Makassar             :Peshawar                     1334090
       :Nairobi              :Colorado                     3138295
       :Cape_Town            :Hangzhou                     3497097
       :Makassar             :Qingdao                      1334090
       :Makassar             :Lismore                      1334090
Requête No.6
Objectif: Chercher des personnes qui sont né en chine avec le nom chen
SELECT distinct ?name ?person ?birthPlace ?givenName
WHERE{
?person foaf:name ?name.
?person dbpedia2:birthPlace ?birthPlace .
?person foaf:givenName ?givenName.
FILTER regex (?birthPlace,"China*")
FILTER regex (?givenName, "Chen")
}
ORDER BY ?name
Résultat:

Weitere ähnliche Inhalte

Andere mochten auch

Friday columbian exchange
Friday columbian exchangeFriday columbian exchange
Friday columbian exchangeTravis Klein
 
Social media crisis_presentation
Social media crisis_presentationSocial media crisis_presentation
Social media crisis_presentationjnorthpr
 
La telefonia mòbil guillem
La telefonia mòbil guillemLa telefonia mòbil guillem
La telefonia mòbil guillemmgonellgomez
 
Ablation material book
Ablation material   bookAblation material   book
Ablation material bookRahman Hakim
 
Tues treaty of versailles
Tues treaty of versaillesTues treaty of versailles
Tues treaty of versaillesTravis Klein
 
Texas s ta r powerpoint
Texas  s ta r powerpointTexas  s ta r powerpoint
Texas s ta r powerpointHalogen30
 
Stomp presentation v1.5.1
Stomp presentation v1.5.1Stomp presentation v1.5.1
Stomp presentation v1.5.1Patrick Cannon
 
Thur roman empire lang
Thur roman empire langThur roman empire lang
Thur roman empire langTravis Klein
 
4 Ms of Big Data: Make Me More Money – Infographic
4 Ms of Big Data: Make Me More Money – Infographic4 Ms of Big Data: Make Me More Money – Infographic
4 Ms of Big Data: Make Me More Money – InfographicEMC
 
Can Cheeseburgers and Fruit Smoothies Co-Exist?
Can Cheeseburgers and Fruit Smoothies Co-Exist?Can Cheeseburgers and Fruit Smoothies Co-Exist?
Can Cheeseburgers and Fruit Smoothies Co-Exist?Research Now
 

Andere mochten auch (15)

Friday columbian exchange
Friday columbian exchangeFriday columbian exchange
Friday columbian exchange
 
Social media crisis_presentation
Social media crisis_presentationSocial media crisis_presentation
Social media crisis_presentation
 
La telefonia mòbil guillem
La telefonia mòbil guillemLa telefonia mòbil guillem
La telefonia mòbil guillem
 
การผลิตสื่อ
การผลิตสื่อการผลิตสื่อ
การผลิตสื่อ
 
Ablation material book
Ablation material   bookAblation material   book
Ablation material book
 
Day 4
Day 4Day 4
Day 4
 
Tues treaty of versailles
Tues treaty of versaillesTues treaty of versailles
Tues treaty of versailles
 
Texas s ta r powerpoint
Texas  s ta r powerpointTexas  s ta r powerpoint
Texas s ta r powerpoint
 
DATALOGIC Magellan 9800i - Multi-Plane Imaging Scanner and Scales
DATALOGIC Magellan 9800i - Multi-Plane Imaging Scanner and ScalesDATALOGIC Magellan 9800i - Multi-Plane Imaging Scanner and Scales
DATALOGIC Magellan 9800i - Multi-Plane Imaging Scanner and Scales
 
Stomp presentation v1.5.1
Stomp presentation v1.5.1Stomp presentation v1.5.1
Stomp presentation v1.5.1
 
Thur roman empire lang
Thur roman empire langThur roman empire lang
Thur roman empire lang
 
4 Ms of Big Data: Make Me More Money – Infographic
4 Ms of Big Data: Make Me More Money – Infographic4 Ms of Big Data: Make Me More Money – Infographic
4 Ms of Big Data: Make Me More Money – Infographic
 
Penelitian
PenelitianPenelitian
Penelitian
 
Jump start your application monitoring with APM
Jump start your application monitoring with APMJump start your application monitoring with APM
Jump start your application monitoring with APM
 
Can Cheeseburgers and Fruit Smoothies Co-Exist?
Can Cheeseburgers and Fruit Smoothies Co-Exist?Can Cheeseburgers and Fruit Smoothies Co-Exist?
Can Cheeseburgers and Fruit Smoothies Co-Exist?
 

Sparql

  • 1. Web sémantique – les requête SPARQL Yijun CHEN et Jixiao DU
  • 2. Requête No.1 Objectif: Trouver la ville la plus grande d’allemagne PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX : <http://dbpedia.org/resource/> PREFIX dbpedia2: <http://dbpedia.org/property/> PREFIX dbpedia: <http://dbpedia.org/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX dbo: <http://dbpedia.org/ontology/> SELECT distinct ?ville WHERE { :Germany dbpedia2:largestCity ?ville. } ORDER BY ?ville Résultat: Ville "capital"@en
  • 3. Requête No.2 Objectif: Trouver le capital d’Allemagne PREFIX dbo: <http://dbpedia.org/ontology/> SELECT distinct ?ville WHERE { :Germany dbpedia2:capital ?ville. } ORDER BY ?ville Résultat: SPARQL results: ville :Berlin
  • 4. Requête No.3 Objectif: Trouver tous les pays et ses langues officielle et capital. PREFIX dbo: <http://dbpedia.org/ontology/> select * where{ ?x dbo:officialLanguage ?z. ?x dbo:capital ?y. } Résultat: X Y Z (ici, on liste :Vietnam :Vietnamese_language :Hanoi que des :Azerbaijan :Azerbaijani_language :Baku premiers lignes du :Nakhchivan_%28city%2 :Nakhchivan :Azerbaijani_language 9 résultat) :Madagascar :Malagasy_language :Antananarivo :Nepal :Nepali_language :Kathmandu :Cambodia :Khmer_language :Phnom_Penh :Czech_Republic :Czech_language :Prague
  • 5. Requête No.4 Objectif: Trouver les pays dont la langue officielle est français PREFIX dbo: <http://dbpedia.org/ontology/> select * where{ ?x dbo:officialLanguage :French_language. ?x dbo:capital ?y. X Y } :Republic_of_the_Congo :Brazzaville Résultat: (ici, on liste :Gabon :Libreville que des :Togo :Lom%C3%A9 premiers :Benin :Porto-Novo lignes du :Chad :N%27Djamena résultat) :Haiti :Port-au-Prince :French_Southern_and_Antarctic_Lands :Port-aux-Fran%C3%A7ais
  • 7. Requête No.5 Objectif: Afficher les listes de twin city qui a plus de 1000000 de personnes PREFIX dbo: <http://dbpedia.org/ontology/> select * where{ ?ville dbo:twinCity ?ville_twin. ?ville dbo:populationTotal ?populationTotal. filter (1000000<?populationTotal) }
  • 8. Requête No.5 Résultat: ville ville_twin populationTotal :Cape_Town :Nice 3497097 :Harare :Prato 1600000 :Makassar :Aden 1334090 :Cape_Town :Haifa 3497097 :Harare :Lago 1600000 :Cape_Town :Aachen 3497097 :Nairobi :Denver 3138295 :Harare :Munich 1600000 :Makassar :Hakodate,_Hokkaid%C5%8D 1334090 :Harare :Nottingham 1600000 :Makassar :Wellington 1334090 :Cape_Town :Saint_Petersburg 3497097 :Cape_Town :Miami-Dade_County,_Florida 3497097 :Harare :Cincinnati 1600000 :Makassar :Peshawar 1334090 :Nairobi :Colorado 3138295 :Cape_Town :Hangzhou 3497097 :Makassar :Qingdao 1334090 :Makassar :Lismore 1334090
  • 9. Requête No.6 Objectif: Chercher des personnes qui sont né en chine avec le nom chen SELECT distinct ?name ?person ?birthPlace ?givenName WHERE{ ?person foaf:name ?name. ?person dbpedia2:birthPlace ?birthPlace . ?person foaf:givenName ?givenName. FILTER regex (?birthPlace,"China*") FILTER regex (?givenName, "Chen") } ORDER BY ?name Résultat: