Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
measurement_units [2012/12/01 14:46] – [Literature] tenorthmeasurement_units [2013/04/22 09:30] admin
Line 1: Line 1:
-====== Representing units of measure ====== +#REDIRECT doc:measurement_units
-~~NOTOC~~ +
-This module provides functionality to describe and reason about units of measure attached to numerical values. Transparent conversion between compatible units (e.g. lengths, time intervals, etc) is provided as well as explicit conversion methods. Full backwards compatibility is ensured by treating values without units as being in the respective SI base units (which, by convention, was used so far). It is based on a large, standard [http://qudt.org/ measurement units ontology] by NASA. +
- +
-===== Functionality ===== +
-  * Values can be annotated with their units as RDF data types +
-  * The definitions of units, quantities etc are imported from the large [http://qudt.org/ QUDT ontology] +
-  * The units can be converted into each other using the convert_to_unit(Input, OutputType, Res) predicate +
-  * Transparent conversion is done by an rdf_triple hook definition that accepts queries for values in a given unit like rdf_triple(knowrob:length, 'test-inst', literal(type(unit:'Kilometer', Val))). If results in a different unit are found, they are converted transparently and returned in the correct format. +
-  * The conversion routine checks if both units describe the same quantity type (e.g. length, time) and only perform  the conversion if this is the case. +
- +
-===== Assumptions ===== +
-* If no unit is given, the default SI base unit (meter, second, kilogram) is used +
- +
-===== Usage ===== +
- +
-<code> +
- $ roscd knowrob_common/owl +
- $ rosrun rosprolog rosprolog ias_knowledge_base +
-  +
- ?- owl_parse('knowrob_units.owl', false, false, true). +
- ?- consult('../prolog/knowrob_units.pl'). +
-  +
- % read information that is asserted for a test instance +
- ?- rdf_has('http://ias.cs.tum.edu/kb/knowrob_units.owl#test-inst', +
-            'http://ias.cs.tum.edu/kb/knowrob_units.owl#length', O). +
- O = literal(type('http://qudt.org/vocab/unit#Centimeter','12.0')) . +
-  +
- % manual conversion into other units +
- ?- convert_to_unit($O, 'http://qudt.org/vocab/unit#Kilometer', P). +
- P = 0.00012. +
-  +
- ?- convert_to_unit($O, 'http://qudt.org/vocab/unit#Meter', P). +
- P = 0.12. +
-  +
- ?- convert_to_unit($O, 'http://qudt.org/vocab/unit#Millimeter', P). +
- P = 120.0. +
-</code> +
- +
-The integration with the rdf_triple computables allows to transparently convert values into the desired unit of measure: +
-<code> +
- % transparent conversion during the query   +
- ?- rdf_triple('http://ias.cs.tum.edu/kb/knowrob_units.owl#length',  +
-               'http://ias.cs.tum.edu/kb/knowrob_units.owl#test-inst',  +
-                literal(type('http://qudt.org/vocab/unit#Meter', Val))). +
- Val = 0.12 ; +
-  +
- ?- rdf_triple('http://ias.cs.tum.edu/kb/knowrob_units.owl#length',  +
-               'http://ias.cs.tum.edu/kb/knowrob_units.owl#test-inst',  +
-                literal(type('http://qudt.org/vocab/unit#Kilometer', Val))). +
- Val = 0.00012 ; +
-</code> +
- +
- +
-===== Literature ===== +
-  * Wiki page of the Morfeo project discussing different alternative ways to represent measurements in OWL (recommended read) http://forge.morfeo-project.org/wiki_en/index.php/Measurement_Units_Ontology +
-  * Measurement unit ontology: http://qudt.org/ +
-  * Blog post about the QUDT measurement unit ontology: http://composing-the-semantic-web.blogspot.com/2009/08/units-ontology-with-spin-support.html +
-  * Paper about representation of units in OWL: http://clarkparsia.com/files/pdf/units-owled2008-eu.pdf +
- +