forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersons_colonial.rq
54 lines (53 loc) · 1.81 KB
/
persons_colonial.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
# List PM20 person folders active in colonial affairs
#
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#>
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/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
#
select distinct ?pm20 ?pm20Label ?fromTo (str(?nationality) as ?countryOfOrigin)
?occupation (group_concat(?locationOfActivity;
separator='; ') as ?locationsOfActivity) ?item ?workLocation ?workLocationLabel
where {
# also change in service subquery!
values ( ?language ) {
( 'de' )
}
service <https://query.wikidata.org/sparql> {
# also change in main query!
values ( ?language ) {
( 'de' )
}
?item wdt:P4293 ?pm20Id ;
wdt:P31 wd:Q5 .
bind(uri(concat('https://pm20.zbw.eu/folder/', ?pm20Id)) as ?pm20)
optional {
?item wdt:P937 ?workLocation .
?workLocation rdfs:label ?labelLang .
}
filter(lang(?labelLang) = ?language)
bind(str(?labelLang) as ?workLocationLabel)
}
?pm20 a zbwext:PersonFolder ;
zbwext:activity [ schema:about 'Kolonialwesen'@de ;
schema:location ?locationOfActivity ] ;
skos:prefLabel ?pm20Label .
filter(lang(?locationOfActivity) = ?language)
optional {
?pm20 schema:nationality ?nationality .
filter(lang(?nationality) = ?language)
}
# filter(?countryOfOrigin = 'Deutschland' || ?locationOfActivity = 'Deutschland')
optional {
?pm20 schema:hasOccupation ?occupation .
}
optional {
?pm20 gndo:dateOfBirthAndDeath ?fromTo .
}
}
group by ?pm20 ?pm20Label ?fromTo ?nationality ?occupation ?item ?workLocation ?workLocationLabel
order by ?pm20Label