I was checking sixdegreesofwikipedia.com [0] and I saw that it implements an application-driven breath-first search [1], like many other gadgets for Wikipedia.
Very recently I have been experimenting with recursive Common Table Expressions [2], which are or will be available on the latest versions of MySQL and MariaDB.
With a single query on can obtain all titles directly or indirectly in a category:
WITH RECURSIVE cte (cl_from, cl_type) AS ( SELECT cl_from, cl_type FROM categorylinks WHERE cl_to = 'Database_management_systems' -- starting category UNION SELECT categorylinks.cl_from, categorylinks.cl_type FROM cte JOIN page ON cl_from = page_id JOIN categorylinks ON page_title = cl_to WHERE cte.cl_type = 'subcat' -- subcat addition on each iteration ) SELECT page_title FROM cte JOIN page ON cl_from = page_id WHERE page_namespace = 0 ORDER BY page_title; -- printing only articles in the end , ordered by title
(it is more complex than needed because table denormalization, other examples would be much simpler)
Thanks to CTEs, we can traverse hierarchies, without the need of external tools, in a single SQL query and much more efficiently-- it doesn't need an external application.
None of these features are present on the minimum required versions of Mediawiki, or the latest version available on WMF servers-- but I wonder if people- Mediawiki hackers and Tools creators- would be interested on doing those?
[0] https://www.sixdegreesofwikipedia.com [1] < https://github.com/jwngr/sdow/blob/master/sdow/breadth_first_search.py#L36%3... [2] < https://dbahire.com/mysql-8-0-new-features-in-real-life-applications-roles-a...
---------- Forwarded message ---------- From: mathieu stumpf guntz psychoslave@culture-libre.org Date: Tue, Feb 27, 2018 at 11:17 AM Subject: Re: [Wikitech-l] [Wikimedia-l] What's making you happy this week? (Week of 18 February 2018) To: Wikimedia Mailing List wikimedia-l@lists.wikimedia.org, Pine W < wiki.pine@gmail.com>, "wikitech-l@lists.wikimedia.org" < wikitech-l@lists.wikimedia.org>
What's making me happy this week is joining the "Telegrafo" discussion for ELISo https://t.me/joinchat/CQ8tET7pcCXQSBO1ERPJug and I also just found Six Degrees of Wikipedia https://www.sixdegreesofwikip edia.com/?source=Peace&target=Epistemology.
Le 18/02/2018 à 23:12, Pine W a écrit :
What's making me happy this week is Isarra's persistence in working on the Timeless skin. Timeless is based on Winter. [0] [1]
For anyone who would like to try Timeless, it's available in Preferences under Appearance / Skin.
What's making you happy this week?
Pine ( https://meta.wikimedia.org/wiki/User:Pine )
[0] https://www.mediawiki.org/wiki/Skin:Timeless [1] https://www.mediawiki.org/wiki/Winter _______________________________________________ Wikimedia-l mailing list, guidelines at: https://meta.wikimedia.org/wik i/Mailing_lists/Guidelines and https://meta.wikimedia.org/wiki/Wikimedia-l New messages to: Wikimedia-l@lists.wikimedia.org Unsubscribe: https://lists.wikimedia.org/mailman/listinfo/wikimedia-l, mailto:wikimedia-l-request@lists.wikimedia.org?subject=unsubscribe
_______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l