Page MenuHomePhabricator

[Story] Human-readable serialization of TimeValue precisions in JSON
Open, LowPublic

Description

The precision of a TimeValue is currently represented as an integer in JSON. But these numbers do not have a meaning. They are just constants, for internal use in the Wikibase code base. It probably makes much more sense to represent these precision values as short strings in JSON, e.g. 'precision': 'DAY'. Or URIs, see T99907: [RFC] Human-readable serialization of TimeValue precisions in RDF.

Or does it? Code like in TimeDetailsFormatter makes use of the fact that the integer numbers 9 (year), 8 (10 years), 7 (100 years) and so on do have an order that can be used in a calculation. On the other hand I don't think this can be an argument for keeping the otherwise meaningless numbers.

Also see:

These patches try to come up with a better naming scheme for these constants.

Event Timeline

thiemowmde raised the priority of this task from to Needs Triage.
thiemowmde updated the task description. (Show Details)

Change 194306 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Unify names of time precision constants

https://gerrit.wikimedia.org/r/194306

Change 194306 merged by jenkins-bot:
Unify names of time precision constants

https://gerrit.wikimedia.org/r/194306

Lydia_Pintscher claimed this task.

All patches are merged.

The patches set a base but did not touched the JSON.

thiemowmde triaged this task as Low priority.
thiemowmde removed a project: Patch-For-Review.
Jonas renamed this task from Human-readable serialization of TimeValue precisions in JSON to [Story] Human-readable serialization of TimeValue precisions in JSON.Nov 2 2015, 3:43 PM
Jonas subscribed.

Could this be connected to a parent story?