forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
count_ebds_pers_by_authority.rq
44 lines (44 loc) · 1.48 KB
/
count_ebds_pers_by_authority.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
# Count properties used for authority control for economics-related gnd persons
# (from a prototype of the econbiz research dataset)
#
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
#
select (count(distinct ?item) as ?economistCount) ?property ?propertyLabel
where {
# get all persons identified by gnd from ebds
graph <http://zbw.eu/beta/wikidata/ebCount/ng> {
?econPers zbwext:econbizCount ?ebPubCount ;
dcterms:identifier ?gndId .
}
# get the according wikidata items
?item wdt:P227 ?gndId .
#
# get all properties for authority control
{
select distinct ?property (str(?label) as ?propertyLabel) ?propertyDirect
where {
values (?authPropType) {
# Wikidata property for authority control
(wd:Q18614948)
}
{
?property wdt:P31 ?authPropType .
} union {
?type wdt:P279 ?authPropType .
?property wdt:P31 ?type .
}
?property rdfs:label ?label
filter(lang(?label) = 'en')
bind(uri(concat('http://www.wikidata.org/prop/direct/', strafter(str(?property), '/entity/'))) as ?propertyDirect)
}
}
# items using those properties
?item ?propertyDirect [] .
}
group by ?property ?propertyLabel
order by desc(?economistCount)