Making SPARQL More Accessible: My Bachelor's Thesis on Visual Query Graphs
In the world of knowledge representation and retrieval, querying structured data remains a challenge for many users, especially those without extensive technical backgrounds. My bachelor's thesis, Query by Graph, aims to bridge this gap by introducing a Visual Query Builder for SPARQL queries, making it easier to extract information from Wikibase systems like Wikidata and FactGrid.
The Problem: The Complexity of SPARQL Queries
SPARQL, the query language for RDF databases, is incredibly powerful but requires a steep learning curve. Users must understand its syntax and structure, which poses a barrier for non-technical audiences, such as historians, researchers, and digital humanities scholars. Writing queries involves complex reified structures, qualifiers, and intricate relationships between data points. This complexity limits the accessibility of structured data in Wikibase systems.
The Solution: Visual Query Graphs
To simplify this process, my thesis proposes a Visual Query Builder that allows users to construct SPARQL queries through an intuitive graph-based interface. Instead of manually coding queries, users can visually create Visual Query Graphs (VQGs), where entities and relationships are represented as nodes and edges.
The key innovation in this approach is the introduction of labelled hyperedges, which abstract complex reified structures and qualifiers. This means that users can draw the structure of their desired query rather than write it in raw SPARQL code.
Implementation: A Rust-Powered Backend and Web Frontend
The solution is built with a modular Rust backend and a web-based frontend, leveraging modern web technologies such as Vue.js, ReteJS, and TailwindCSS. Rust was chosen for its performance and reliability, and its ability to compile into WebAssembly (WASM), ensuring smooth client-side execution.
Key features of the tool include:
-
Click-And-Build interface for constructing Visual Query Graphs
-
Automatic SPARQL query generation
-
Seamless integration with Wikibase instances (e.g., Wikidata, FactGrid)
-
Real-time search for items and properties
-
Support for multiple data sources
Testing and Future Prospects
The tool underwent preliminary testing with digital humanities students working with FactGrid, and the results were promising. Users were able to build complex queries with minimal training, proving that the system significantly lowers the entry barrier to SPARQL querying.
Future work includes adding:
-
Support for additional SPARQL features (e.g., filters, optional graph patterns)
-
Interactive visualisation of query results
-
Enhanced integration with ontology-driven query snippets
Conclusion
By enabling users to construct queries visually, Query by Graph empowers a wider audience to leverage structured data from Wikibase systems. This project not only contributes to improving data accessibility but also paves the way for further innovations in user-friendly semantic web tools.
To explore the tool, visit: Query by Graph. I look forward to feedback and collaboration opportunities to enhance this research further!
The full bachelor thesis is available here.