Hi,
I have created a proof of concept of this, which contains the information only for categorymembers. The code is at [1] and it looks something like this (XML formatted):
<props> <prop name="ids"> <properties> <property name="pageid" type="integer" /> </properties> </prop> <prop name="title"> <properties> <property name="ns" type="namespace" /> <property name="title" type="string" /> </properties> </prop> <prop name="type"> <properties> <property name="type"> <type> <t>page</t> <t>subcat</t> <t>file</t> </type> </property> </properties> </prop> </props>
What do you think?
One problem I'm aware of is that the output uses “prop” and “property” to mean something else. Do you have any suggestions for better naming?
After this, I will add the necessary information to the rest of the API modules and then post a patch to bugzilla.
[1] https://github.com/svick/mediawiki/commit/868910637445ea0dcf3ad84bc1ee9fc337...
Petr Onderka [[en:User:Svick]]
On Thu, Nov 10, 2011 at 11:37, Roan Kattouw roan.kattouw@gmail.com wrote:
On Wed, Nov 9, 2011 at 11:36 PM, Petr Onderka gsvick@gmail.com wrote:
Is this information available somewhere? Is trying the query and seeing what properties are returned the best I can do currently?
Unfortunately, no, at least not programmatically.
Do you think it would be a good idea if I (or someone else) modified “action=paraminfo” to include this information in some form?
Yes, please do! Patches are very welcome.
Roan
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Petr Onderka schrieb:
Hi,
I have created a proof of concept of this, which contains the information only for categorymembers. The code is at [1] and it looks something like this (XML formatted):
<props> <prop name="ids"> <properties> <property name="pageid" type="integer" /> </properties> </prop> <prop name="title"> <properties> <property name="ns" type="namespace" /> <property name="title" type="string" /> </properties> </prop> <prop name="type"> <properties> <property name="type"> <type> <t>page</t> <t>subcat</t> <t>file</t> </type> </property> </properties> </prop> </props>
What do you think?
One problem I'm aware of is that the output uses “prop” and “property” to mean something else. Do you have any suggestions for better naming?
After this, I will add the necessary information to the rest of the API modules and then post a patch to bugzilla.
[1] https://github.com/svick/mediawiki/commit/868910637445ea0dcf3ad84bc1ee9fc337...
Nice work. Two questions: * Is that only for retrieving properties of list elements? * Isn't that the right place to start provinding xml/json/whatever schemata for api results? Bergi
Hi,
Nice work. Two questions:
- Is that only for retrieving properties of list elements?
Yeah, that's what I think I need to dynamically create a nice object-oriented library that accesses the API. What elese do you think would be useful?
- Isn't that the right place to start provinding xml/json/whatever
schemata for api results?
With my addition, I think paraminfo provides most of the information something like XSD would. I'm not sure it would be a good idea to add one or more completely different ways to do the same thing. Especially since the schema would be different for each specific query.
Petr Onderka [[en:User:Svick]]
wikitech-l@lists.wikimedia.org