-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add SHACL shapes ensuring correctness of scientific notation values #870
Conversation
Constraints added for - qudt:conversionMultiplier(SN) - qudt:conversionOffset(SN) - qudt:value(SN) - qudt:standardUncertainty(SN)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the new properties and property shapes to the OWL and SHACL schema files.
One observation: I tried adding a bunch of zeroes at the end of the decimal value of a ConstantValue, and the validation fails. I have not examined the mechanism of your validation rules - just the behavior. Is there a way to make it pass in that case? I suppose the counter-argument is the implied precision of the trailing zeroes... I'd welcome everybody's thoughts on this.
I actually tried to allow trailing zeroes. There is a case with one trailing zero, which passes, if I am not mistaken... It's one regex that does that. First we have to figure out what behavior we want, then we can change the regex |
Agreed. Let's see what others think. I was going to test adding some non-zeroes beyond the resolution of xsd:double to see if it would pass, but didn't get that far. My thought is that a deviation beyond the resolution of xsd:double is fine. We should consider the xsd:decimal as the "master value", and the xsd:double as a human-readable approximation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following discussion with Steve the decimal values should be treated as the definitive values. Should the scientific value be relied on to a specific number of digits, that is, up to 16 digits? The SN value is really intended for human consumption and not for calculation. Therefore we should not insist on strict matching on trailing zeros. Or any number beyond 16 digits. @fkleedorfer thoughts?
Here is what I think we all want:
Hence, trim trailing zeros behind the decimal point except for the first, in both SN and ctual value before comparing. |
I'm a little unclear on your trimming. Would this be how you might trim? 0.00100 trims to 0.001 ...and then you compare? |
That's what I meant |
Updated the shapes to do exactly what's described above:
|
…notation value Ignoring trailing zeroes was not working properly before this commit.
Constraints added for