forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompanies_with_reports.rq
47 lines (45 loc) · 1.47 KB
/
companies_with_reports.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
45
46
# List of all organizations
#
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX schema: <http://schema.org/>
PREFIX frapo: <http://purl.org/cerif/frapo/>
#
SELECT ?type ?pm20 ?pm20Label ?fromTo ?notation (group_concat(distinct str(?industry);
separator='; ') as ?industries) (group_concat(distinct ?countryCode;
separator='; ') as ?countries) ?reports (str(?repCount) as ?reportsLabel)
WHERE {
values ( ?language ) {
( 'de' )
}
?pm20 a zbwext:CompanyFolder ;
skos:prefLabel ?pm20Label ;
zbwext:broaderLocation ?broaderLocation ;
schema:industry ?industry ;
dc:type ?typeLang ;
dct:identifier ?pm20Id ;
zbwext:freeDocCount ?docCount .
filter(lang(?typeLang) = ?language)
filter(lang(?industry) = ?language)
bind(str(?typeLang) as ?type)
#
optional {
?pm20 zbwext:fromTo ?fromTo .
}
optional {
?pm20 skos:notation ?notation ;
}
optional {
?pm20 frapo:hasCountryCode ?countryCode .
}
# only companies with reports
?pm20 zbwext:reportCount ?repCount .
filter(?repCount > 0)
bind(uri(concat('https://pm20.zbw.eu/dfgview/', $pm20Id)) as ?reports)
}
group by ?pm20 ?pm20Label ?fromTo ?notation ?type ?reports ?repCount
order by ?pm20Label