A couple more tips which may be helpful, depending on which API endpoint(s)
If you're using the REST API's page HTML endpoint
(/api/rest_v1/page/html/<title>), category links are marked up with
rel="mw:PageProp/Category", and you can use this fact to find all linked
categories with querySelectorAll.
If you want to query all categories for a page, but omit hidden categories
(those not shown on a typical article view, and which may have less
taxonomic value to the average reader), you can use the clshow parameter:
On Mon, Oct 30, 2017 at 11:49 AM, Michael Holloway <mholloway(a)wikimedia.org>
I think many of us may be having trouble answering this because it's not
quite clear what you're trying to do. Can you be more concrete about what
categories (or what category scheme) you have in mind?
Wikipedia doesn't have a single, overarching hierarchy of categories. A
page may be associated with any number of categories (including zero).
Some of these categories may be subcategories of other categories. Editors
may freely create and remove categories, and add and remove page
associations with these categories.
The REST API currently doesn't expose any category information, but you
can obtain category information through follow up requests to the Action
). For example:
To get all categories associated with the page "Marfa, Texas" on English
To get all pages associated with the category "Category:Cities in Presidio
On Wed, Oct 25, 2017 at 5:13 PM, Christopher Smyth <chris(a)inflighto.com>
We’re a small app development company that has integrated Wikipedia
content into a geo-locating iOS app. The app is working well and the Wiki
content is displaying correctly. However, we’d like to categorise the
Wikipedia content into three categories rather than just one.
Is there a way to filter and categorise Wikipedia content that is
accessed through the REST API? We only use content that is geo-coded (ie
has latitude and longitude) information associated with each article.
How should we go about configuring our API integration so that we can
split Wikipedia content according to its top-level categories? Is there a
way to do this?
Many thanks for your assistance with this request.
+61 (0)417 298 598 <+61%20417%20298%20598>
[image: Inflighto_Source_file_tm_Original Horizontal - EMAIL SIGNATURE
Services mailing list