forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersons_with_metadata.rq
56 lines (55 loc) · 1.6 KB
/
persons_with_metadata.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
# all persons with metadata
#
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#>
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 ?life
(group_concat(distinct ?location;
separator='; ') as ?locations)
?occupation ?doc (str(?docCount) as ?docLabel) ?clip ?gnd ?gndLabel ?wd ?wdLabel
where {
values ( ?language ) {
( 'de' )
}
?pm20 a zbwext:PersonFolder ;
skos:prefLabel ?pm20Label ;
dct:identifier ?pm20Id ;
dct:temporal ?clip .
filter(isLiteral(?pm20Id))
#
optional {
?pm20 zbwext:totalDocCount ?docCount .
}
optional {
?pm20 gndo:dateOfBirthAndDeath ?life .
}
optional {
?pm20 zbwext:activity/schema:location ?location .
filter(lang(?location) = ?language)
}
optional {
?pm20 schema:hasOccupation ?occupation .
}
optional {
?pm20 gndo:gndIdentifier ?gndId .
filter(isLiteral(?gndId))
bind (uri(concat('https://d-nb.info/gnd/', ?gndId)) as ?gnd)
bind(?gndId as ?gndLabel)
}
optional {
graph <http://zbw.eu/beta/wikidata/ng> {
optional {
?wd wdt:P4293 ?pm20Id .
bind(strafter(str(?wd), str(wd:)) as ?wdLabel)
}
}
}
bind(if(bound(?docCount), uri(concat('https://pm20.zbw.eu/dfgview/', $pm20Id)), '') as ?doc)
}
group by ?pm20 ?pm20Label ?life ?occupation ?clip ?wd ?wdLabel ?gnd ?gndLabel ?doc ?docCount
order by ?pm20Label