Skip to content
Phil Blackwood

Phil Blackwood

Every Enterprise can benefit from having a simple, standard way to represent quantitative data. In this blog post, we will provide examples of how to use the new gist model of quantitative data released in gist version 13. After illustrating key concepts, we will look at how all the pieces fit together and provide one concrete end-to-end example.

Let’s examine the following:

  1. How is a measurement represented?
  2. Which units can be used to measure a given characteristic?
  3. How do I convert a value from one unit to another?
  4. How are units defined in terms of the International System of Units?

First, we want to be able to represent a fact like:

“The patio has an area of 144 square feet.”

The area of the patio is represented using this pattern:

Diagram of the magnitude pattern: the patio, an owl:Thing, has a gist:Magnitude, which has the aspect area (gist:Aspect), the unit of measure square foot (gist:UnitOfMeasure), and the numeric value 144.

… where:

A magnitude is an amount of some measurable characteristic.

An aspect is a measurable characteristic like cost, area, or mass.

A unit of measure is a standard amount used to measure or specify things, like US dollar, meter, or kilogram.

Second, we need to be able to identify which units are applicable for measuring a given aspect. Consider a few simple examples, the aspects distance, energy, and cost:

Three groups of units: distance (meter, centimeter, inch, mile, micron, and more), energy (joule, kilowatt hour, electron volt, newton meter, and more), and cost (US dollar, euro, yen, and more).

For every aspect there is a group of applicable units. For example, there is a group of units that measure energy density:

Diagram: the aspect energy density, a gist:Aspect, has a gist:UnitGroup, the units that measure energy density, through gist:hasUnitGroup.

… where:

A unit group is a collection of units that can be used to measure the same aspect.

A common scenario is that we want to validate the combination of aspect and unit of measure. All we need to do is check to see if the unit of measure is a member of the unit group for the aspect:

Diagram for checking a measurement: an owl:Thing has a gist:Magnitude with a gist:Aspect, a gist:UnitOfMeasure, and a numeric value. The aspect has a gist:UnitGroup, and the unit of measure is a member of the same unit group (gist:isMemberOf).

Next, we want to be able to convert measurements from one unit to another. A conversion like this makes sense only when the two units measure the same aspect. For example, we can convert pounds to kilograms because they both measure mass, but we can’t convert pounds to seconds. When a conversion is possible, the rule is simple:

To convert a numeric value from one unit of measure to another, multiply by the conversion factor of the first unit and then divide by the conversion factor of the second unit. For example, to convert 27 feet to yards using meter as an intermediate: 1 foot is 0.3048 meters and 1 yard is 0.9144 meters, so the conversion factor of foot is 0.3048 and the conversion factor of yard is 0.9144, and 27 feet = (27 x 0.3048) / 0.9144 = 9 yards. As a diagram:
Diagram: feet times 0.3048 gives meters, yards times 0.9144 gives meters, and so feet times 0.3048/0.9144 gives yards.

There is an exception to the rule above for units of measure that do not have a common zero value. For example, 0 degrees Fahrenheit is not the same temperature as 0 degrees Kelvin.

To convert from Fahrenheit to Kelvin, first add the conversion offset of Fahrenheit and then multiply by its conversion factor: 20 degrees Fahrenheit = (20 + 459.6696) x 5/9 degrees Kelvin = 266.483 degrees Kelvin.

To convert from Kelvin to Fahrenheit, reverse the steps: first divide by the conversion factor and then subtract the offset.

To convert a value from Fahrenheit to Celsius, first use the conversion above to convert to Kelvin, and then convert from Kelvin to Celsius.

Next, we will look at how units of measure are related to the International System of Units, which defines a small set of base units (kilogram, meter, second, Kelvin, etc.) and states:

“Derived units are defined as products of powers of the base units.” For example, 1 watt = 1 kilogram meter² per second³. The right side is represented as gist:exponentOfKilogram 1, gist:exponentOfMeter 2, and gist:exponentOfSecond -3, each an xsd:decimal. Other units in the same unit group follow the pattern: 1 kilowatt = 1000, 1 horsepower (metric) = 735.4988, and 1 erg per second = 0.0000001 kilogram meter² per second³.

