Sparnatural : a visual knowledge graph exploration tool

Abstract

Knowledge Graphs are often relying on conceptual models with a high level of abstraction, making them hard to understand for nonexpert users, and are often hidden behind search forms, losing the flexibility to interact with the graph as a graph. In order to leverage knowledge graphs there is a need to propose end-user oriented interactions demonstrating how they can allow to discover a knowledge domain. Sparnatural was designed and developed as a visual, configurable, easily deployable, open-source, client-side SPARQL query builder, allowing users to query any RDF knowledge graph. We describe here how Sparnatural works, how it can be configured, and we show how it was deployed in two demonstrators for the Archives Nationales de France and Bibliothèque Nationale de France. We show how Sparnatural has made it possible to give access to nonexpert users, with little effort, to these two large graphs. Workshops conducted with end-users showed they were enthusiastic about the possibility offered. They also revealed that this novel search paradigm is surprising and could benefit from user onboarding. The configuration of Sparnatural is key in providing efficient access to the graph; we plan to work on semi-automated configuration generation from the graph structure, as well as adding new value selection widgets such as selection on a map to generate GeoSPARQL queries.

This is a submission for a demonstration.

Introduction

The requirement for data interoperability has driven the development of many conceptual models used for structuring knowledge graphs. In the field of digital humanities we can think of CIDOC-CRM](cite:cites cidoccrm) for cultural heritage, LRM [1] for libraries, or RIC-O [2] for archives. The knowledge graphs based on these ontologies are accessible either using a developer-oriented service (SPARQL endpoint), or sometimes they underly other search systems, typically multicriteria query forms or faceted search engines.

Data interoperability and data aggregation from silos in a homogeneous graph require a lot of effort, at the intellectual, business process and technical levels. These efforts are hard to explain and demonstrate, because no good solution exists to actually make the graph tangible for managers and accessible for end-users: SPARQL endpoints are too technical, and search systems look like any other information retrieval system, and does not make the graph tangible.

Sparnatural: an intuitive visual SPARQL query builder

Sparnatural [3] provides an innovative search paradigm to explore and discover these knowledge graphs. A presentation video [4] demonstrates its features. Technically speaking, Sparnatural is a visual SPARQL query builder, written in Javascript, operating purely on the client. Its only requirement is a CORS-enabled SPARQL endpoint to which the queries can be sent. Sparnatural is open-source, under a LGPL license.

Sparnatural visually displays the query pattern with connectors and indentation, as in Figure 1 below:

A Sparnatural example query

Fig. 1: A query edited in Sparnatural: “Archive records that have as provenance a Person who is a member of an organization of type ‘Notarial Office’, and that are of type ‘bill of sale’ or ‘civil status document’“

Each line in the query mimics the structure of an RDF triple pattern with a subject type, a predicate, an object type and, optionally, some values. At each step, dropdown lists enable the user to directly see the available types of entities and predicates in the graph.

Values of a criterion can be selected with either dropdown lists, autocompleted search fields, date ranges (at either year or date precision) with calendar selection, tree selector to browse a hierarchy, boolean values, or plain text search field.

The set of columns in the result set can be controlled by activating the “eye” icon on the arrows in the query pattern that should be included as columns in the result set. The bottom part of the query editor can be opened to further control the order of columns, their names and sort options.

The interface allows rapid “trial and error” interactions, allowing the users to build their own mental representation of the structure of the graph.

Sparnatural also offers the ability to load predefined queries, enabling data publishers to propose sample queries that can be loaded in one click. This can serve as query templates that the users can modify.

While OPTIONAL and FILTER NOT EXISTS are supported, Sparnatural does not have the objective of covering 100% of SPARQL keywords; currently it does not support UNION, SERVICE, FROM, or Aggregate functions such as COUNT.

Sparnatural can be combined with the YASGUI [5] SPARQL results display component to print the results of the generated SPARQL query.

Demonstrators

The French National Archives (ANF) and the French National Library (BNF) conducted a project to add features to Sparnatural and to build two demonstrators to test its deployment on their respective knowledge graphs. The project was successfully concluded in June 2022 by a presentation at the ANF [11].

The demonstrator of the ANF [12] allows exploring a dataset based on RIC-O [2], of about 50 million triples describing notarial archives. The demonstrator proposes two configurations of Sparnatural to navigate the same data: a generic one, that could be used for any RIC-O-based knowledge graph, and a more precise, showing specific criteria for notarial archives.

The demonstrator of the BNF [13] allows querying the data already accessible in the data.bnf.fr [14] portal, of about 600 million triples, and based on an LRM-like [1] ontology. The performance of the SPARQL endpoint was sufficient to allow to deploy Sparnatural without further performance tuning.

The project included three workshops to confront end-users with the tool and gather feedback. Users were mostly enthusiastics, but some were lost by this new search paradigm. Some feedback was taken into account, such as the inclusion of the query execution button, or the “reset” button.

Ontology-driven configuration of Sparnatural

Sparnatural is configured by an OWL ontology, defining which classes and relationships are shown in the interface. The ontology defines the (multilingual) labels and tooltips, icons, or which value selection widget should be used for each predicate. The dropdown list and autocomplete widgets are also associated with a SPARQL query that populates the list or the autocomplete suggestions.

A key aspect of that configuration ontology is that it does not need to be exactly the same as the ontology of the underlying knowledge graph. Classes or properties can be removed to show only part of the graph; they can be labeled differently, and documented with user-oriented tooltips; shortcuts can be proposed: a single predicate in the search interface can correspond to a property path in the underlying graph structure, traversing multiple entities; classes presented to users can be subsets of the (in general relatively abstract) classes of the underlying graph ontology.

The mapping to the underlying graph ontology is done through the use of an annotation (sparnatural-config:sparqlString) enabling to replace the corresponding class or property identifier in the SPARQL query by another string. The final SPARQL query generation is done in two steps: first, a SPARQL query based on the search interface ontology is built, and then identifiers in it are replaced by their mapping to the graph structure.

The decoupling of the search ontology from the graph structure enables to show the same graph in different ways to different categories of users. The configuration ontologies can also be shared, such as the generic configuration for the ANF demonstrator [15], or the BNF demonstrator [16].

Summary

Sparnatural offers an easy way to leverage knowledge graphs. Users with no technical knowledge of SPARQL and no a priori knowledge of the graph structure can query the data. Its client-side only deployment allows to easily include it in a webpage, replacing or complementing existing SPARQL endpoint forms.

Future work on Sparnatural includes, on the technical side, a rewrite of the component in Typescript for easier inclusion in React applications, and the addition of a geographical search widget; and on the configuration side, the ability to automatically derive a configuration ontology from the underlying graph structure, that can be manually tuned to be presented to end-users.