How to check for correctess while using units? #473
-
This question refers to the practical use of a For example, the quantity kind
I am wondering if, while using the ontology in practice, there is a way to avoid using the wrong unit. For example: eg:Speed qudt:hasQuantityKind qudt:Velocity . What happens if someone by mistake uses the unit Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
One quick way is to check the DimensionVector that a Unit points to, to check if it is the same as the DimensionVector pointed to by the QuantityKind. That at least tells you if the Unit and the QuantityKind are compatible. Your example would fail that test. |
Beta Was this translation helpful? Give feedback.
-
Since applicableUnit will always return a valid unit for a quantitykind the temperature example would fail since Deg_C would not be in the applicableUnit list. The particular example of Speed does need to be addressed but it is an anomaly (hopefully). In general, SHACL could be used in an application to test for validity, but the vocabularies are internally consistent.
Jack
…Sent from my iPad
On Feb 16, 2022, at 2:42 PM, steveraysteveray ***@***.***> wrote:
One quick way is to check the DimensionVector that a Unit points to, to check if it is the same as the DimensionVector pointed to by the QuantityKind. That at least tells you if the Unit and the QuantityKind are compatible.
Your example would fail that test.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
It seems that it is actually a good way to check for consistency within the ontology.
Thank you for the examples. I’ll try to use something similar within a SHACL shape.
… On 25. Feb 2022, at 7:46 PM, steveraysteveray ***@***.***> wrote:
Actually, I took another look with this query (no OPTIONAL statements) and found 5 offending situations, so thanks for leading me down this path!
SELECT *
WHERE {
?unit a qudt:Unit .
?unit qudt:hasQuantityKind ?qk .
?unit qudt:hasDimensionVector ?uVec .
?qk qudt:hasDimensionVector ?qVec .
FILTER (?uVec != ?qVec) .
}
Results:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
One quick way is to check the DimensionVector that a Unit points to, to check if it is the same as the DimensionVector pointed to by the QuantityKind. That at least tells you if the Unit and the QuantityKind are compatible.
Your example would fail that test.