Tabular content (UoM)
This page describes some typical SPARQL queries over the Unit of Measure ontology module. Any SELECT query will return a table of results.
Visit the Fuseki page to experiment with these queries yourself!
Like most SPARQL servers, Fuseki can provide tabular results as plain text in CSV and TSV format (filetypes text/csv and text/tab-separated-values), as well as JSON (filetype application/sparql-results+json) and XML (filetype application/sparql-results+xml).
To get started, we request a list of units of measure, retrieving for
each of them the identifier of the resource in the ontology, which
will be a Uniform Resource Identifier (URI), and its name, which will
be a string. Names are, as is common practice, assigned using the
rdfs:label
RDF property.
In the UoM ontology, a unit of measure is a member of the ISO 15926-14 class lis:Scale, so this is what we’ll query for.
Writinglis:Scale
is a convenient abbreviation for https://rds.posccaesar.org/ontology/lis14/rdl/Scale. The stringlis:
is called a prefix, and a prefixed URI likelis:Scale
is sometimes called a “puri” (see here).
The following query specifies no sort order, so the particular list of results is likely to vary between runs – we are only asking for an arbitrary five.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?uom ?uom_label {
?uom a lis:Scale ; rdfs:label ?uom_label
}
limit 5
On this page, we will use prefixed URIs to prevent long identifiers from making the result tables hard to read. Use the tabs below to compare the two; the following examples will only have the abbreviated form.
uom | uom_label |
---|---|
rdl:PCA_100003716 | pascal |
rdl:PCA_100003721 | square metre |
rdl:PCA_100003698 | megawatt |
rdl:PCA_100003707 | millisecond |
rdl:PCA_100003719 | second (angle) |
To find a selection of units, we can apply a filter
. This query uses
the SPARQL regex
function to select only those units where the string
“metre” appears in the name. We apply alphabetical order to the output
table, with an order by
clause.
Note the use ofa
in?uom a lis:Scale
, which simply is a built-in shorthand forrdf:type
.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?uom ?uom_label {
?uom a lis:Scale ; rdfs:label ?uom_label
filter( regex( ?uom_label, "metre" ))
}
order by ?uom_label
limit 5
uom | uom_label |
---|---|
rdl:PCA_100003663 | centimetre |
rdl:PCA_100003664 | cubic decimetre |
rdl:PCA_100003665 | cubic metre |
rdl:PCA_100003666 | cubic metre per second |
rdl:PCA_100003670 | decimetre |
In the UoM ontology, a quantity, such as density or volume, is a
subclass of the ISO 15926-14 class lis:PhysicalQuantity. The following
query is very similar to the previous one, but uses rdfs:subClassOf
instead of rdf:type
.
This query has a slightly more sophisticated filter, using ||
to allow
quantities with “density” or “volume” in the name.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?quantity ?quantity_label {
?quantity rdfs:subClassOf lis:PhysicalQuantity ; rdfs:label ?quantity_label
filter( regex( ?quantity_label, "density" ) || regex( ?quantity_label, "volume" ) )
}
order by ?quantity_label
limit 5
quantity | quantity_label |
---|---|
rdl:PCA_100003569 | current density |
rdl:PCA_100003570 | density |
rdl:PCA_100003588 | magnetic flux density |
rdl:PCA_100003605 | volume |
rdl:PCA_100003606 | volumetric flow rate |
Many (but not all) quantities in the UoM ontology have a default unit of measure assigned to them. The following query retrieves quantities together with default units.
Note the use in the query of rdl:PCA_100000510
, which is the
identifier for the default unit of measure
relation (an OWL annotation
property). We need to use this uninformative identifer, as SPARQL will
not by itself pick out the right relation from its given name.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?quantity ?quantity_label ?default_uom ?default_uom_label {
?quantity rdfs:subClassOf lis:PhysicalQuantity ; rdfs:label ?quantity_label .
?quantity rdl:PCA_100000510 ?default_uom . # "default unit of measure"
?default_uom a lis:Scale ; rdfs:label ?default_uom_label .
filter( regex( ?quantity_label, "density" ) || regex( ?quantity_label, "volume" ) )
}
order by ?quantity_label
limit 5
quantity | quantity_label | default_uom | default_uom_label |
---|---|---|---|
rdl:PCA_100003570 | density | rdl:PCA_100003685 | kilogram per cubic metre |
rdl:PCA_100003588 | magnetic flux density | rdl:PCA_100003723 | tesla |
rdl:PCA_100003605 | volume | rdl:PCA_100003665 | cubic metre |
Many (but not all) quantities and units of measure in the UoM ontology
have symbols assigned to them, using the om:symbol annotation
property. The following query is an example. Here, we have left out
the identifiers from the select
list of variables to keep the table tidy.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
PREFIX om: <http://www.ontology-of-units-of-measure.org/resource/om-2/>
select ?quantity_label ?quantity_symbol ?default_uom_label ?default_uom_symbol {
?quantity rdfs:subClassOf lis:PhysicalQuantity ; rdfs:label ?quantity_label ;
om:symbol ?quantity_symbol .
?quantity rdl:PCA_100000510 ?default_uom . # "default unit of measure"
?default_uom a lis:Scale ; rdfs:label ?default_uom_label ;
om:symbol ?default_uom_symbol
filter( regex( ?quantity_label, "density" ) || regex( ?quantity_label, "volume" ) )
}
order by ?quantity_label
limit 5
Each of the quantities (subclasses of lis:PhysicalQuantity) in the UoM ontology is assigned a lis:ScalarQuantityDatum class. Any member of such a datum type will have at least two pointers – to a unit of measure, and to a numeric value. For details, see the more advanced queries below; here, we simply retrieve a list datum classes.
This query is similar to that of section Units of measure – filtering
by name above, filtering on the term “electric” (but note that the
relation is rdfs:subClassOf
, not rdf:type
).
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?datum ?datum_label {
?datum rdfs:subClassOf lis:ScalarQuantityDatum ; rdfs:label ?datum_label
filter( regex( ?datum_label, "electric" ))
}
order by ?datum_label
limit 5
datum | datum_label |
---|---|
rdl:PCA_100003640 | electric charge datum |
rdl:PCA_100003609 | electric current datum |
rdl:PCA_100003628 | electric potential datum |
rdl:PCA_100003629 | electrical resistance datum |
Each type of physical quantity datum will in general be related by the applicable unit of measure annotation property to a selection of units. This allows us to extend the previous query with a list of units for each datum type.
The annotation applicable unit of measure is a “convenience” annotation that allows for simple browsing and querying of units as related to quantities. There are also semantic restrictions to validate the correct use of units – for more information, see Advanced SELECT queries: Using ontology restrictions.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?datum ?datum_label ?applicable_uom ?applicable_uom_label {
?datum rdfs:subClassOf lis:ScalarQuantityDatum ; rdfs:label ?datum_label .
filter( regex( ?datum_label, "electric" ))
?datum rdl:PCA_100003769 ?applicable_uom . # "applicable uom"
?applicable_uom rdfs:label ?applicable_uom_label
}
order by ?datum_label
limit 5
datum | datum_label | applicable_uom | applicable_uom_label |
---|---|---|---|
rdl:PCA_100003640 | electric charge datum | rdl:PCA_100003658 | ampere hour |
rdl:PCA_100003609 | electric current datum | rdl:PCA_100003657 | ampere |
rdl:PCA_100003609 | electric current datum | rdl:PCA_100003683 | kiloampere |
rdl:PCA_100003609 | electric current datum | rdl:PCA_100003703 | milliampere |
rdl:PCA_100003628 | electric potential datum | rdl:PCA_100003724 | volt |
In some cases, you will know precisely which resources you wish to query. The following query illustrates how the SPARQL values syntax allows you to provide an explicit, “inline” list of quantities.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
select ?datum ?datum_label ?applicable_uom ?applicable_uom_label {
values ?datum { rdl:PCA_100003609 rdl:PCA_100003628 } # electric current datum ; electric potential datum
?datum rdfs:label ?datum_label .
?datum rdl:PCA_100003769 ?applicable_uom . # "applicable uom"
?applicable_uom rdfs:label ?applicable_uom_label
}
order by ?datum_label
limit 5
datum | datum_label | applicable_uom | applicable_uom_label |
---|---|---|---|
rdl:PCA_100003609 | electric current datum | rdl:PCA_100003657 | ampere |
rdl:PCA_100003609 | electric current datum | rdl:PCA_100003683 | kiloampere |
rdl:PCA_100003609 | electric current datum | rdl:PCA_100003703 | milliampere |
rdl:PCA_100003628 | electric potential datum | rdl:PCA_100003724 | volt |
The PLM-RDL is an OWL 2 ontology, which means that the type of the resources (classes, relations, individuals) it contains has a fixed meaning. The representation of meaning extends to various restrictions on the resources, not just on domain and range of relations, but also to class relationships, which can be quite complex. The restrictions are exploited in automated reasoning; see, e.g., this page for some characteristic examples.
To make full use of the UoM ontology in queries, we need to know how the OWL restrictions between quantities, datum types, and units are represented, and construct our SPARQL queries to match. We are helped by the fact that SPARQL syntax is very close to the common Turtle format for RDF, which is a readily available format for OWL. This section provides some examples.
In this example, we select electric current and energy as our quantities of interest, and ask: which units of measure can be meaningfully used to represent values of these quantities?
This query will extend on the simpler approach of Datum types and applicable units, taking the quantity as the point of departure instead of the physical quantity datum type.
To answer this, first observe that we need to follow certain constraints on the resources involved.
On the web page of the quantity energy, for example, the section Constraints tells us that this quantity is
qualityQuantifiedAs only energy datum
We can use the web browser and navigate to an item under Metadata for an applicable unit of measure, take for instance the unit joule. On the joule page, we find in the section Context, tab Types, this complex constraint:
inverse datumUOM only energy datum
This means we have a path via semantic constraints from the quantity to the unit of measure.
The query needs two steps,
- from a quantity, find the datum type permitted for quantifying values
- from the datum type, find the unit(s) permitted for the datum type
We need to look into the construction of the ontology to understand how the relevant restrictions can be queried.
See the page Query for graph content for instructions on how to inspect the details of resources in the ontology, such as is shown in the Turtle code examples below.
In the ontology, the first restriction we are after, between a quantity and the suitable datum type, is given in an OWL object property restriction. In the ontology source code, it looks like this (Turtle format):
rdl:PCA_100003578 a owl:Class ;
rdfs:label "energy" ;
rdfs:subClassOf [ a owl:Restriction ;
# rdl:PCA_100003625 is "energy datum"
owl:allValuesFrom rdl:PCA_100003625 ;
owl:onProperty lis:qualityQuantifiedAs
] .
The second restriction, which says the joule unit may only be used for
energy datum, has an “inverse” part which makes it one step more
intricate. Note carefully, since a unit is not a class, but an OWL
individual, the relation from the unit to the restriction is rdf:type
,
abbreviated as usual with a
.
rdl:PCA_100003681 a owl:NamedIndividual , lis:Scale ;
a [ a owl:Restriction ;
owl:allValuesFrom rdl:PCA_100003625 ;
owl:onProperty [ owl:inverseOf lis:datumUOM ] ] .
Our SPARQL query will mimic the structure of the code examples above quite literally.
In the query, we apply a values clause listing the resources of interest, as described in the section Inline data: explicit lists using SPARQL values.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
PREFIX om: <http://www.ontology-of-units-of-measure.org/resource/om-2/>
select ?quantity ?quantity_label ?datum_type ?datum_type_label ?uom ?uom_label {
values ?quantity {
rdl:PCA_100003574 # electric current
rdl:PCA_100003578 # energy
}
?quantity rdfs:label ?quantity_label ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom ?datum_type ;
owl:onProperty lis:qualityQuantifiedAs ] .
?datum_type rdfs:label ?datum_type_label .
?uom rdfs:label ?uom_label ;
a [ a owl:Restriction ;
owl:allValuesFrom ?datum_type ;
owl:onProperty [ owl:inverseOf lis:datumUOM ] ] .
}
order by ?quantity_label
limit 5
quantity | quantity_label | datum_type | datum_type_label | uom | uom_label |
---|---|---|---|---|---|
rdl:PCA_100003574 | electric current | rdl:PCA_100003609 | electric current datum | rdl:PCA_100003657 | ampere |
rdl:PCA_100003574 | electric current | rdl:PCA_100003609 | electric current datum | rdl:PCA_100003703 | milliampere |
rdl:PCA_100003574 | electric current | rdl:PCA_100003609 | electric current datum | rdl:PCA_100003683 | kiloampere |
rdl:PCA_100003578 | energy | rdl:PCA_100003625 | energy datum | rdl:PCA_100003681 | joule |
rdl:PCA_100003578 | energy | rdl:PCA_100003625 | energy datum | rdl:PCA_100003713 | newton metre |
Using a SPARQL service
clause, we can write a federated query – a
query that retrieves data not just from the PLM-RDL endpoint, but also
from an “external” endpoint.
In the following sections, we illustrate how this query mechanism allows us to enrich the results of PLM-RDL queries with content from different, complementary sources.
A detailed account of how this query is assembled will be added as soon as time permits.
Show the SPARQL query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX pca: <http://data.posccaesar.org/rdl/>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX pav: <http://purl.org/pav/>
PREFIX om: <http://www.ontology-of-units-of-measure.org/resource/om-2/>
PREFIX qudt: <http://qudt.org/schema/qudt/>
PREFIX quantitykind: <http://qudt.org/vocab/quantitykind/>
PREFIX unit: <http://qudt.org/vocab/unit/>
select distinct ?quantity_label ?uom_label ?iec61360Code ?conversionMultiplier ?qudt_uom
{
values ?quantity_label { "length" }
?quantity rdfs:subClassOf lis:PhysicalQuantity ;
rdfs:label ?quantity_label ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom ?datum_type ;
owl:onProperty lis:qualityQuantifiedAs ] .
?datum_type rdfs:label ?datum_type_label .
?uom rdfs:label ?uom_label ;
a [ a owl:Restriction ;
owl:allValuesFrom ?datum_type ;
owl:onProperty [ owl:inverseOf lis:datumUOM ] ] .
optional {
?uom skos:exactMatch ?qudt_uom . ?qudt_uom rdfs:isDefinedBy rdl:PCA_100003771 . # QUDT entities
service <http://www.qudt.org/fuseki/qudt/sparql> {
?qudt_uom a qudt:Unit .
optional { ?qudt_uom qudt:iec61360Code ?iec61360Code }
optional {
?qudt_uom #qudt:isScalingOf? ?baseUnit ;
qudt:conversionMultiplier ?conversionMultiplier .
}
}
}
}
order by desc (?conversionMultiplier)
quantity_label | uom_label | iec61360Code | conversionMultiplier | qudt_uom |
---|---|---|---|---|
length | kilometre | 1000.0 | http://qudt.org/vocab/unit/KiloM | |
length | metre | 0112/2///62720#UAA726 | 1.0 | http://qudt.org/vocab/unit/M |
length | foot (international) | 0112/2///62720#UAA440 | 0.3048 | http://qudt.org/vocab/unit/FT |
length | decimetre | 0112/2///62720#UAA412 | 0.1 | http://qudt.org/vocab/unit/DeciM |
length | inch (international) | 0112/2///62720#UAA539 | 0.0254 | http://qudt.org/vocab/unit/IN |
length | centimetre | 0112/2///62720#UAA375 | 0.01 | http://qudt.org/vocab/unit/CentiM |
length | millimetre | 0112/2///62720#UAA862 | 0.001 | http://qudt.org/vocab/unit/MilliM |
length | micrometre | 0112/2///62720#UAA090 | 0.000001 | http://qudt.org/vocab/unit/MicroM |
length | Angstroem | |||
length | foot pound per pound | |||
length | micrometre peak-to-peak | |||
length | nanometre | |||
length | parsec |
The QUDT.org organization provides an extensive, general ontology of quantities and units of measure. The QUDT ontology provides a range of information that the PLM-RDL UoM module does not aim to cover.
The PLM-RDL quantities and units are provided with pointers to similar resources in QUDT where these have been possible to identify.
The following query retrieves units of measure from an explicit list of names, with their quantity types and symbols. Some of the names will not be found to match any unit in the UoM module, so we use OPTIONAL clauses liberally to show empty cells where there is no information to be found.
A detailed account of how this query is assembled will be added as soon as time permits.
Show the SPARQL query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX pca: <http://data.posccaesar.org/rdl/>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
PREFIX rdl: <http://rds.posccaesar.org/ontology/plm/rdl/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX pav: <http://purl.org/pav/>
PREFIX om: <http://www.ontology-of-units-of-measure.org/resource/om-2/>
PREFIX qudt: <http://qudt.org/schema/qudt/>
PREFIX quantitykind: <http://qudt.org/vocab/quantitykind/>
PREFIX unit: <http://qudt.org/vocab/unit/>
select ?uom ?uom_l ?quantity ?quantity_l ?uom_symbol
(group_concat(?System_l; separator=", ") as ?System_from_QUDT)
(group_concat(?iec61360Code; separator=", ") as ?IEC61360_from_QUDT)
{
# sample list of UoM names
values ?uom_l { "bar absolute" "revolution per minute" "farad" "ampere hour" "piece"
"kilogram per cubic metre" "pound per cubic foot" "ampere" "kiloampere" "kilonewton"
"newton" "hertz" "milliampere per bar" "foot (international)" "inch (international)" }
# put the entire query in "optional" to show the non-matches clearly
optional { ?uom a lis:Scale ; rdfs:label ?uom_l
# get symbol and quantity, via datum type
{ optional { ?uom om:symbol ?uom_symbol }
optional {
?uom a [ a owl:Restriction ; owl:onProperty [ owl:inverseOf lis:datumUOM ] ; owl:allValuesFrom ?datum ] .
?datum rdfs:subClassOf [ a owl:Restriction ; owl:onProperty lis:quantifiesQuality ; owl:allValuesFrom ?quantity ] .
?quantity rdfs:label ?quantity_l
}}
# use QUDT match, where found, to show system and cdd code
optional {
?uom skos:exactMatch ?qudt_uom . ?qudt_uom rdfs:isDefinedBy rdl:PCA_100003771 . # QUDT entities
optional { service <http://www.qudt.org/fuseki/qudt/sparql> {
optional { ?qudt_uom qudt:iec61360Code ?iec61360Code }
optional {
# uncomment if you want all related systems
# ?unitOfSystem rdfs:subPropertyOf* qudt:unitOfSystem . ?qudt_uom ?unitOfSystem ?System .
?qudt_uom qudt:unitOfSystem ?System .
?System qudt:abbreviation ?System_l
}
}}
}
}
}
group by ?uom ?uom_l ?quantity ?quantity_l ?uom_symbol
order by ?uom_l
limit 30
uom | uom_l | quantity | quantity_l | uom_symbol | System_from_QUDT | IEC61360_from_QUDT |
---|---|---|---|---|---|---|
rdl:PCA_100003657 | ampere | rdl:PCA_100003574 | electric current | A | SI, SI | 0112/2///62720#UAD717, 0112/2///62720#UAA101 |
rdl:PCA_100003658 | ampere hour | rdl:PCA_100003573 | electric charge | A h | CGS | 0112/2///62720#UAA102 |
rdl:PCA_100003648 | bar absolute | rdl:PCA_100003596 | pressure | bara | ||
rdl:PCA_100003674 | farad | rdl:PCA_100003567 | capacitance | F | CGS | 0112/2///62720#UAA144 |
rdl:PCA_100003675 | foot (international) | rdl:PCA_100003585 | length | ft | US Customary, Imperial | 0112/2///62720#UAA440, 0112/2///62720#UAA440 |
rdl:PCA_100003678 | hertz | rdl:PCA_100003580 | frequency | Hz | 0112/2///62720#UAA170 | |
rdl:PCA_100003680 | inch (international) | rdl:PCA_100003585 | length | in | US Customary, Imperial | 0112/2///62720#UAA539, 0112/2///62720#UAA539 |
rdl:PCA_100003683 | kiloampere | rdl:PCA_100003574 | electric current | kA | 0112/2///62720#UAA557 | |
rdl:PCA_100003685 | kilogram per cubic metre | rdl:PCA_100003570 | density | kg/m3 | 0112/2///62720#UAA619 | |
rdl:PCA_100003690 | kilonewton | rdl:PCA_100003579 | force | kN | 0112/2///62720#UAA573 | |
milliampere per bar | ||||||
rdl:PCA_100003712 | newton | rdl:PCA_100003579 | force | N | 0112/2///62720#UAA235 | |
piece | ||||||
pound per cubic foot | ||||||
rdl:PCA_100003655 | revolution per minute | rdl:PCA_100003580 | frequency | rpm | 0112/2///62720#UAB231 |
Using the SERVICE
keyword, a query that combines PLM RDL data with
Wikidata resources is possible. The following table shows formulae
that describe a selection of quantities.
To be updated with a full query description.