Documentation/Quantitative values

From GoodRelations Wiki
Jump to: navigation, search

Representing Quantitative Values

GoodRelations provides a flexible mechanism for representing quantitative values that has several nice features:

  1. It can handle point values and open and closed intervals with one mechanism.
  2. It supports arbitrary units of measurement (e.g. kilograms, miles, inches, seconds, decibel, ...).
  3. It supports value references, dependencies, and measurement meta-data (e.g. this value was measured at a speed of 80 km/h; this value was determined using the ABCD methodology).


to be added


foo:PointValue a schema:QuantitativeValue;
	schema:value 3.
foo:ClosedInterval a schema:QuantitativeValue;
	schema:minValue 3;
	schema:maxValue 7.
foo:RightOpenInterval a schema:QuantitativeValue;
	schema:minValue 3.
foo:LeftOpenInterval a schema:QuantitativeValue;
	schema:maxValue 7.

A reasoner should expand a point value to

foo:ClosedInterval a schema:QuantitativeValue;
	schema:value 3;
	schema:minValue 3;
	schema:maxValue 3.

thanks to value being a subproperty of both minValue and maxValue - these subproperty axioms are not yet in, because at the time of the GoodRelations integration, there was no notion of subproperties in The nice thing about this is that you can handle point values and intervals with the same queries - a search for a car with 3 seats will also find a car that has 2 - 4 seats, because you will simply search for a car with at least 3 seats).

This is suitable for all quantities except for datetime and date intervals (hours, seconds, months is fine thanks to respective unit codes for schema:unitCode).

foo:AtLeastOneMinute a schema:QuantitativeValue;
	schema:minValue 3;
	schema:unitCode "MIN".
foo:UpToThreeHours a schema:QuantitativeValue;
	schema:maxValue 3;
	schema:unitCode "HUR".

For datetime and date intervals, I decided back then that dedicated pairs of properties like validFrom and validThrough were more useful.

Figure: tbd

Figure: tbd

Figure: tbd

#some Turtle
Work in progress: This page is an incomplete draft. Please help to improve it by addressing the issues from the discussion page and remove this template when finished.