query-140526bd0091dfe38d012c298acab236

rq turtle/ttl

This query finds all WD items used as "industry" and returns their NACE and SIC codes: The NACE hierarchy is an excellent way to organize and flesh out the WD Industry hierarchy

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?ind ?indLabel ?sic ?nace ?c {
  {select ?ind (count(*) as ?c) {?x wdt:P452 ?ind} group by ?ind}
  optional {?ind wdt:P3242 ?sic}
  optional {?ind wdt:P3242 ?nace}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,de,fr,it,ru,nn,no,nl,ja" }
} order by desc(?c)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?c"):::projected v3("?ind"):::projected v5("?nace"):::projected v4("?sic"):::projected v2("?x") c6(["en,de,fr,it,ru,nn,no,nl,ja"]):::literal c4(["bd:serviceParam"]):::iri v2 --"wdt:P452"--> v3 bind1[/"count(*)"/] bind1 --as--o v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P3242".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P3242".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end