Using Observable to explore Wikidata

I think that Observable is a great tool to explore Wikidata.

Wikidata is a collaborative knowledge base. It’s a sister project for Wikipedia. Each Wikipedia article is linked to a Wikidata item. For instance, the Wikipedia article about [Florence Nightingale] (Florence - Wikipedia Nightingale) is linked to a Wikidata item. Of course, the big advantage of Wikidata is that data is structured. It can be queried using which uses the SPARQL syntax. is very powerful but limited if you want to draw a visualisation or tell a story with the data.

Of course @mbostock has a nice Hello Wikidata notebook. @lukesmurray has a nice trick to show a query directly in the notebook without any javascript manipulation : Using WikiData Sparql as a "Cell Mode" in Observable / Luke Murray / Observable.

@piecesofuk has a nice notebook exploring UK government : UK Parliament: Cabinet Ministers / piecesofuk / Observable

Since I really believe that Observable is great to explore Wikidata, I’ve written a small introduction for Wikidata users: An introduction to Observable for Wikidata users / PAC / Observable

I also have some examples:

Of course Wikidata and SPARQL are also useful to explore Wikipedia:

I’m sure that there are lots of other great examples and I’d really be interested in creating more bridges between Observable and Wikidata communities.


SPARQL is not the only way to retrieve data from Wikidata. There is also an API. Here are some functions using Wikidata API: Wikidata API / PAC / Observable

1 Like

A new notebook which look at the history of the tour de France using a query from Wikidata : Tour de France's history at a glance / PAC / Observable


Observable users interested in discovering Wikidata and SPARQL may have a look at the SPARQL wikibook : SPARQL - Wikibooks, open books for an open world and the Wikidata introduction Wikidata:Introduction - Wikidata

Here is a new notebook Article's wikilinks inspector / PAC / Observable which provides insight about all entities named in a Wikipedia article.

It’s useful to compare articles. For instance, you can see that Sociology in English cites 53 Americans (Article's wikilinks inspector / PAC / Observable) whereas the corresponding article in French cites a majority of French people (Article's wikilinks inspector / PAC / Observable). Both article are about the same topic but the content is different.


New tool to explore gender diversity in Wikipedia Gender diversity inspector / PAC / Observable. It now filter on birthdate.

1 Like

I have collected a dataset including 2,400 SPARQL queries : Hello SPARQL queries dataset / PAC / Observable

1 Like

I have some new notebooks:

1 Like

The work of the recent Nobel laureate Annie Ernaux in one notebook : Tribute to Annie Ernaux / PAC / Observable


@pac02 thanks for sharing the examples!


Tonight’s dataviz shows all Nobel laureates by gender : All Nobel laureates by gender and by year / PAC / Observable.

1 Like

@pac02 hi are you presenting these notebooks anywhere or just sharing your learnings?

1 Like

I essentially share my notebooks with the Wikidata community, most often in the weekly newsletter Wikidata:Status updates - Wikidata.


I’ve tried a new visualization : all the works published by Nobel laureates in literature by age in one dataviz : Career of Nobel laureates in literature / PAC / Observable

There is some overlap. So it’s not perfect. Any idea to improve this graph is welcome.

Yet another example : by @johnsamuelwrites.

@johnsamuelwrites has written nice functions to extract values from the query. I’ll try to reuse them in the future.

Here is a thread of 24 visualizations for the advent : PAC2: "I'll try to post each day a dataviz related to #W…" - It includes visualization of Wikipedia and Wikidata.

Here is a hashtag which allows to find all notebooks using Wikidata This notebook is a fork