Introduction

In Digital Humanities research, structured data is an extremely valuable resource. When information about people, places, works, and events is organized in a machine-readable format, large-scale data analysis and cross-dataset integration become possible.

Wikidata is a free knowledge base operated by the Wikimedia Foundation, containing over 100 million items. The Wikidata Query Service is a free web service that allows you to execute SPARQL queries against this database and visualize results in various formats.

Key Features

1. Flexible Search with SPARQL

SPARQL (SPARQL Protocol and RDF Query Language) is a query language for searching RDF (Resource Description Framework) data. With SQL-like syntax, you can perform complex conditional searches against Wikidata’s knowledge graph.

For example, you can query for “all Japanese-born Nobel Prize laureates” or “books published in 17th-century Europe that have been digitized” — combining multiple conditions for sophisticated searches.

2. Multiple Result Visualizations

Query results can be displayed in various formats:

  • Table: Standard tabular display
  • Map: Plot results containing coordinate data on a map
  • Timeline: Chronological display of data with temporal information
  • Bubble Chart: Compare numerical data
  • Line / Bar Chart: Statistical visualization
  • Tree Map: Display hierarchical data
  • Image Grid: Gallery display for data containing image URLs

3. Extensive Example Queries

The Wikidata Query Service includes numerous example queries. Even those unfamiliar with SPARQL can reference these examples to build their own queries.

4. Linked Open Data Integration

Wikidata functions as a central hub for Linked Open Data (LOD). Each item has a unique URI (e.g., Q42 = Douglas Adams) and includes links to other knowledge bases (DBpedia, VIAF, GND, etc.).

SPARQL Basics

Basic Query Structure

The basic structure of a SPARQL query:

SELECT ?item ?itemLabel
WHERE {
  ?item wdt:P31 wd:Q5 .        # instance of: human
  ?item wdt:P27 wd:Q17 .       # country of citizenship: Japan
  ?item wdt:P166 wd:Q35637 .   # award received: Nobel Prize
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ja" . }
}
  • wdt:P31 is the property “instance of”
  • wd:Q5 is the item “human”
  • SERVICE wikibase:label automatically retrieves labels (names)

Commonly Used Properties

PropertyMeaningExample
P31Instance ofQ5 (human), Q515 (city)
P17CountryQ17 (Japan)
P27Citizenship
P569Date of birth
P570Date of death
P625Coordinates
P18Image
P106Occupation

DH Research Applications

Historical Figure Analysis

Extract person data from specific eras and regions to analyze occupational distributions and areas of activity.

# List of ukiyo-e artists with coordinates
SELECT ?artist ?artistLabel ?birthPlace ?birthPlaceLabel ?coords
WHERE {
  ?artist wdt:P106 wd:Q1028181 .  # occupation: ukiyo-e artist
  ?artist wdt:P19 ?birthPlace .    # place of birth
  ?birthPlace wdt:P625 ?coords .   # coordinates
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ja" . }
}

Displaying these results on a map immediately reveals the geographic distribution of ukiyo-e artists’ birthplaces.

Cultural Resource Research

Retrieve museum collection and cultural property data from Wikidata for statistical analysis. For example, examine the chronological distribution of works in a specific museum or the breakdown by genre.

Bibliographic Data Exploration

Search book data by author, publication place, and publication year to analyze geographic and chronological patterns in publishing activity.

Linguistic Investigation

Since Wikidata contains multilingual label information, it can also be used for linguistic investigations comparing how specific concepts are expressed across different languages.

How to Use

  1. Visit Wikidata Query Service
  2. Reference sample queries from “Examples” on the left, or enter a query in the editor
  3. Click the “Execute” button (triangle) to run the query
  4. Switch between display formats (table, map, chart) in the results area
  5. Download results in CSV, JSON, TSV, and other formats

Tips and Considerations

  • Queries have a time limit (60 seconds), so use LIMIT clauses when retrieving large datasets
  • Use OPTIONAL clauses to include results even when data is missing
  • Wikidata is editable by anyone, so data accuracy is not guaranteed — verify results for important analyses
  • Use the sharing feature (Short URL) to easily share queries with other researchers
  • Forgetting SERVICE wikibase:label will display only IDs in results

Advanced Usage

Integration with Other Tools

Download data from Wikidata Query Service as CSV and visualize it in Palladio, or import it into TimelineJS spreadsheets for richer analysis and presentation.

Programmatic Access

Send HTTP requests to the SPARQL endpoint (https://query.wikidata.org/sparql) to execute queries directly from Python, R, or other programming languages. Incorporate this into your research workflow to automate data retrieval.

Summary

Wikidata Query Service is a powerful free tool that lets you execute SPARQL queries against over 100 million structured data items and visualize results in multiple formats. It serves as an invaluable foundation for large-scale exploration of relationships between people, places, works, and events in DH research. While SPARQL has a learning curve, starting with example queries and gradually building proficiency is a recommended approach.