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.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterUnify names of time precision constants

Event Timeline

thiemowmde raised the priority of this task from to Needs Triage.
thiemowmde updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 21 2015, 2:52 PM

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

thiemowmde updated the task description. (Show Details)Jun 3 2015, 2:59 PM
thiemowmde set Security to None.

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

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

Lydia_Pintscher closed this task as Resolved.Aug 7 2015, 5:26 PM
Lydia_Pintscher claimed this task.

All patches are merged.

thiemowmde reopened this task as Open.Aug 10 2015, 10:14 AM

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

thiemowmde removed Lydia_Pintscher as the assignee of this task.Aug 10 2015, 10:15 AM
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 added a subscriber: Jonas.

Could this be connected to a parent story?

Rical added a subscriber: Rical.Nov 4 2015, 10:38 AM
Rical removed a subscriber: Rical.Jul 21 2017, 9:47 AM