-
-
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
Convert doubles and floats to decimals #311
Conversation
# Conflicts: # vocab/unit/VOCAB_QUDT-UNITS-ALL-v2.1.ttl
# Conflicts: # vocab/unit/VOCAB_QUDT-UNITS-ALL-v2.1.ttl
INSERT { ?u qudt:conversionMultiplier ?md } WHERE { ?u a qudt:Unit ; qudt:conversionMultiplier ?m . BIND( DATATYPE(?m) as ?mt ) FILTER( ?mt != xsd:decimal ) BIND( xsd:decimal(?m) as ?md ) } DELETE { ?u qudt:conversionMultiplier ?m } WHERE { ?u a qudt:Unit ; qudt:conversionMultiplier ?m . BIND( DATATYPE(?m) as ?mt ) FILTER( ?mt != xsd:decimal ) } INSERT { ?u qudt:conversionOffset ?od } WHERE { ?u a qudt:Unit ; qudt:conversionOffset ?o . BIND( DATATYPE(?o) as ?ot ) FILTER( ?ot != xsd:decimal ) BIND( xsd:decimal(?o) as ?od ) } DELETE { ?u qudt:conversionOffset ?o } WHERE { ?u a qudt:Unit ; qudt:conversionOffset ?o . BIND( DATATYPE(?o) as ?ot ) FILTER( ?ot != xsd:decimal ) } DELETE { ?u qudt:conversionOffset ?o } WHERE { ?u a qudt:Unit ; qudt:conversionOffset ?o . FILTER( ?o = 0.0 ) }
Used the following SPARQL INSERT { ?u qudt:conversionMultiplier ?md }
WHERE {
?u a qudt:Unit ;
qudt:conversionMultiplier ?m .
BIND( DATATYPE(?m) as ?mt )
FILTER( ?mt != xsd:decimal )
BIND( xsd:decimal(?m) as ?md )
}
DELETE { ?u qudt:conversionMultiplier ?m }
WHERE {
?u a qudt:Unit ;
qudt:conversionMultiplier ?m .
BIND( DATATYPE(?m) as ?mt )
FILTER( ?mt != xsd:decimal )
}
INSERT { ?u qudt:conversionOffset ?od }
WHERE {
?u a qudt:Unit ;
qudt:conversionOffset ?o .
BIND( DATATYPE(?o) as ?ot )
FILTER( ?ot != xsd:decimal )
BIND( xsd:decimal(?o) as ?od )
}
DELETE { ?u qudt:conversionOffset ?o }
WHERE {
?u a qudt:Unit ;
qudt:conversionOffset ?o .
BIND( DATATYPE(?o) as ?ot )
FILTER( ?ot != xsd:decimal )
} Also - remove all zero offets DELETE { ?u qudt:conversionOffset ?o }
WHERE {
?u a qudt:Unit ;
qudt:conversionOffset ?o .
FILTER( ?o = 0.0 )
} |
Is this because it is inferred to be zero if not present by calculation queries? |
Offsets apply in very few cases - and only on interval scales (not ratio scales). |
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.
OK.
I hope the multiplier for PlanckDensity doesn't break anything!
Fixes #307