Discuss API modules
- [View source↑]
- [History↑]
Contents
Thread title | Replies | Last modified |
---|---|---|
askargs: units of measurement | 4 | 03:43, 25 December 2014 |
Limit and offset not working? | 1 | 09:06, 13 November 2014 |
Incomplete documentation | 1 | 05:14, 27 October 2014 |
How can I add needed unit of measurement to a printout in {{#askargs:}}
? Also, how can I format a date there?
It's even worse. It seems that all export features {{#askargs:}}
, {{#ask:}}
, csv and json formats simply ignore #
in printouts (only showing units of measurement in the "printrequests"
).
So, I have to convert units of measurements in my client application again, although it could have ben done by SMW. The application should know the conversion rates etc.
But even that is made difficult. The required units (when shown at all) are not in the query.results [(label)].printouts
objects but in the query.printrequests
. Moreover, while query.results [(label)].printouts
is an object, query.printrequests
is an array, so I cannot just go there and get the unit, I have to traverse the array at least once to convert in to an object with the same indices as query.results [(label)].printouts
. Why? Why? Why?
I have to parse JSON, which is supposed to be parsed already, in dozens of lines of code; just because there is no sane way to get quantities in needed units in the API, or at least, it is not documented.
I suspect you are right that the ask API does not support units. You should be able to use Special:Ask though. And enhancements to the ask API, or its documentation, are certainly welcome.
My task was to make a fully dynamic (not cached with the rest of the wikipage) semantic map. At first I used SMW API and had to process units of measurement in my JavaScript. Then I found a more universal and robust solution: I developed an extension that enables server- and client-side inclusions on wikipages (with api.php?action=parse
). So, this issue is not so pressing to me now. However, I still think that there is a bug in the API, not its documentation.
SMW 2.0 MW 1.23.5
It seeps support for the parameters argument is gone? if you try ¶meters=limit%3D10 the API responds with "Unrecognized parameter: 'parameters'", it doesn't support continue parameter either? Is there a new method for query continue with ask API as the documented methods do not work?