Finding subcategories of a wikipedia category using category and categorylinks table

守給你的承諾、 提交于 2019-12-07 17:55:35

Categories alone have no hierachy. It’s the category pages that make the subcategorization work. So you will also have to get the page_id from the page table to be able to resolve this relation.

It essentially works like this:

  1. Category’s cat_title is a page title.
  2. Find that page_title in the page table, get the page_id
  3. Use the page_id to get the category link in cl_from
  4. Get the parent category title from cl_to
  5. Repeat from 2
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!