-
Notifications
You must be signed in to change notification settings - Fork 1
/
churches.rq
39 lines (35 loc) · 1.09 KB
/
churches.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
#
# Generator Query
#
# This query currently returns dublicate items
# where a property have multiply values, Some
# SparQL ninja could probebly fix that
# with SAMPLE or CONCAT/REPLACE magic
#
SELECT DISTINCT ?item ?itemLabel ?location ?article ?kulturarvsdata WHERE {
# get all instance of subclass of church
?item wdt:P31 ?churchsub .
?churchsub wdt:279* wd:Q16970 .
# with country set to Sweden
?item wdt:P17 wd:Q34 .
# which has a kulturarvsdata URI set
?item wdt:P1260 ?kulturarvsdata .
# ...a coordinate location
?item wdt:P625 ?location .
# and a sv.wikipedia article
?article schema:about ?item .
?article schema:inLanguage "sv" .
?article schema:isPartOf <https://sv.wikipedia.org/> .
# if available retrieve Commons Category(for query.wikidat.org only!)
# the pywikibot SparQL generator currently breaks when including OPTIONAL statements
#OPTIONAL {
# ?item wdt:P373 ?commonsCategory .
#}
#OPTIONAL {
# ?item wdt:P18 ?image .
#}
# label it or the world turns into hell
SERVICE wikibase:label {
bd:serviceParam wikibase:language "sv" .
}
}