query-ffe8da5e2b317f160654f54d9de48748

rq turtle/ttl

wd:undefined:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?unit ?count ?real_unit ?real_unitLabel
WHERE
{

{
  SELECT ?unit (COUNT(?unit) AS ?count)
  WHERE
  { 
    ?value wikibase:quantityUnit ?unit .
  }
  GROUP BY (?unit)
}  OPTIONAL { ?unit wikibase:sitelinks ?sitelinks . }
  FILTER (! BOUND(?sitelinks))
  BIND (IRI(REPLACE(STR(?unit), "P", "Q")) AS ?real_unit)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?count"):::projected v5("?real_unit"):::projected v1("?sitelinks") v3("?unit"):::projected v2("?value") c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["not bound(?sitelinks)"]] f0 --> v1 v2 --"wikibase:quantityUnit"--> v3 bind2[/"count(?unit)"/] v3 --o bind2 bind2 --as--o v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wikibase:sitelinks".-> v1 end bind3[/"replace(str(?unit),'P','Q')"/] v3 --o bind3 bind3 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end