Page MenuHomePhabricator

Set proper decimal value precision in RDF exports
Closed, DeclinedPublic

Description

Right now the RDF export represents quantities as very precise:

<http://acme.test/value/1e09d673624819aacd170165aae555a1> <http://www.wikidata.org/ontology-0.0.1#Amount> "+19.768000000000000682121026329696178436279296875"^^<http://www.w3.org/2001/XMLSchema#decimal> .

However, this precision does not reflect neither real value precision nor data precision. Instead, the dump should take into account stated precision of the data and produce value which makes sense for the data, without junk numbers at the end.

Event Timeline

Smalyshev claimed this task.
Smalyshev raised the priority of this task from to Normal.
Smalyshev updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 13 2015, 7:25 PM

Looks like this issue does not actually happen with real data, since the UI makes the strings correct, it only happens with test data that has overlong strings for some reason.

Smalyshev lowered the priority of this task from Normal to Low.Apr 2 2015, 10:01 PM
Smalyshev closed this task as Declined.May 20 2015, 7:16 PM

@Smalyshev Looks like the test data is using float values when constructing the QuantityValue object. That would lead to ugly long decimal like this. The test code should provide decimal strings to QuantityValue, then this would not happen.