forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount_by_country.rq
27 lines (26 loc) · 904 Bytes
/
count_by_country.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
# Subject and ware folder count by country
#
PREFIX schema: <http://schema.org/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dct: <http://purl.org/dc/terms/>
#
select ?notation ?country ?countryLabel (str(sum(?shCnt)) as ?shCountLabel)
(str(sum(?waCnt)) as ?waCountLabel)
(str(sum(?docCount)) as ?docs)
where {
?pm20 zbwext:country ?country ;
zbwext:freeDocCount ?docCount .
bind(if(contains(str(?pm20), '/sh/'), 1, 0) as ?shCnt)
bind(if(contains(str(?pm20), '/wa/'), 1, 0) as ?waCnt)
#
graph ?g {
?country dct:identifier ?countryId ;
skos:notation ?notation ;
skos:prefLabel ?countryLabelLang .
filter(lang(?countryLabelLang) = 'de')
bind(str(?countryLabelLang) as ?countryLabel)
}
}
group by ?notation ?country ?countryLabel ?shCount ?waCount
order by desc(sum(?shCnt))