query-c9edd69d99dd87bb1fffb6c6256321ac

rq turtle/ttl

Quantity-Valued

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select
  ?property
  (sample(?label) as ?label)
  (sample(?quantity) as ?quantity)
  (sample(?quantityLabel) as ?quantityLabel)
  (sample(?symbol) as ?symbol)
  (sample(?dim) as ?dim)
  (group_concat(distinct ?recommendedUnit; separator = ", ") as ?recommendedUnits)
where {
  ?property wikibase:propertyType wikibase:Quantity .
  optional { ?property rdfs:label ?label . filter (lang(?label) = "en") }
  optional {
    ?property wdt:P1629 ?quantity . ?quantity wdt:P279+ wd:Q71550118 .
    optional { ?quantity rdfs:label ?quantityLabel . filter (lang(?quantityLabel) = "en") }
    optional { ?quantity wdt:P7973 ?symbol . }
    optional { ?quantity wdt:P4020 ?dim . }
    optional { ?quantity wdt:P8111 / wdt:P5061 ?recommendedUnit . filter (lang(?recommendedUnit) = "en") }
  }
} group by ?property

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?dim"):::projected v8("?label"):::projected v2("?property"):::projected v8("?quantity"):::projected v8("?quantityLabel"):::projected v3("?recommendedUnit"):::projected v8("?recommendedUnits") v8("?symbol"):::projected a1((" ")) c3(["wikibase:Quantity"]):::iri c7(["wd:Q71550118"]):::iri v2 --"wikibase:propertyType"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."rdfs:label".-> v8 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1629".-> v8 v8 --"wdt:P279"--> c7 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v8 -."rdfs:label".-> v8 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P7973".-> v8 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P4020".-> v8 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P8111".-> a1 a1 --"wdt:P5061"--> v3 end end bind6[/"sample(?label)"/] v8 --o bind6 bind6 --as--o v8 bind7[/"sample(?quantity)"/] v8 --o bind7 bind7 --as--o v8 bind8[/"sample(?quantityLabel)"/] v8 --o bind8 bind8 --as--o v8 bind9[/"sample(?symbol)"/] v8 --o bind9 bind9 --as--o v8 bind10[/"sample(?dim)"/] v8 --o bind10 bind10 --as--o v8 bind11[/"?recommendedUnit"/] v3 --o bind11 bind11 --as--o v8