Hi,
I'm creating a .Net library to access the API, but I'm not sure how to approach selecting what properties should the result have.
For example, when the user wants to access “info” of some page, I want to offer him all the available properties. And if he selects “length” and “fullurl”, I should form URL like
http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Main...
The “length” property is included by default, and “fullurl” is added by “inprop=url”.
I can get most other information about the structure of the API by using “action=paraminfo”, but information about what result properties are available and how they correspond to the prop values seems to be missing.
Is this information available somewhere? Is trying the query and seeing what properties are returned the best I can do currently? Do you think it would be a good idea if I (or someone else) modified “action=paraminfo” to include this information in some form?
Petr Onderka [[en:User:Svick]]
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
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
mediawiki-api@lists.wikimedia.org