-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwikidata-query.rq
59 lines (47 loc) · 1.2 KB
/
wikidata-query.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
CONSTRUCT {
?place
rdf:type ?type ;
rdfs:label ?label ;
skos:altLabel ?altLabel ;
schema:description ?description ;
foaf:depiction ?flag ;
wdt:P1332 ?north ;
wdt:P1333 ?south ;
wdt:P1334 ?east ;
wdt:P1335 ?west ;
wdt:P3896 ?geo .
?type rdfs:label ?typeLabel .
}
WHERE {
${bindings}
${types}
${constraints}
?place
wdt:P31 ?type ;
rdfs:label ?label ;
schema:description ?description .
?type rdfs:label ?typeLabel .
OPTIONAL { ?place wdt:P41 ?flag . }
OPTIONAL {
?place
wdt:P1332 ?north ;
wdt:P1333 ?south ;
wdt:P1334 ?east ;
wdt:P1335 ?west .
}
OPTIONAL { ?place wdt:P3896 ?geo . }
OPTIONAL {
?place skos:altLabel ?altLabel .
FILTER (LANG(?altLabel) = "en")
}
FILTER (LANG(?typeLabel) = "en")
FILTER (LANG(?label) = "en")
FILTER (LANG(?description) = "en")
}