forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompanies.rq
57 lines (56 loc) · 1.81 KB
/
companies.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
47
48
49
50
51
52
53
54
55
56
# List of all companies/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) ?doc (str(?docCount) as ?docLabel) (str(?repCount) as ?reports)
WHERE {
values ( ?language ) {
( 'de' )
}
?pm20 a zbwext:CompanyFolder ;
skos:prefLabel ?pm20Label ;
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)
#
# only companies with documents
filter(?docCount > 0)
#
# restrict by country notation (see
# http://zbw.eu/beta/skosmos/pm20ag/en/page/157538)
##filter(strstarts(?notation, 'A9') || strstarts(?notation, 'A10')) # Germany
##filter(strstarts(?notation, 'A22')) # UK
##filter(strstarts(?notation, 'A28')) # France
#
optional {
?pm20 zbwext:fromTo ?fromTo .
}
optional {
?pm20 skos:notation ?notation ;
}
optional {
?pm20 zbwext:reportCount ?repCount .
}
optional {
?pm20 frapo:hasCountryCode ?countryCode .
}
# only companies with business reports
##filter(?repCount > 0)
#
bind(uri(concat('https://pm20.zbw.eu/dfgview/', $pm20Id)) as ?doc)
}
group by ?pm20 ?pm20Label ?fromTo ?type ?doc ?docCount ?repCount ?notation
order by ?pm20Label