Notice that every expression on the right side is a multiple of kilogram meter2 per second3. We can avoid redundancy by “attaching” the exponents of base units to the unit group. That way, when adding a new unit of measure to the unit group for power there is no need to re-enter the data for the exponents.

The example also illustrates the conversion factors; each conversion factor appears as the initial number on the right hand side. In other words:

Table of conversion factors: watt 1, kilowatt 1000, horsepower (metric) 735.4988, and erg per second 0.0000001.

The conversion factors and exponents allow units of measure to be expressed in terms of the International System of Units, which acts as something of a Rosetta Stone for understanding units of measure.

One additional bit of modeling allows calculations of the form:

(45 miles per hour) x 3 hours = 135 miles

To enable this type of math, we represent miles per hour directly in terms of miles and hours:

Diagram: the unit mile per hour has the multiplier mile (gist:hasMultiplier) and the divisor hour (gist:hasDivisor).

Putting the pieces together:

Here is the standard representation of a magnitude:

Diagram of the standard representation of a magnitude: an owl:Thing has a gist:Magnitude, which has a gist:Aspect, a gist:UnitOfMeasure, and a numeric value.

Every aspect has a group of units that can be used to measure it:

Diagram: a gist:Aspect has a gist:UnitGroup (gist:hasUnitGroup) and is categorized by a gist:Discipline (gist:isCategorizedBy).

Every member of a unit group can be represented as a multiple of the same product of powers of base units of the International System of Units:

Diagram: a gist:UnitGroup has gist:exponentOfX, an xsd:decimal.

where X can be:

  • Ampere
  • Bit
  • Candela
  • Kelvin
  • Kilogram
  • Meter
  • Mole
  • Number
  • Other
  • Radian
  • Second
  • Steradian
  • USDollar

Every unit of measure belongs to one or more unit groups, and if can be defined in terms of other units acting as multipliers and divisors:

Diagram: a gist:UnitOfMeasure can have other units as multipliers and divisors (gist:hasMultiplier and gist:hasDivisor), is a member of a gist:UnitGroup, and has a conversion factor (xsd:decimal or xsd:double) and a conversion offset (xsd:decimal).

We’ll end with a concrete example, diastolic blood pressure.

Diagram of the aspect diastolic blood pressure: a gist:Aspect with the label “diastolic blood pressure”, QUDT’s definition (the pressure of blood in the arteries, normally about 80 mmHg in a young adult), a close match in QUDT, an Oxford Reference entry, the disciplines medicine and biology, and the unit group for blood pressure.

The unit group for blood pressure is a collection of units that measure blood pressure. The unit group is related to the exponents of base units of the International System of Units:

Diagram of the unit group for blood pressure: a gist:UnitGroup labeled “units that measure blood pressure”, with the scope note “kilogram per meter secondSquared”. Its exponent of kilogram is 1.0, of meter -1.0, and of second -2.0, and the exponents of the other base units (ampere, bit, candela, kelvin, mole, number, other, radian, steradian, and US dollar) are 0.0.

Finally, one member of the unit group for blood pressure is millimeter of mercury. The scope note gives an equation relating the unit of measure to the base units (in this case, kilogram, meter, and second).

Diagram of the unit millimeter of mercury: a gist:UnitOfMeasure that is a member of the unit groups for blood pressure, fluid pressure, and force per area, with a close match in QUDT, a Wikipedia entry, the scope note “1 millimeter of mercury = 133.322387415 x kilogram per meter secondSquared”, and the conversion factor 133.322387415.

The diagrams above were generated using a visualization tool. The text version of the diagrams is:

Turtle code for the diagrams above: the prefixes, the disciplines medicine and biology, the aspect diastolic blood pressure, and the units kilopascal (conversion factor 1000.0) and millimeter of mercury (conversion factor 133.322387415), each a member of the unit groups for blood pressure, fluid pressure, and force per area.
Turtle code for the unit group for blood pressure: its type, definition, label, and scope note, and the exponent of each base unit: kilogram 1.0, meter -1.0, second -2.0, and 0.0 for all the others.

For more examples and some basic queries, visit the gitHub site gistReferenceData.

In closing, we would like to acknowledge the re-use of concepts from QUDT, namely:

  • every magnitude has an aspect, via the new gist property hasAspect
  • aspects are individuals instead of categories or subclasses of Magnitude as in gist 12
  • exponents are represented explicitly, enabling calculations