Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sparql

  • Be the first to comment

Sparql

  1. 1. Web sémantique – les requête SPARQL Yijun CHEN et Jixiao DU
  2. 2. Requête No.1Objectif: Trouver la ville la plus grande d’allemagnePREFIX 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 ?villeRésultat: Ville"capital"@en
  3. 3. Requête No.2Objectif: Trouver le capital d’AllemagnePREFIX dbo: <http://dbpedia.org/ontology/>SELECT distinct ?ville WHERE{ :Germany dbpedia2:capital ?ville.} ORDER BY ?villeRésultat:SPARQL results:ville:Berlin
  4. 4. Requête No.3Objectif: 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 :Hanoique des :Azerbaijan :Azerbaijani_language :Bakupremierslignes du :Nakhchivan_%28city%2 :Nakhchivan :Azerbaijani_language 9résultat) :Madagascar :Malagasy_language :Antananarivo :Nepal :Nepali_language :Kathmandu :Cambodia :Khmer_language :Phnom_Penh :Czech_Republic :Czech_language :Prague
  5. 5. Requête No.4Objectif: Trouver les pays dont la langue officielle est françaisPREFIX dbo: <http://dbpedia.org/ontology/>select *where{ ?x dbo:officialLanguage :French_language. ?x dbo:capital ?y. X Y} :Republic_of_the_Congo :BrazzavilleRésultat:(ici, on liste :Gabon :Librevilleque des :Togo :Lom%C3%A9premiers :Benin :Porto-Novolignes du :Chad :N%27Djamenarésultat) :Haiti :Port-au-Prince :French_Southern_and_Antarctic_Lands :Port-aux-Fran%C3%A7ais
  6. 6. Étudier la classe ville
  7. 7. Requête No.5Objectif: Afficher les listes de twin city qui a plus de 1000000 de personnesPREFIX dbo: <http://dbpedia.org/ontology/>select *where{ ?ville dbo:twinCity ?ville_twin. ?ville dbo:populationTotal ?populationTotal. filter (1000000<?populationTotal)}
  8. 8. Requête No.5Ré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. 9. Requête No.6Objectif: Chercher des personnes qui sont né en chine avec le nom chenSELECT distinct ?name ?person ?birthPlace ?givenNameWHERE{?person foaf:name ?name.?person dbpedia2:birthPlace ?birthPlace .?person foaf:givenName ?givenName.FILTER regex (?birthPlace,"China*")FILTER regex (?givenName, "Chen")}ORDER BY ?nameRésultat:

×