Wikidata or Scraping Wikipedia
This is a great post, which also happens to serve as a good illustration of the &quot;curse of knowledge&quot; and the typical blind-spots of enthusiasts. Consider the timeline of events:<p>• The blog post on scraping Wikipedia (<a href="https:&#x2F;&#x2F;billpg.com&#x2F;data-mining-wikipedia&#x2F;" rel="nofollow">https:&#x2F;&#x2F;billpg.com&#x2F;data-mining-wikipedia&#x2F;</a> , HN discussion 4 days ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28234122" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28234122</a> which mentions Wikidata as an alternative etc.<p>• The author of this post, a Wikidata person, finds this an &quot;extremely surprising discussion&quot;, and posts a Twitter thread ( <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20210820105621&#x2F;https:&#x2F;&#x2F;twitter.com&#x2F;vrandezo&#x2F;status&#x2F;1428501116401061899" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20210820105621&#x2F;https:&#x2F;&#x2F;twitter.c...</a> ) ending with<p>&gt; <i>I don&#x27;t want to argue or disagree, I am just completely surprised by that statement. Are the docs so bad? Is the API design of Wikidata so weird or undiscoverable?  There are plenty of libraries for getting Wikidata data, are they all so hard to use? I am really curious.</i><p>This curiosity is a great attitude! (But…)<p>• After seeing the HN discussion and responses on Twitter&#x2F;Facebook, he writes this post linked here. In this post, he does mention what he learned from potential users:<p>&gt; <i>And there were some very interesting stories about the pain of using Wikidata, and I very much expect us to learn from them and hopefully make things easier. The number of API queries one has to make in order to get data […], the learning curve about SPARQL and RDF (although, you can ignore both, unless you want to use them explicitly - you can just use JSON and the Wikidata API), the opaqueness of the identifiers (wdt:P25 wd:Q9682 instead of “mother” and “Queen Elizabeth II”) were just a few. The documentation seems hard to find, there seem to be a lack of libraries and APIs that are easy to use. And yet, comments like &quot;if you&#x27;ve actually tried getting data from wikidata&#x2F;wikipedia you very quickly learn the HTML is much easier to parse than the results wikidata gives you&quot; surprised me a lot. […] I am not here to fight. I am here to listen and to learn, in order to help figuring out what needs to be made better.</i><p>Again, very commendable! Almost an opening to really understanding the perspective of casual potential users. But then: the entire rest of the post does not really address &quot;the other side&quot;, and instead completely focuses on the kinds of things Wikidata enthusiasts care about: comparing Wikipedia and Wikidata quality in this example, etc.<p>I mean, sure, this query he presents is short:<p><pre><code>    select * { wd:Q9682 (wdt:P25|wdt:P22)* ?p . ?p wdt:P25|wdt:P22 ?q } 
</code></pre>
but when he says:<p>&gt; <i>I would claim that I invested far less work than Bill in creating my graph data. No data cleansing, no scraping, no crawling, no entity reconciliation, no manual checking.</i><p>he&#x27;s ignoring the work he invested in learning that query language (and where to query it), for instance. And this post would have been a perfect opportunity to teach readers about how to go from the question &quot;all ancestors of Queen Elizabeth&quot; to that query (and in trying to teach it, he may have better discovered exactly what is hard about it), but he just squanders the opportunity (just as when he says &quot;plenty of libraries&quot; without inviting exploration by linking to the easiest one): this is a typical thing enthusiasts do, which is unfortunate IMO.<p>When scraping HTML from Wikipedia, one is using general-purpose well-known tools. You&#x27;ll get slightly better at whatever general-purpose programming language and libraries you were using, learn something that may be useful the next time you need to scrape something else. And most importantly, you know that you&#x27;ll finish, you can see a path to success. When exploring something &quot;alternative&quot; like Wikidata, you aren&#x27;t sure if it will work, so the alternative path needs to work harder to convince potential users of success.<p>---<p>Personal story: I actually <i>know</i> about the existence of Wikidata. Yet the one time I tried to use it, I couldn&#x27;t figure out how. This is what I was trying to do: plot a graph of the average age of Turing Award winners by year. (Reproduce the first figure from here: <a href="http:&#x2F;&#x2F;hagiograffiti.blogspot.com&#x2F;2009&#x2F;01&#x2F;when-will-singularity-occur.html" rel="nofollow">http:&#x2F;&#x2F;hagiograffiti.blogspot.com&#x2F;2009&#x2F;01&#x2F;when-will-singular...</a> just for fun) One would think this is a perfect use-case for Wikidata: presumably it has a way of going from Turing Award → list of winners → each winner&#x27;s date of birth. But I was stymied at the very first step: despite knowing of the existence of Wikidata, and being able to go from the Wikipedia page that lists all recipients (current version: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;w&#x2F;index.php?title=Turing_Award&amp;oldid=1028806461#Recipients" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;w&#x2F;index.php?title=Turing_Award&amp;oldi...</a> ) to the Wikidata item for &quot;Turing Award&quot; (look for &quot;Wikidata item&quot; in the sidebar on the left) <a href="https:&#x2F;&#x2F;www.wikidata.org&#x2F;wiki&#x2F;Q185667" rel="nofollow">https:&#x2F;&#x2F;www.wikidata.org&#x2F;wiki&#x2F;Q185667</a> I could not quickly find a way of getting a list of recipients from there. Tantalizingly, the data maybe does exist e.g. if I go to one of the recipients like Leslie Valiant <a href="https:&#x2F;&#x2F;www.wikidata.org&#x2F;wiki&#x2F;Q93154" rel="nofollow">https:&#x2F;&#x2F;www.wikidata.org&#x2F;wiki&#x2F;Q93154</a> I see a &quot;statement&quot; award received → Turing Award with &quot;property&quot; point in time → 2010. Even after coming so close, and being interested in using Wikidata, it was not easy enough for me to get to the next step (which I still imagine is possible, maybe with tens of minutes of effort), until I just decided &quot;screw this, I&#x27;ll just scrape the Wikipedia page&quot; (I scraped the wikisource rather than html). And if one is going to have to scrape anyway, then might as well do the rest too (dates of birth) with scraping.