Skip to main content
QUICK REVIEW

[Paper Review] Creating and Querying Personalized Versions of Wikidata on a Laptop

Hans Chalupsky, Pedro Szekely|arXiv (Cornell University)|Aug 6, 2021
Semantic Web and OntologiesComputer Science4 references6 citations
TL;DR

This paper introduces Kypher, a lightweight query language and processor within the KGTK toolkit that enables users to create personalized, queryable versions of Wikidata on a standard laptop. By using a compact, tabular KGTK data model and optimized SQLite storage, Kypher executes complex, large-scale knowledge graph queries up to 10x faster than public SPARQL endpoints, making advanced analytics on Wikidata accessible without high-end infrastructure.

ABSTRACT

Application developers today have three choices for exploiting the knowledge present in Wikidata: they can download the Wikidata dumps in JSON or RDF format, they can use the Wikidata API to get data about individual entities, or they can use the Wikidata SPARQL endpoint. None of these methods can support complex, yet common, query use cases, such as retrieval of large amounts of data or aggregations over large fractions of Wikidata. This paper introduces KGTK Kypher, a query language and processor that allows users to create personalized variants of Wikidata on a laptop. We present several use cases that illustrate the types of analyses that Kypher enables users to run on the full Wikidata KG on a laptop, combining data from external resources such as DBpedia. The Kypher queries for these use cases run much faster on a laptop than the equivalent SPARQL queries on a Wikidata clone running on a powerful server with 24h time-out limits.

Motivation & Objective

  • To address the limitation of existing Wikidata access methods—such as SPARQL endpoints with 5-minute timeouts or large server-based RDF loads—that hinder complex, large-scale queries.
  • To enable researchers and developers to run resource-intensive knowledge graph analytics on personal laptops instead of requiring powerful servers or cloud infrastructure.
  • To democratize access to Wikidata by allowing users to create customized, extended knowledge graphs by integrating external datasets like DBpedia.
  • To demonstrate that Kypher can outperform public SPARQL endpoints in query performance for analytic workloads, even on modest hardware.

Proposed method

  • Representing Wikidata as a KGTK knowledge graph using a tab-separated edge format (head, edge-label, tail, edge-id), which reduces data bloat compared to RDF.
  • Loading Wikidata and DBpedia data into a local SQLite database using KGTK’s import and transformation pipelines, enabling efficient querying.
  • Implementing Kypher as a subset of Cypher tailored for KGTK’s hyper-relational model, supporting pattern matching and aggregation over large graph subsets.
  • Optimizing query performance through compact storage (142GB vs. 718GB for SPARQL), focused indexing, and read-only execution without update overhead.
  • Using Jupyter notebooks to execute and benchmark Kypher queries, with pre-built indices to accelerate repeated runs.
  • Comparing Kypher performance on a laptop against SPARQL queries on a local Wikidata clone and the public Wikidata SPARQL endpoint under controlled conditions.

Experimental results

Research questions

  • RQ1Can Kypher enable complex, large-scale queries on Wikidata that exceed the 5-minute time limit of public SPARQL endpoints?
  • RQ2Can personalized, extended knowledge graphs combining Wikidata and external sources like DBpedia be efficiently created and queried on a laptop?
  • RQ3How does Kypher’s performance compare to SPARQL endpoints when executing analytic queries on full Wikidata subsets?
  • RQ4What architectural choices in KGTK and Kypher contribute to superior performance on low-resource hardware?

Key findings

  • Kypher completed complex queries on full Wikidata in under 2 hours on a 32GB laptop, while equivalent SPARQL queries on a 24-hour server timeout would not complete.
  • The first run of a Jupyter notebook with Kypher took 349 minutes (5.8 hours), but the second run with preloaded data and indices took only 164 minutes (2.7 hours), showing significant performance gains after initial setup.
  • Kypher achieved a 5x performance improvement over the public Wikidata SPARQL endpoint for the same queries, with some use cases completing in minutes on a laptop versus hours on a server.
  • The compact KGTK data model reduced storage size from 718GB (SPARQL) to 142GB (Kypher), improving I/O locality and cache efficiency.
  • Specialized indexing of graph slices like P279star enabled faster reuse and more efficient query execution compared to general-purpose triple stores.
  • Kypher’s read-only design eliminated the performance overhead of transactional updates, making it faster than general-purpose SPARQL endpoints for analytical workloads.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.