forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount_econ_pers.rq
34 lines (34 loc) · 1.74 KB
/
count_econ_pers.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
# Statistics about economics-related gnd persons (from econ_pers dataset)
# and how many of them are in wikidata
#
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
#
select
(count(?econPers) as ?econPersCount) # all gnd in the econ_pers dataset
(count(?econPersWd) as ?econPersWdCount) # of these, in Wikidata
(concat(str(round((?econPersWdCount/?econPersCount)*1000)/10), ' %') as ?econPersWdPct)
(sum(?ebPers) as ?ebPersCount) # all gnd used in EconBiz
(sum(?ebPersWd) as ?ebPersWdCount) # of these, in Wikidata
(concat(str(round((?ebPersWdCount/?ebPersCount)*1000)/10), ' %') as ?ebPersWdPct)
(sum(?freqEbPers) as ?freqEbPersCount) # gnd more than 10 times in EconBiz
(sum(?freqEbPersWd) as ?freqEbPersWdCount) # of these, in Wikidata
(concat(str(round((?freqEbPersWdCount/?freqEbPersCount)*1000)/10), ' %') as ?freqEbPersWdPct)
(sum(?topEbPers) as ?topEbPersCount) # gnd more than 50 times in EconBiz
(sum(?topEbPersWd) as ?topEbPersWdCount) # of these, in Wikidata
(concat(str(round((?topEbPersWdCount/?topEbPersCount)*1000)/10), ' %') as ?topEbPersWdPct)
where {
service <https://zbw.eu/beta/sparql/econ_pers/query> {
?econPers zbwext:econbizCount ?ebPublicationCount .
bind(if((?ebPublicationCount > 0), 1, 0) as ?ebPers) .
bind(if((?ebPublicationCount > 10), 1, 0) as ?freqEbPers) .
bind(if((?ebPublicationCount > 50), 1, 0) as ?topEbPers) .
}
bind(strafter(str(?econPers), '/gnd/') as ?gndId)
optional {
?econPersWd wdt:P227 ?gndId .
}
bind(if((?ebPers = 1 && bound(?econPersWd)), 1, 0) as ?ebPersWd) .
bind(if((?freqEbPers = 1 && bound(?econPersWd)), 1, 0) as ?freqEbPersWd) .
bind(if((?topEbPers = 1 && bound(?econPersWd)), 1, 0) as ?topEbPersWd) .
}