2. Query 1
Objective: Find all the people who were born in Paris on DBpedia
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia3: <http://dbpedia.org/ontology/>
SELECT distinct ?name ?birth ?person WHERE {
?person dbpedia2:birthPlace <http://dbpedia.org/resource/Paris> .
?person dbpedia2:birthDate ?birth .
?person foaf:name ?name .
} ORDER BY ?name
Result:
Plenty of them!
ex: "René Laloux"@en1929-07-13http://dbpedia.org/resource/Ren%C3%A9_Laloux
3. Query 2
Objective: Find all the people born in Paris after 1970 by using FILTER
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia3: <http://dbpedia.org/ontology/>
SELECT distinct ?name ?person ?birthDate WHERE {
?person dbpedia2:birthPlace <http://dbpedia.org/resource/Paris> .
?person foaf:name ?name .
?person dbpedia2:birthDate ?birthDate .
FILTER (1970 < ?birthDate)
} ORDER BY ?birthDate
Result:
"Jules de Balincourt"@enhttp://dbpedia.org/resource/Jules_de_Balincourt"1972"^^<http://www.w3.org/2001/XMLSchema#int>
"Phoebe Philo"@enhttp://dbpedia.org/resource/Phoebe_Philo"1973"^^<http://www.w3.org/2001/XMLSchema#int>
"Caroline Ducey"@enhttp://dbpedia.org/resource/Caroline_Ducey"1977"^^<http://www.w3.org/2001/XMLSchema#int>
4. Query 3
Objective: Find all the solo singer who were born in London
PREFIX dbpedia3: <http://dbpedia.org/ontology/>
SELECT distinct
?name ?birthdate ?person WHERE
{ ?person dbpedia3:birthPlace <http://dbpedia.org/resource/London> .
?person dbpedia3:birthDate ?birthdate .
?person dbpedia3:background "solo_singer"@en .
?person foaf:name ?name .
} ORDER BY ?name
5. Query 4
Objective: Find all the people born in Brest using FILTER regex
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia3: <http://dbpedia.org/ontology/>
SELECT distinct ?name ?person ?birthPlace WHERE {
?person foaf:name ?name .
?person dbpedia2:birthPlace ?birthPlace
FILTER regex (?birthPlace, "Brest")
} ORDER BY ?name
Result :
"Alex Thepot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alex
Thépot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alexand
re Coeff"@enhttp://dbpedia.org/resource/Alexandre_Coeffhttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alexis
Thépot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re
6. Query 5
Objective: Find the solo artists who did concert tours of more than 200 shows
PREFIX dbpedia2: <http://dbpedia.org/property/>
SELECT distinct ?tour ?artist ?numberOfShows WHERE
{
?tour dbpedia2:artist ?artist .
?artist dbpedia2:background "solo_singer"@en .
?tour dbpedia2:numberOfShows ?numberOfShows .
FILTER (?numberOfShows > 200)
} ORDER BY ?numberOfShows
Several results (Bob Dylan, Cher, Lady Gaga...)
7. Query Simpsons
• Find out all the chalk gag that Bart wrote on the blackboard!
– http://www.snee.com/bobdc.blog/2008/10/learning-more-about-sparql.html
– http://www.snee.com/bobdc.blog/2007/11/querying-dbpedia.html
– http://dbpedia.org/page/Category:The_Simpsons_episodes
• We didn’t succeed in doing this within our limited working hours. So if you
are interested, try it out! These links are useful for you!