Template:Value in SI unit
Jump to navigation
Jump to search
Help:Partial query to convert a quantity with an arbitrary unit to its value in the relevant SI unit.
Usage[edit]
{{Value in SI unit|?Paris|area|ParisArea}}
?Paris p:P2046 ?ParisstatementP2046 . ?ParisstatementP2046 psv:P2046 ?ParisnodeP2046 . ?ParisnodeP2046 wikibase:quantityAmount ?ParisareaP2046 . ?ParisnodeP2046 wikibase:quantityUnit ?ParisunitP2046. ?ParisunitP2046 wdt:P2370 ?ParisP2046conversionSI . BIND(?ParisareaP2046*?ParisP2046conversionSI AS ?ParisArea)
{{SPARQL|query=select ?ParisArea where { {{tl|Value in SI unit|?Paris|area|ParisArea}} . bind(wd:Q90 as ?Paris) . } }}
select ?ParisArea where {
?Paris p:P2046 ?ParisstatementP2046 .
?ParisstatementP2046 psv:P2046 ?ParisnodeP2046 .
?ParisnodeP2046 wikibase:quantityAmount ?ParisareaP2046 .
?ParisnodeP2046 wikibase:quantityUnit ?ParisunitP2046.
?ParisunitP2046 wdt:P2370 ?ParisP2046conversionSI .
BIND(?ParisareaP2046*?ParisP2046conversionSI AS ?ParisArea) . bind(wd:Q90 as ?Paris) . }
See also[edit]
For property/units not normalized, compute the conversion in the SI unit
Parameter | Description | Type | Status | |
---|---|---|---|---|
item | 1 | The subject item of the statement, either a variable or an item Qid
| Page name | required |
property | 2 | A quantity valued property, Pid or english label
| Unknown | optional |
value name | 3 | the name of the variable with the quantity expressed in SI unit | Unknown | optional |
The above documentation is transcluded from Template:Value in SI unit/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |
?item p: ?item . ?item psv: ?item . ?item wikibase:quantityAmount ?item . ?item wikibase:quantityUnit ?item. ?item wdt:P2370 ?item . BIND(?item*?item AS ?resultSI)