Making SPARQL queries to Wikidata using Python

Published: Jun 11, 2022 by Steve Baskauf

I recently solved several annoying problems that I’d been having when using SPARQL queries to acquire data from Wikidata. My success inspired me to write a comprehensive Python class that will reliably carry out every kind of SPARQL Query and Update, with defaults to easily make SELECT queries to Wikidata.

To read the post, visit this link.

You can access the code from this file at GitHub

Share

Latest Posts

Open Science recipes published
Open Science recipes published

My colleage from the Vanderbilt Libraries’ Digital Lab, Shenmeng Xu, an I have published two chapters in the ACRL’s 2025 Open Science Cookbook. The Cookbook is a lighthearted take on technical topics where instructions are given in “recipe” format to teach beginners new tech skills.

Favorite winners of Nebula Award for Best Novel
Favorite winners of Nebula Award for Best Novel

In March 2025, I finished reading all 60 of the winners of the the Nebula Award for Best Science Fiction or Fantasy novel. Many of my favorites were also winners of the Hugo Award, so I wrote a follow-up blog post to my earlier post about my favorite Hugo winners, focusing on favorites that weren’t already discussed in the Hugo post.

Favorite winners of Hugo Award for Best Novel
Favorite winners of Hugo Award for Best Novel

In May 2023, I finished reading all 71 of the winners of the the Hugo Award for Best Science Fiction or Fantasy novel. There were some fantastic books on that list and some real duds.