Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qudt:isScalingOf inconsistent with qudt:prefix because of unit:KiloGM #548

Open
fkleedorfer opened this issue Aug 26, 2022 · 12 comments
Open

Comments

@fkleedorfer
Copy link
Collaborator

This is an attempt to reformulate more #455 concisely and suggest a simple solution. The current state of the ontology is causing downstream problems.

The way qudt:isScalingOf, qudt:prefix/qudt:prefixMultiplier and qudt:conversionMultiplier (and qudt:conversionOffset) work, one should be able to find the "unscaled" unit for any unit in the subject of a qudt:isScalingOf triple, and to convert a quantity between those units consistenly, either using the prefix multiplier or the normal unit conversion. This is not the case at the moment because of unit:KiloGM.

For example, unit:DecaGM converts to unit:KiloGM and is a scaling of unit:KiloGM, but has the prefix prefix:Deca. Normally, we can divide by the prefix' multiplier to get the quantity in the unscaled unit, but not here.

The inconsistency is incurred by Kilogram being the standard SI unit despite having a kilo prefix, and therefore, somehow, it may seem right to make gram a scaling of kilogram. However, no other unit in the ontology cares about what unit it converts to when considering scaling - otherwise, e,g, unit:LB would have to be a scaling of unit:KiloGM - and I cannot think of any reason why SI mass should be an exception. Conversely, having this exception makes simple things complicated.

The remedy is simple: Fix unit:KiloGM and its scalings. Let unit:GM be the base unit of all those scalings, ie.:

unit:KiloGM qudt:isScalingOf unit:GM; qudt:prefix prefix:Kilo.
unit:DecaGM qudt:isScalingOf unit:GM; qudt:prefix prefix:Deca.
unit:CentiGM qudt:isScalingOf unit:GM; qudt:prefix prefix:Centi.
... and so on

Then, we only need to know which unit another unit is a scaling of, and we can always do normal unit conversion (i.e. using the conversionMultiplier and the conversionOffset). I am pretty sure the result is consistent with the respective prefixes' multipliers in all cases.

BTW, there are many currently unmarked scalings in the ontology, like X-PER-(timeunit) , or the scalings of imperial units, such as pound, stone, etc. - which could all be added consistently with this change.

@steveraysteveray
Copy link
Collaborator

Your suggestion, which makes things nice and easy within QUDT, would make us inconsistent with the SI, which sounds like a problem to me...

@jhodgesatmb
Copy link
Collaborator

jhodgesatmb commented Aug 26, 2022 via email

@steveraysteveray
Copy link
Collaborator

Good point, Jack. To be truly consistent, the URI should be KILOGRAM or KILOGM rather than KiloGM, and there might be MilliKILOGRAM, etc. Of course, this would blow the minds of users, I imagine.

It's a shame the SI unit of mass wasn't just called something totally new, like a BLOB.

@fkleedorfer
Copy link
Collaborator Author

It all depends on what isScalingOf is supposed to mean. If you have a clear definition, maybe could you add it to the vocabulary?

@jhodgesatmb
Copy link
Collaborator

jhodgesatmb commented Aug 26, 2022 via email

@fkleedorfer
Copy link
Collaborator Author

fkleedorfer commented Aug 26, 2022

If nobody is happy with the current - implicit - interpretation, and nobody relies upon it anyway, might I suggest we add a clear explanation to the property, make the suggested change, and have a wholly consistent qudt?

After all who would, without any additional documentation, think it is safe to assume that DecaGM is a scaling of KiloGM? Especially when it is linked to a Prefix with multiplier 10? Everyone knows, that decagram is 10 g. Everyone trying to build code based on these triples will stumble upon this in the form of a bug in their own code, and mitigate by some more or less ugly special case handling. Why go against the straightforward intuition?

The fact that kilogram is the si base, I believe, is a different concern, that, if needed, can be adressed in a different way without bending something that works well for hundreds of other units.

@jhodgesatmb
Copy link
Collaborator

jhodgesatmb commented Aug 26, 2022 via email

@dr-shorthair
Copy link
Contributor

dr-shorthair commented Aug 27, 2022

UCUM has struggled with this as well. They just decided to make gram the base unit.
https://ucum.org/ucum.html#section-Base-Units

@fkleedorfer
Copy link
Collaborator Author

@dr-shorthair
Copy link
Contributor

Note that UCUM is not an enumeration of units of measurement, it is a grammar for building complex unit symbols from primitive symbols. Since the prefixes are part of the primitive symbol set, having kg as a base quantity would introduce a whole extra layer of operations - to first strip the k before adding any other prefix - which would have made the grammar horribly unwieldy. So they did the pragmatic thing.

The reasons for all this are historic and cultural. SI is not 'wrong', it just inherits patterns developed in the 18th century, before automated processing of the sort we are thinking of was conceivable.

In a sense life is easier for QUDT since it is an enumeration. But automating conversions using QUDT definitions uncovers this challenge again.

@steveraysteveray
Copy link
Collaborator

As I just mentioned in #547, I think the inclusion of qudt:isScalingOf causes more confusion than any benefits it brings. This discussion is one example.

@steveraysteveray
Copy link
Collaborator

We have discussed this in our Board, and we propose to deprecate the qudt:isScalingOf property altogether. As has been pointed out, it is subject to misinterpretation, does not generalize to multiple systems of units supported by QUDT, and the conversionmultiplier provides the information needed for conversions. Unless someone presents a compelling reason to keep it, we will take this action in due course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants