Suppose you need to write right into a database that something is 30 meters lengthy, or 50 ft, or even the temperature was 50 kelvin, the rate was 50 kilometers each hour. How does one represent the models ?
To explain, two points:
- any type of models, not really a predefined, well defined subset of these.
- my real question is more in accordance with the presence of an ontology of models. I required the database example since it was the very first that entered my thoughts, but situations like representing the system in XML or JSON are equally likely.
Among the fundamental concepts of relational database design is the fact that all values inside a given column should represent some realistically compatible kind of data. Formally, a column has exactly a single type, and then any two values inside a type could be in comparison to one another within an equality predicate. This can be a crucial a part of type theory.
Therefore if the dimensions aren't comparable, i.e. length versus. temperature, you should not store them within the same column.
You might like to take a look at ISO 2955, "Information processing - Representation of SI along with other models in Systems with limited Character sets."
Also see "Joe Celko's SQL Programming Style," chapter 4, Scales and Dimensions.
Relational theory has it that every relvar ("table") comes with an connected predicate that defines this is from the tuples therein. That predicate needs to be area of the formal documentation from the database, so that nobody who really consults the documentation might have any excuse for "getting misinterpreted something" (unless of course the documentation is incomplete obviously).
Including the phrase models for the reason that predicate (e.g. "The size of person ... is Ft.", "The measured temperature was ... KELVIN", ...) accomplishes that completeness and eliminates needing to turn to individuals rather ugly attribute ("column") names.
I do not realise why "just storing the amounts" (inside a standard unit that's decided by all customers) could be "difficultInch.
If foobaricity is available like a unit, and someone pops up with a brand new unit fluffyperception, then that somebody will first need to formally establish the correspondance between amounts of foobaricity and amounts of fluffyperception anyway, or free according to him will/could be understood by anybody.
I saw this added : "I have to preserve the data concerning the original unit."
Nothing stops you against doing that. Two extra posts (original quantity and original unit title) alongside the "canonicalized" value. You are able to constrain "original unit title" as strong or as poor as you would like.
Have you got a specific reason to keep amounts in various kinds of models, rather than transforming into some "canonical" models (e.g., the metric system)? When placing data, you'd convert the input quantity in to the canonical unit. So when reading through data, you'd convert into whatever output unit you'll need.
This method now is easier in lots of ways than storing data in various models, however, you lose the data concerning the original unit where the data was specified.
I'd range from the models within the column title (e.g. LengthInMeters, WeightInKilograms, AnnoyingnessInFishSlapsPerSecond etc.), after which just keep amounts within the column.
Ideally, it might be nice to have the ability to define the system like a (proper) property from the column, but I'm not sure associated with a database that enables this. Using the unit incorporated within the column title, it's tough for future designers being unclear about this.
I have encounter DB solutions which include the system inside a second column, consider there is no standardized method of representing models, this eventually ends up being whether text area with values like "foot.", "ft" "Ft" etc., otherwise an FK to some table that stores possible models (also text). In either case, running SUM or AVG queries (or any calculation) turns into a nightmare, particularly if you allow values with various models to become saved within the same column.