Hi,
my software uses sub- and super- category enumeration while trying to avoid hidden categories. There's no problem with sub- (?action=query&prop=categories&titles=....&clshow=!hidden), but there's no corresponding parameter for super-categories ( ?action=query&list=categorymembers&cmtitle= ... ). Is there a way to avoid contradictory states when both are used? Or maybe to achieve hidden avoiding for super-categories some other way?
I asked about this four years ago, but not at the list ( https://www.mediawiki.org/wiki/Topic:Ra34est5vsl7fxdc), no answers at the time, probably something changed since then or someone would give me some workaround
Thanks in advance,
Max
You can use 'categorymembers' as a generator, and use 'prop=categoryinfo' to display information about whether each category is hidden. You can't use this to filter the results, but you can do that in your application code and it still saves a lot of extra queries.
Example: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=quer y&format=json&prop=categoryinfo&generator=categorymembers& formatversion=2&gcmtitle=Category%3AWikipedia_article_ cleanup&gcmtype=subcat&gcmlimit=max
On Tue, Jun 27, 2017 at 4:26 PM, Max Vlasov max.vlasov@gmail.com wrote:
Hi,
my software uses sub- and super- category enumeration while trying to avoid hidden categories. There's no problem with sub- (?action=query&prop= categories&titles=....&clshow=!hidden), but there's no corresponding parameter for super-categories ( ?action=query&list=categorymembers&cmtitle= ... ). Is there a way to avoid contradictory states when both are used? Or maybe to achieve hidden avoiding for super-categories some other way?
I asked about this four years ago, but not at the list ( https://www.mediawiki.org/wiki/Topic:Ra34est5vsl7fxdc), no answers at the time, probably something changed since then or someone would give me some workaround
Thanks in advance,
Max
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Thanks, Bartosz.
I will probably use such method, at least it allows filtering of some kind.
It's interesting that "Contents" is a hidden category, this was a part of my problem. I'm not sure now what should I use as a root (roots) of the category explorer. The task is more complex since I need it to be language agnostic. Currently the root is Contents and it is retrieved for any language from the page api.php?action=query&titles=Category:Contents&prop=langlinks. Is the category "Articles" is more suitable for the task, being the direct sub-category of Contents, not hidden?
Max
On Tue, Jun 27, 2017 at 6:00 PM, Bartosz Dziewoński matma.rex@gmail.com wrote:
You can use 'categorymembers' as a generator, and use 'prop=categoryinfo' to display information about whether each category is hidden. You can't use this to filter the results, but you can do that in your application code and it still saves a lot of extra queries.
Example: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=quer y&format=json&prop=categoryinfo&generator=categorymembers&fo rmatversion=2&gcmtitle=Category%3AWikipedia_article_cleanup& gcmtype=subcat&gcmlimit=max
On Tue, Jun 27, 2017 at 4:26 PM, Max Vlasov max.vlasov@gmail.com wrote:
Hi,
my software uses sub- and super- category enumeration while trying to avoid hidden categories. There's no problem with sub- (?action=query&prop=categories&titles=....&clshow=!hidden), but there's no corresponding parameter for super-categories ( ?action=query&list=categorymembers&cmtitle= ... ). Is there a way to avoid contradictory states when both are used? Or maybe to achieve hidden avoiding for super-categories some other way?
I asked about this four years ago, but not at the list ( https://www.mediawiki.org/wiki/Topic:Ra34est5vsl7fxdc), no answers at the time, probably something changed since then or someone would give me some workaround
Thanks in advance,
Max
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
-- Matma Rex
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org