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)
}
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: