query-470b2ece139207b8ced4942b216f3369

rq turtle/ttl

Coherent SI Units

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select
  ?unit (sample(?label) as ?label) (sample(?desc) as ?desc)
  (sample(?conversion) as ?conversion) (sample(?symbol) as ?symbol)
  (group_concat(distinct ?quantity; separator = "; ") as ?quantities)
  (sample(?wl) as ?wl) (sample(?ucum) as ?ucum) (sample(?qudt) as ?qudt) (sample(?un) as ?un) (sample(?om) as ?om)
where {
  ?unit wdt:P31 / wdt:P279* wd:Q69197847 .       # coherent SI unit
  optional { ?unit rdfs:label ?label . filter (lang(?label) = "en") }
  optional { ?unit schema:description ?desc . filter (lang(?desc) = "en") }

  optional { ?unit wdt:P2370 ?conversion }       # 1 for every coherent SI unit
  optional { ?unit wdt:P5061 ?symbol . filter (lang(?symbol) = "en") }
  optional { ?unit wdt:P111 / rdfs:label ?quantity . filter (lang(?quantity) = "en") }

  optional { ?unit wdt:P7007 ?wl }
  optional { ?unit wdt:P7825 ?ucum }
  optional { ?unit wdt:P2968 ?qudt }
  optional { ?unit wdt:P6512 ?un }
  optional { ?unit wdt:P8769 ?om }
} group by ?unit

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?conversion"):::projected v12("?desc"):::projected v12("?label"):::projected v13("?om"):::projected v12("?quantities") v1("?quantity"):::projected v13("?qudt"):::projected v12("?symbol"):::projected v13("?ucum"):::projected v13("?un"):::projected v5("?unit"):::projected v13("?wl"):::projected a1((" ")) a2((" ")) c4(["wd:Q69197847"]):::iri v5 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."rdfs:label".-> v12 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:description".-> v12 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P2370".-> v12 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P5061".-> v12 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P111".-> a2 a2 --"rdfs:label"--> v1 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P7007".-> v13 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P7825".-> v13 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P2968".-> v13 end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P6512".-> v13 end subgraph optional9["(optional)"] style optional9 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P8769".-> v13 end bind10[/"sample(?label)"/] v12 --o bind10 bind10 --as--o v12 bind11[/"sample(?desc)"/] v12 --o bind11 bind11 --as--o v12 bind12[/"sample(?conversion)"/] v12 --o bind12 bind12 --as--o v12 bind13[/"sample(?symbol)"/] v12 --o bind13 bind13 --as--o v12 bind14[/"?quantity"/] v1 --o bind14 bind14 --as--o v12 bind15[/"sample(?wl)"/] v13 --o bind15 bind15 --as--o v13 bind16[/"sample(?ucum)"/] v13 --o bind16 bind16 --as--o v13 bind17[/"sample(?qudt)"/] v13 --o bind17 bind17 --as--o v13 bind18[/"sample(?un)"/] v13 --o bind18 bind18 --as--o v13 bind19[/"sample(?om)"/] v13 --o bind19 bind19 --as--o v13