Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
doc:measurement_units [2013/04/22 09:30] – created admin | doc:measurement_units [2014/12/07 08:57] (current) – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Representing units of measure ====== | ====== Representing units of measure ====== | ||
~~NOTOC~~ | ~~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:// | + | 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 |
===== Functionality ===== | ===== Functionality ===== | ||
* Values can be annotated with their units as RDF data types | * Values can be annotated with their units as RDF data types | ||
- | * The definitions of units, quantities etc are imported from the large [http:// | + | * The definitions of units, quantities etc are imported from the large [[http:// |
* The units can be converted into each other using the convert_to_unit(Input, | * The units can be converted into each other using the convert_to_unit(Input, | ||
- | * Transparent conversion is done by an rdf_triple hook definition that accepts queries for values in a given unit like rdf_triple(knowrob: | + | * Transparent conversion is done by an rdf_triple hook definition that accepts queries for values in a given unit like rdf_triple(knowrob: |
* The conversion routine checks if both units describe the same quantity type (e.g. length, time) and only perform | * The conversion routine checks if both units describe the same quantity type (e.g. length, time) and only perform | ||
Line 16: | Line 16: | ||
< | < | ||
- | $ roscd knowrob_common/owl | + | $ roscd knowrob_common |
- | $ rosrun rosprolog rosprolog | + | $ rosrun rosprolog rosprolog |
- | ?- owl_parse(' | + | ?- owl_parse(' |
- | ?- consult(' | + | ?- consult(' |
% read information that is asserted for a test instance | % read information that is asserted for a test instance | ||
- | ?- rdf_has(' | + | ?- rdf_has(' |
- | ' | + | ' |
O = literal(type(' | O = literal(type(' | ||
Line 41: | Line 41: | ||
< | < | ||
% transparent conversion during the query | % transparent conversion during the query | ||
- | ?- rdf_triple(' | + | ?- rdf_triple(' |
- | ' | + | ' |
literal(type(' | literal(type(' | ||
Val = 0.12 ; | Val = 0.12 ; | ||
- | ?- rdf_triple(' | + | ?- rdf_triple(' |
- | ' | + | ' |
literal(type(' | literal(type(' | ||
Val = 0.00012 ; | Val = 0.00012 ; |