query-f86e8ee1e6c6a642f94e6b9bdeed0f27

rq turtle/ttl

Notable UnitsUnits listed in other ontologies.

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)
  (group_concat(distinct ?symbol; separator = ", ") as ?symbols)
  (group_concat(distinct ?quantity; separator = ", ") as ?quantities)
  (sample(?wl) as ?wl) (group_concat(distinct ?ucum; separator = "; ") as ?ucums)
  (sample(?qudt) as ?qudt) (sample(?om) as ?om) (sample(?un) as ?un)
where {
  ?unit wdt:P31 / wdt:P279* wd:Q47574 .  # unit of measurement
  optional { ?unit rdfs:label ?label . filter (lang(?label) = "en") }
  optional { ?unit schema:description ?desc . filter (lang(?desc) = "en") }

  optional { ?unit wdt:P5061 ?symbol . filter (lang(?symbol) = "en") }
  optional { ?unit wdt:P111 / rdfs:label ?quantity . filter (lang(?quantity) = "en") }

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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v11("?desc"):::projected v11("?label"):::projected v14("?om"):::projected v12("?quantities") v1("?quantity"):::projected v14("?qudt"):::projected v2("?symbol"):::projected v11("?symbols") v7("?ucum"):::projected v13("?ucums") v14("?un"):::projected v5("?unit"):::projected v13("?wl"):::projected a1((" ")) a2((" ")) c4(["wd:Q47574"]):::iri v5 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."rdfs:label".-> v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:description".-> v11 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P5061".-> v2 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P111".-> a2 a2 --"rdfs:label"--> v1 end subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P6512"--> v14 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P8769"--> v14 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P2968"--> v14 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P7825"--> v7 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P7007"--> v13 end union0r <== or ==> union0l end bind9[/"sample(?label)"/] v11 --o bind9 bind9 --as--o v11 bind10[/"sample(?desc)"/] v11 --o bind10 bind10 --as--o v11 bind11[/"?symbol"/] v2 --o bind11 bind11 --as--o v11 bind12[/"?quantity"/] v1 --o bind12 bind12 --as--o v12 bind13[/"sample(?wl)"/] v13 --o bind13 bind13 --as--o v13 bind14[/"?ucum"/] v7 --o bind14 bind14 --as--o v13 bind15[/"sample(?qudt)"/] v14 --o bind15 bind15 --as--o v14 bind16[/"sample(?om)"/] v14 --o bind16 bind16 --as--o v14 bind17[/"sample(?un)"/] v14 --o bind17 bind17 --as--o v14