query-49c9ec7eae5048614f68bcd53170a95c

rq turtle/ttl

Notable QuantitiesQuantities listed in other ontologies.

Use at

PREFIX wdtn: <http://www.wikidata.org/prop/direct-normalized/>
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#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
select
  ?quantity
  (sample(?label) as ?label) (sample(?desc) as ?desc)
  (sample(?symbol) as ?symbol)
  (sample(?dim) as ?dim)
  (group_concat(distinct ?unit; separator = ", ") as ?units)
  (group_concat(distinct ?id; separator = ", ") as ?ids)
  (group_concat(distinct ?isoiecItemDate; separator = ", ") as ?isoiec)
  (sample(?gnd) as ?gnd)
where {
  ?quantity wdt:P279+ wd:Q71550118 . # individual quantity
  optional { ?quantity rdfs:label ?label . filter (lang(?label) = "en") }
  optional { ?quantity schema:description ?desc . filter (lang(?desc) = "en") }

  optional { ?quantity wdt:P7973 ?symbol . }
  optional { ?quantity wdt:P4020 ?dim . }
  optional { ?quantity wdt:P8111 / wdt:P5061 ?unit . filter (lang(?unit) = "en") }

  { ?quantity wdt:P7431 ?wl . bind (concat("WL: ", ?wl) as ?id) }
  union
  { ?quantity wdt:P8393 ?qudt . bind (concat("QUDT: ", ?qudt) as ?id) }
  union
  {
    ?isoiec wdt:P629 / wdt:P361 wd:Q568496 .              # any edition of any part of ISO/IEC 80000
    minus { ?isoiec wdt:P1366 / ^wdt:P1343 [] . }         # restrict to the latest edition used anywhere as source
    ?isoiec wdt:P577 ?isoiecDate .
    ?quantity p:P1343 [ ps:P1343 ?isoiec ; pq:P958 ?isoiecItem ] . filter (regex(?isoiecItem, "^([0-9\\-\\.])+$"))
    bind (concat(?isoiecItem, " (", str(year(?isoiecDate)), ")") as ?isoiecItemDate)
  }

  optional {
    ?quantity wdt:P227 ?gndVal ; wdtn:P227 ?gndURI .
    bind (
      strdt(
        concat("<", "math><mtext href='", str(?gndURI), "'>", ?gndVal, "</mtext></math>"),
        <http://www.w3.org/1998/Math/MathML>
      ) as ?gnd
    )
  }
} group by ?quantity

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v17("?desc"):::projected v17("?dim"):::projected v19("?gnd"):::projected v15("?gndURI") v14("?gndVal") v10("?id"):::projected v18("?ids") v19("?isoiec") v12("?isoiecDate") v10("?isoiecItem") v13("?isoiecItemDate"):::projected v17("?label"):::projected v4("?quantity"):::projected v9("?qudt") v17("?symbol"):::projected v1("?unit"):::projected v17("?units") v7("?wl") a4((" ")) a1((" ")) a2((" ")) a3((" ")) a5((" ")) c3(["wd:Q71550118"]):::iri c15(["wd:Q568496"]):::iri v4 --"p:direct/P279"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."rdfs:label".-> v17 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."schema:description".-> v17 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P7973".-> v17 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P4020".-> v17 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P8111".-> a1 a1 --"p:direct/P5061"--> 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; f0[["regex(?isoiecItem,'^(#91;0-9\-\.#93;)+$')"]] f0 --> v10 v19 --"p:direct/P629"--> a2 a2 --"p:direct/P361"--> c15 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v19 --"p:direct/P1366"--> a3 a4 --"p:direct/P1343"--> a3 end v19 --"p:direct/P577"--> v12 a5 --"p:statement/P1343"--> v19 a5 --"p:qualifier/P958"--> v10 v4 --"p:P1343"--> a5 bind2[/"concat(?isoiecItem,' (',str(year-from-dateTime(?isoiecDate)),')')"/] v10 --o bind2 v12 --o bind2 bind2 --as--o v13 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v4 --"p:direct/P8393"--> v9 bind3[/"concat('QUDT: ',?qudt)"/] v9 --o bind3 bind3 --as--o v10 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"p:direct/P7431"--> v7 bind4[/"concat('WL: ',?wl)"/] v7 --o bind4 bind4 --as--o v10 end union0r <== or ==> union0l end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P227".-> v14 v4 --"p:direct-normalized/P227"--> v15 bind5[/"STRDT(concat('<','math><mtext href='',str(?gndURI),''>',?gndVal,'</mtext></math>'),http://www.w3.org/1998/Math/MathML)"/] v15 --o bind5 v14 --o bind5 bind5 --as--o v19 end bind14[/"sample(?label)"/] v17 --o bind14 bind14 --as--o v17 bind15[/"sample(?desc)"/] v17 --o bind15 bind15 --as--o v17 bind16[/"sample(?symbol)"/] v17 --o bind16 bind16 --as--o v17 bind17[/"sample(?dim)"/] v17 --o bind17 bind17 --as--o v17 bind18[/"?unit"/] v1 --o bind18 bind18 --as--o v17 bind19[/"?id"/] v10 --o bind19 bind19 --as--o v18 bind20[/"?isoiecItemDate"/] v13 --o bind20 bind20 --as--o v19 bind21[/"sample(?gnd)"/] v19 --o bind21 bind21 --as--o v19