Units of measurements in RDF

Before also this year (2016) comes to its end, I would like to memorize some thoughts on units of measurements in RDF with a clear link to SKOS Shuttle.

RDF and units of measurement seem to be a crowded field, but they are not really. Indeed, a google search on this subject reveals just a couple of links - mainly on QUDT/openPHACTS (on the famous first page), an apparently "lost" ontology file of W3C from 2007, a nice work of wurvoc.org, an (undated... but nice) nice article as a basis for QUDT and some few further links. It is observable that W3C decided up to now not to come up with a set of recommendations for units of measurement in RDF. Mabye too many units? Was SKOS here not enough ? Probably not, since here there is the clear algebraical need to define units of measure. Ontologies are here helpful - they are open documents, new units can be added, obsolete ones removed, other updated upon international standardizations.

By 2016 there seems to be no W3C recommendations on units of measure

What was my focus in defining in RDF a system of units of measurement?

  • Providing clear and well defined units
  • Providing the source of the unit of measure
  • Providing a lean RDF coding
  • Allowing quick change in the specifications

Since this work seems to have properly ontologically defined what is needed to describe units, it can be taken as a basis for the definition of an ontology. What I would like to stress in this short article, is the third point: Providing an appropriate RDF coding for a value in a unit of measure.

As you will probably all know, SKOS Shuttle has already more than 200 units of measure hardcoded in its basis ontology (see below), which when scaled, squared or volumed, give a volume of around 1500 units. The major point was here to provide typed attribute values, which are stored as RDF statements.

As we easily imagine, an attribute can be typed by

As an example imagine to define the area of your house (100) in square metres. Assuming prefix SWO: <https://semweb.ch/onto/> we get the RDF statement:

SWO:1 SWO:attrvalue "100"^^<unitontology#metre/square>

In case we wanted to use a square millimeter unit, this triple would be:

SWO:1 SWO:attrvalue "100"^^<unitontology#metre/milli/square>

Is there a type difference between both attributes? No difference: both are in meters (metre). The operators "milli" and "square" have no influence on the base type (metre).

From an algebraical point of view we observe that metre is at the top of a unit expression path, followed by some further operators on the same path (milli, square) which do not affect the type at the basis.

Yes, but where is unitontology?

The units ontology - in case of SKOS Shuttle - is loaded once into the system to instanciate the units. We do not need quads nor blank node to define a value having a unit of measurement, since all the needed semantics around that unit is encapsulated in the corresponding ontology class.

Conclusion

I liked here to share a couple of details on some implementation choices around typed unit of measures. The main challenge was here to properly type the RDF value so that all information (unit and type!) are stored in one and only one type expression: The resulting RDF statements are lean, not needing additional information as quads or blank nodes. Maybe a good idea to be taken as inspiration for the coming set of recommandations (on units) ?

Thank you for reading - I wish you all a nice jump into another nice year 2017!

Fabio Ricci - Semweb

要查看或添加评论,请登录

Fabio Ricci的更多文章

社区洞察

其他会员也浏览了