forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsk_for_openrefine.rq
42 lines (41 loc) · 1.32 KB
/
sk_for_openrefine.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
# Create a table of sk entries for OpenRefine
# (sk = Wirtschaftsklassifikation)
#
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
PREFIX schema: <http://schema.org/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX gndo: <https://d-nb.info/standards/elementset/gnd#>
#
select distinct (str(?count) as ?cnt) ?id ?notation ?labelDe ?desc
where {
graph <http://zbw.eu/beta/sk/ng> {
?s skos:prefLabel ?labelLangEn ;
dct:identifier ?id ;
skos:notation ?notation .
filter(lang(?labelLangEn) = 'en')
bind(str(?labelLangEn) as ?labelEn)
?s skos:prefLabel ?labelLangDe .
filter(lang(?labelLangDe) = 'de')
bind(str(?labelLangDe) as ?labelDe)
#
?broader skos:narrower ?s ;
skos:prefLabel ?broaderLangEn .
filter(lang(?broaderLangEn) = 'en')
bind(str(?broaderLangEn) as ?broaderEn)
}
{
select (count(distinct ?pm20) as ?count) ?labelLangEn
where {
?pm20 a zbwext:CompanyFolder ;
schema:industry ?labelLangEn ;
zbwext:totalDocCount ?docCount .
filter(lang(?labelLangEn) = 'en')
#filter(?totalDocCount > 0)
}
group by ?labelLangEn
}
bind(concat(?labelEn, " (BT: ", ?broaderEn, ")") as ?desc)
}
order by ?notation ?broaderEn ?id