Units

From semanticweb.org

Jump to: navigation, search

Several built-in types in SMW support units. Some support conversions between different units, and you can define your own types with Custom units.

The rest of this page describes a more complete design for units support that is yet to be implemented.


This is a proposal and is not implemented in current Semantic MediaWiki and/or the general usage of semantics on semanticweb.org.


Units are mostly a Datatype based on Numbers and an Identifier.

Example:

[[length:="35 km"]]

Although this case looks very simple, actually it isn't so for implementation. This is because the Parser need to understand different kinds of:

  • Numbertypes
    • Integers
    • Floats (including positive and negative Infinity)
    • Vectors and Matrices
    • Complex Numbers
  • Prefixes
    • nano
    • micro
    • milli
    • kilo
    • mega
    • giga
  • Units
    • meter
    • inch
    • yard
    • second
    • volt

and even complex Units which are composed from other Units.

[[acceleration:="9.81 m/(s^2)"]]

Even it must be possible to derive new units with Formulas:

Unit:dB(var:x) -> 20 * Math:log(var:x)
Unit:°C(var:x) -> (var:x - 273.15) * Unit:K

The most complete implementation of such unit support is probably in the GNU units program, though it is not internationalized.

[edit] Fundamental SI Units

These are easily implemented in current SMW, though prefix handling has to be repeated in each.

Name Symbol Quantity
kilogram kg Property:Mass
second s Property:Time
metre m Property:Length
ampere A Electrical current
kelvin K Property:Temperature
mole mol Property:Amount of substance
candela cd Property:Luminous intensity

[edit] Namespaces

An additional, but complex to use, Technique might be to separate differt units using Namespaces. This could look like:

SI:m

For the SI-Unit Meter and

Prefix:m

For the Prefix m meaning Milli. So Millimeter could get expressed as:

Prefix:m SI:m

[edit] See also

Personal tools