forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount_ebds_pub_pers.rq
37 lines (37 loc) · 1.39 KB
/
count_ebds_pub_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
35
36
37
# Statistics about how many EBDS persons are missing a GND link in Wikidata
# and how many enriched publications could be gained by fixing this
#
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#>
PREFIX wd: <http://www.wikidata.org/entity/>
#
select ?pubThreshold
(count(?ebPers) as ?ebPersCount) # all gnd in the ebds dataset
(sum(?ebPubCount) as ?ebPubLinkCount)
#(count(?ebPersWd) as ?ebPersWdCount) # of these, in Wikidata
#(sum(?wdPubCount) as ?ebPersWdPubCount)
(concat(str(round((count(?ebPersWd)/?ebPersCount)*1000)/10), ' %') as ?ebPersWdPct)
(?ebPersCount - count(?ebPersWd) as ?persToDo)
(?ebPubLinkCount - sum(?wdPubCount) as ?pubLinkEnhanced)
where {
values (?pubThreshold) {
( 0 ) ( 1 ) ( 2 ) ( 10 ) ( 30 ) ( 50 ) ( 100 ) ( 150 )
}
graph <http://zbw.eu/beta/wikidata/ebCount/ng> {
?ebPers zbwext:econbizCount ?ebPubCount ;
dcterms:identifier ?gndId .
}
# increase pubThreshold to restrict to more relevant persons
filter(?ebPubCount > ?pubThreshold)
#
# which of these persons are in wikidata?
optional {
?ebPersWd wdt:P227 ?gndId .
}
# count publications of wd persons separately
bind(if(bound(?ebPersWd), ?ebPubCount, 0) as ?wdPubCount)
}
group by ?pubThreshold
order by desc(?pubThreshold)