forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwd_person_family.rq
31 lines (31 loc) · 1.14 KB
/
wd_person_family.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
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX gnd: <https://d-nb.info/gnd/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
#
select ?wdfamilyQid ?wdpersonQid (?pm20familyId as ?pm20Id) ?pm20Label
where {
?pm20family a gndo:Family ;
dct:identifier ?pm20familyId ;
skos:prefLabel ?pm20Label ;
dct:hasPart ?pm20person .
service <https://query.wikidata.org/sparql> {
?wdfamily wdt:P4293 ?pm20familyId .
}
bind(strafter(str(?pm20person), 'https://pm20.zbw.eu/folder/') as ?pm20personId)
service <https://query.wikidata.org/sparql> {
?wdperson wdt:P31 wd:Q5 ;
wdt:P4293 ?pm20personId .
filter(not exists {
?wdperson wdt:P53 [] .
}
)
}
bind(strafter(str(?wdfamily), str(wd:)) as ?wdfamilyQid)
bind(strafter(str(?wdperson), str(wd:)) as ?wdpersonQid)
}