-
Notifications
You must be signed in to change notification settings - Fork 2
/
ExampleQuery.rq
36 lines (33 loc) · 1.7 KB
/
ExampleQuery.rq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT * WHERE {
SERVICE <http://dbpedia.org/sparql> {
<http://dbpedia.org/resource/Berlin> dbo:country ?c .
?c owl:sameAs ?cc
}
SERVICE <https://query.wikidata.org/sparql> {
?cc rdfs:label ?o
}
}
# An example query that must take into account vocabulary mappings
#SELECT * WHERE {
# SERVICE <https://query.wikidata.org/sparql> {
# ?pablo rdfs:label "Pablo Picasso"@en .
# ?pablo <https://schema.org/hasOccupation> ?artist .
# }
# SERVICE <http://dbpedia.org/sparql> {
# ?person rdf:type ?artist .
# ?person <https://schema.org/birthPlace> <http://dbpedia.org/resource/Spain> .
# }
#}
#limit 3
# Expected results:
#-------------------------------------------------------------------------------------------------------------------------
#| pablo | artist | person |
#=========================================================================================================================
#| <http://www.wikidata.org/entity/Q5593> | <https://schema.org/artist> | <http://dbpedia.org/resource/Carles_Canut> |
#| <http://www.wikidata.org/entity/Q5593> | <https://schema.org/artist> | <http://dbpedia.org/resource/Carles_Casagemas> |
#| <http://www.wikidata.org/entity/Q5593> | <https://schema.org/artist> | <http://dbpedia.org/resource/Carlos_Albert> |
#-------------------------------------------------------------------------------------------------------------------------