Skip to content

The Reason For It All

Gerard has blogged tirelessly about improvements to Reasonator, my attempt at making Wikidata a little more accessible. Encouraged by constant feedback, suggestions, and increasing view numbers, it has grown from “that thing that shows biography data” into a versatile and, more importantly, useful view of Wikidata. This is my attempt at a summary of the state of Reasonator.


Johann Sebastian Bach (Q1339). Reasonator and Wikidata side-by-side comparison.

The Cake

Reasonator attempts to show a Wikidata item in a way that it easy to access by humans. By focusing on display rather than editing, a lot of screen real estate can be used to get the information to the reader.

Besides the main body of text, there is a sidebar reminiscent of the Wikipedia infoboxes, containing images (of the item itself, as well as signature, coat of arms, seal, audio, video, etc.), simple string-based information (such as postal codes), links to external sources via their ID (such as VIAF), links to other Wikimedia projects associated with the item, and miscellaneous tidbits such as a QRpedia code (by special request).

The main text consists of a header (with title, Wikidata item number and link, aliases, manual and automatic description, where available), a body mostly made of linked property-value lists, and a footer with links to an associated Commons category, and images from related items. Qualifiers are shown beneath the respective claims. So far, not much more than what you get on Wikidata, except some images and pretty layout.

The Icing

Cambridge Reasonator

Cambridge (Q350) with Wikivoyage banner, location hierarchy, and maps.

One fundamental difference between the Wikidata and the Reasonator displays is that the latter is context-sensitive; it supports specialized information rendering for certain item types, and only uses the generic one as a fall-back. Thus, for a biographical item, there are the relatives (if any), and a link to the family tree display; Wikivoyage banner, OpenStreetMap displays (two zoom levels), map image, and a hierarchy list for a location; an automatically generated taxonomy list for a species.

Even the generic item display can generate a hierarchy via the “subclass of” property. Such hierarchical lists are generated by Wikidata Query for speed reasons, but can also be calculated on the “live” data, if you want to check your latest Wikidata edit. There are already requests for other specialized item types, such as books and book editions.

The bespoke display variations and hierarchical lists hint at the “reason” part of the Reasonator name: It does not “just” display the item, but also looks at the item type, as well as related items. Statues depicting Bach, things that are named after him, items for music he has composed – all is displayed on the item page, even though the item itself “knows” nothing about those related items. Reasonator also has some build-in inferences: any son of Bach’s parents is his brother, even if neither item has the “brother of” property.

JCF Bach

Hover box for J.C.F. Bach.

Every link to another Wikidata item (which will point to the appropriate Reasonator page for browsing continuity) has a “hover box” that will pop up when you move the mouse over the link. The box contains the label of the item; a link to Wikidata; links to Wikipedia, Wikisource, and Wikivoyage in the current language; a manual description; an automatic description (with appropriate Reasonator links); and a thumbnail image, all subject to availability.

Strange Ingredients

Reasonator has a faux “Universal Language Selector” to easily switch languages. (I decided to just steal the ULS button and roll my own, with a few lines of JavaScript, rather than including no less than 15 additional files into the HTML page.) Item and property labels will show in your preferred language, with a fallback to the “big ones” (as determined by Wikipedia sizes) first, and a random “minor language” as a last resort. Items using a such a “fallback label” are marked with a dotted red underline, to alert native speakers to missing labels in their language. (A “translate this label now” utility, build into the hover box, is currently held up by a Wikidata bug.) The interface text is translatable as well via a wiki page.

A few candles on top

One simple Reasonator function I personally use a lot is “random page”. The results can be both astonishing (the “richness” of some items is remarkable) and depressing (“blank” items, with no statements, or maybe just a Commons category). Non-content items, such as category or template pages, are not shown by this function, if it knows about them. If you load a page without statements with a “:” in the label, Reasonator offers you a one-click “tagging” of the item as template, category, etc., is you have WiDaR enabled. (If you don’t, you really should!) In a similar manner, Reasonator suggests items to use as a “parent taxon” for species without such a statement, based on the species taxonomic name.

There is also a build-in search function, based on the Wikidata search, enriching it with automatic descriptions and hover boxes. As usual, missing labels are highlighted, and a missing auto-description hints at items lacking fundamental statements. (You can go and edit the item on Wikidata via the link in the hover box, without having to load the Reasonator page first.)

Calendar Tunguska event

A calendar example.

The latest addition is a calendar function. This special type of page is linked to from all date values within Reasonator, using the values’ accuracy/resolution. This is inspired by the “year” pages on Wikipedia, alas, it requires no additional effort by humans, besides the addition of date values to Wikidata (which should be done anyway!). The page uses Wikidata Query to aggregate items with events inside the set time period (day, month, year). At this moment, events (“point in time”), foundation/creation/discovery dates, births and deaths are shown. Additionally, there is a list of “ongoing events”, which started less than 10 years before and ended less than 10 years after the viewed date. A sidebar allows navigation by date, and hover boxes give a quick insight into the listed items.

Here as well, Reasonator uses more than a simple “list of stuff”. Relevant dates are shown besides the item, e.g., death dates in the birthday list. For a specific day, births and deaths are shown side-by-side to avoid blank space; for month/year displays, both birth and death dates are shown (as they are not specifically implied by the date), and the display wraps after the births list.

For a whole, “recent” year (such as 1900), it can take a while to show the page. Counter-intuitively, this is not because it takes time to find the items; all the items for a year are returned by Wikidata Query in less than half a second. It is the loading of several thousand (in this example, over 3,000) items, their labels, descriptions, Wikipedia sites, etc. from the Wikidata API (at a maximum of 50 apiece) that takes a while.

Serving suggestion

This leads nicely to another perk of Reasonator: speed. Recently, I optimized Reasonator to load as fast as possible. This leads to the odd situation that the J.S. Bach entry takes, on my laptop, 43 seconds to load on Wikidata (logged out, force-reload), but shows all text in Reasonator in 8 seconds, and finishes loading all images after another 7 seconds. This is despite Reasonator loading over 600 additional items to provide the context described above. This was achieved by reducing the serial number of requests (where one request depends on the result of the previous one) to the Wikidata API, parallel loading of scripts and interface texts, grouping and parallelizing Wikidata API requests, and “outsourcing” complex queries, such as the hierarchical lists and the calendar, to Wikidata Query (while providing a native JavaScript fall-back for most).

A wafer-thin mint

So what’s the point of all of this? For most people who come across Wikidata, it presents itself either as a back-end to Wikipedia (for language links, and infobox statements, on some wikis), or as a somewhat dull editing interface for form fetishists. I have tried to breathe some life into aspects of Wikidata with other tools, but Reasonator allows to dwell through all of its information.

And while a human-written English Wikipedia will always be infinitely more readable than any Wikidata interface, I hope that Reasonator could one day be a useful addition to small-language Wikipedias, and scale for such a community; on Wikidata/Reasonator, you only have to translate “singer” once to have everyone with that occupation labelled as such; you don’t have to manually include hundreds of thousands of images from Commons; and you don’t have to manually curate birthday lists.

Finally, I hope that browsing Reasonator will not only be interesting, but to encourage people to participate and improve Wikidata. A claim-less page can be a big motivator to improve it, and even a showcase item is more fun if it doesn’t take a minute to load…