Currently we are experiencing problems when we try to query wikipedia. Fetching content via the Wikipedia API can be a lot easier in our opinion. The problem we have is that it is possible to fetch content via the property "rvsection", which will accept a value (number) which represents the section number starting from the top section to the bottom section. This is a very "dangerous" way of fetching content. When there is another section inserted on top of the page, all section numbers will be moved 1 up.
A better way for fetching content via an API is to assign a unique ID to a section, a paragraph, a table, an image etc. This way we could simply fetch a part of the content of wikipedia via this ID.
I would like to know if my problem is shared with other developers inside the Wikipedia API team.
Kind regards, Daan Kuijsten
On Wed, Apr 23, 2014 at 3:48 AM, Daan Kuijsten daankuijsten@gmail.comwrote:
A better way for fetching content via an API is to assign a unique ID to a section, a paragraph, a table, an image etc. This way we could simply fetch a part of the content of wikipedia via this ID.
That doesn't sound much better. Say a vandal blanks a page then someone reverts, and probably all your unique ID numbers will have changed. Or someone renames a section or edits a paragraph, or combines two sections, or splits a section into two, etc.
On Wed, 23 Apr 2014 09:48:17 +0200, Daan Kuijsten daankuijsten@gmail.com wrote:
A better way for fetching content via an API is to assign a unique ID to a section, a paragraph, a table, an image etc. This way we could simply fetch a part of the content of wikipedia via this ID.
Such ids already exist, and they are present in the page HTML as 'id' attributes on the headings. They are constructed simply based on heading text, with unique identifiers appended if duplicates happen. You can access these via the API too, using action=parse&prop=sections [1] (the 'anchor' property), then map them to the numerical identifiers other API modules use (the 'number' property).
[1] https://en.wikipedia.org/w/api.php?action=parse&page=Main%20Page&pro...
wikitech-l@lists.wikimedia.org