forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwd_occupation_economist.rq
39 lines (38 loc) · 1.23 KB
/
wd_occupation_economist.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
# Extract information about occupations from PM20 for Wikidata
#
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX wd: <http://www.wikidata.org/entity/>
#
select distinct ?qid ?occupationQid ?pm20 ?pm20Label ?pm20Id ?activity ?docCount
where {
#
values ( ?activity ?occupationQid ) {
( 'Wirtschaftswissenschaft'@de 'Q188094' )
( 'Betriebswirtschaftslehre'@de 'Q1860032' )
( 'Sozialwissenschaft'@de 'Q15319501' )
( 'Geowissenschaft'@de 'Q11424604' )
}
service <https://query.wikidata.org/sparql> {
bind(uri(concat(str(wd:), ?occupationQid)) as ?occupation)
?wd wdt:P4293 ?pm20Id ;
wdt:P31 wd:Q5 .
filter (not exists {
?wd wdt:P106 ?occupation .
}
)
bind(strafter(str(?wd), str(wd:)) as ?qid)
}
bind(uri(concat('https://pm20.zbw.eu/folder/', ?pm20Id)) as ?pm20)
?pm20 a zbwext:PersonFolder ;
skos:prefLabel ?pm20Label ;
zbwext:activity/schema:about ?activity .
optional {
?pm20 zbwext:freeDocCount ?docCount .
}
# apply further restrictions:
# only if folder has documents
###filter(?docCount > 0)
}