The docs say backlinks are sorted by titles ( https://www.mediawiki.org/wiki/API:Backlinks .... "Ordered by linking page title"). I noticed that this is partially true. So while most of them look like sorted alphabetically, usually there are sections at the end of the list when there are plenty items that are not. So they look like they added later not obeying the sorting rule. The example is the article https://en.wikipedia.org/wiki/Teleology where the first page of "What links here" ( non-redirect articles) contains non-ordered items. Is this expected?
But apart from figuring out whether there's a bug or not, another thought is that the alphabetical sort (if it works) is controversial since in any form of presentation, A-items are prime visible entities, while Z-items tend to be obscured if the list is long. So is it possible to implement other kind of sort, for example, something like PageRank for backlinks, so the links are sorted by the number of links coming to them? Sure There is a technical side (whether the structure of the database will allow this) and probably legal (I hope Larry Page won't mind and won't sue WikiMedia for this)
I consider backlinks important because they tend to have "see also" and "category" flavor in them, so just by looking at a partial list, I acquire additional knowledge and expectancy.
Thanks,
Max
On Fri, Jun 2, 2017 at 11:25 AM, Max Vlasov max.vlasov@gmail.com wrote:
The docs say backlinks are sorted by titles (https://www.mediawiki.org/ wiki/API:Backlinks .... "Ordered by linking page title").
That's not correct. Fixed the doc.
They're actually ordered by linking pageid if you don't specify multiple values for blnamespace, or by namespace then pageid if you do.
It may be better to use prop=linkshere rather than list=backlinks. That module is much less complicated and hacky.
So is it possible to implement other kind of sort, for example, something like PageRank for backlinks, so the links are sorted by the number of links coming to them?
No. The database structure doesn't allow efficient querying with any ordering other than the ordering used here. Number of incoming links in particular would be extremely slow, or with some rather significant changes to the code and database it might be able to be improved to merely being very slow.
BTW, Google's "PageRank" is, as far as I know, more complicated than just "number of incoming links".
On Fri, Jun 2, 2017 at 8:24 PM, Brad Jorsch (Anomie) bjorsch@wikimedia.org wrote:
They're actually ordered by linking pageid if you don't specify multiple values for blnamespace, or by namespace then pageid if you do.
It may be better to use prop=linkshere rather than list=backlinks. That module is much less complicated and hacky.
Brad, thanks for clarification. Are there any other reason to use linkshere instead of backlinks? I mean it's not so rare to have more confidence in a recent (re)implementation of some feature (as a developer I'm also no exception). For example, it might be that if some novelty is on the agenda, it is more likely it will be implemented exclusively in linkshere module since it's more recent and stable rather than in both.
mediawiki-api@lists.wikimedia.org