Wikidata:Property proposal/Wolfram Language unit code

Wolfram Language unit code edit

Originally proposed at Wikidata:Property proposal/Authority control

Descriptioninput form for a unit of measurement in the Wolfram Language
Representsunit of measurement (Q47574)
Data typeString
Domainitem, unit of measurement (Q47574)
Allowed valuesstring, product, division, power, HoldForm[...]
Example 1metre (Q11573) → "Meters"
Example 2metre per second (Q182429) → "Meters" / "Seconds"
Example 3joule per cubic metre kelvin (Q3186734) → "Joules" / ("Meters"^3 * "KelvinsDifference")
Planned useBuild Wolfram Language (Q15241057) applications that represent values of type "quantity" as Quantity[magnitude, unit]. For instance, the mass (P2067) of Earth (Q2) is Quantity[5972.37, "Yottagrams"]. Without a mapping from Wikidata IDs to Wolfram Language units one could alternatively use the English label and rely on the Quantity parser, as in Quantity[1, "yottagram"] -> Quantity[1, "Yottagrams"], but this is fragile (especially for uncommon units) and potentially slow.
See alsoWolfram Language entity code (P4839)

Motivation edit

This property will allow representing a value of type "quantity" as a Wolfram Language (Q15241057) native Quantity[magnitude, unit] object. It will facilitate the creation of WL applications because developers won't have to maintain their own mapping of Wikidata IDs to WL units. There are currently over 5000 unit of measurement (Q47574) in Wikidata:

SELECT ?unit ?unitLabel WHERE {
  ?unit wdt:P31/wdt:P279* wd:Q47574.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Some or all of them can potentially appear as the unit of a value and are therefore relevant for this property.

Toni 001 (talk) 10:59, 26 June 2019 (UTC)[reply]

Discussion edit

  Done @Toni 001, ArthurPSmith, Ysangkok, DannyS712: created as Wolfram Language unit code (P7007). Enjoy! --99of9 (talk) 11:54, 18 July 2019 (UTC)[reply]