Last modified: 2014-03-04 13:34:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53111, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51111 - design and spec API modules for value validation and formatting
design and spec API modules for value validation and formatting
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks: 54448 49186 56716
  Show dependency treegraph
 
Reported: 2013-07-10 15:02 UTC by denny vrandecic
Modified: 2014-03-04 13:34 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description denny vrandecic 2013-07-10 15:02:24 UTC
Decide on the necessity, and if so, how exactly the API module for value validation (or properly rather value parsing) would be specified, how it interacts with the existing parsing API module, and with a potential formatting API.
Comment 1 Daniel Kinzler 2013-07-10 15:28:53 UTC
Some thoughts:

* as a context, we can either provide a data type ID, or, for convenience, a property ID.

* we need validation, parsing, and formatting. since we often need combinations of these, they could be combined in a module, so these operations can be performed in a single call. Perhaps like this:

- input is either given as JSON, or as a string. In the latter case, it is parsed to get the JSON structure.
- a DataValue is constructed from the JSON structure, based on info from the data type.
- validation is always performed on the DataValue
- the result is the DataValue serialized as JSON (could be omitted if that was the input)
- in addition, a formatted version of the DataValue can be requested as output. 

* Note that formatting can depend on a lot of factors: data type, desired output format (html?), current language and variant, user settings (e.g. babel, perhaps even preferred unit system), etc.
Comment 2 Gerard Meijssen 2014-01-23 09:23:22 UTC
Being able to easily the #Babel information with an API allows "Reasonator" to apply language fall back.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links