forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nace.rq
35 lines (34 loc) · 1.03 KB
/
nace.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
# List of items with NACE codes
#
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#
select distinct ?naceCode ?wd ?wdLabel (str(count(?company)) as ?companyCount)
where {
hint:Query hint:optimizer "None" .
#
?wd wdt:P4496 ?naceCode .
#
# restrict to (subtypes of) economic activity
## filter(exists {
## filter(not exists {
## ?wd wdt:P31/wdt:P279* wd:Q8187769 .
## })
#
# uses as industry (P452) for companies etc.
optional {
?company wdt:P452 ?wd .
}
#
service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr". }
}
group by ?naceCode ?wd ?wdLabel
order by ?naceCode