title: How to build wikipedia category hierarchy?
body: <p>I'm trying to build the treegraph of wikipedia articles and its categories. What do I need to do that?</p>
  
  <p>From this site (<a href="http://dumps.wikimedia.org/enwiki/latest/" rel="noreferrer">http://dumps.wikimedia.org/enwiki/latest/</a>), I've downloaded:</p>
  
  <ul>
  <li>enwiki-latest-page.sql.gz</li>
  <li>enwiki-latest-categorylinks.sql.gz</li>
  <li>enwiki-20141106-category.sql.gz</li>
  </ul>
  
  <p>I tried followed the answer here (<a href="https://stackoverflow.com/questions/17432254/wikipedia-category-hierarchy-from-dumps">Wikipedia Category Hierarchy from dumps</a>), but it doesn't seem that the categorylinks has the same schema (no pageId column).</p>
  
  <p>What's the right way to build the hierarchy?</p>
  
  <p>Bonus question: How can I tell which of the 35M pages in enwiki-latest-page.sql.gz are articles (supposedly about 5M according to wikipedia statistics)</p>
  
  <p>Thanks</p>