Visual Query Builder

We designed and developed a tool that offers intuitive editing functionalities for constructing complex queries in stSPARQL through a graphical user interface. This tool, called the Visual Query Builder, demands no detailed knowledge of a query language, but at the same time does not limit more experienced users to create queries directly into stSPARQL. The Query Builder provides users with two choices. The choice to construct a query using a graphical user interface through the Facet-Graph based Query Editor and the choice to write a query using stSPARQL through the text based Query Editor. The tool has the ability to convert a graph based query into an stSPARQL query, giving users with some experience with SPARQL but not enough confidence to write a query directly in stSPARQL, the freedom to make any modifications to their query in case they cannot express exactly what they want through the Facet-Graph based Query Editor.

The Query Builder is designed as a Java-based Web Application that consists of two main components, the Query Buider UI and the Query Builder Server. Its development is based on Java and Web frameworks and technologies (Vaadin, Google Web Toolkit, Eclipse Equinox) and ontologies. The workflow of the tool is described in the following paragraphs.

The Query Builder Server takes as input and processes the domain ontologies developed for the NOA and DLR Use Case, which describe the semantics of the content of the data sets to which the constructed query will refer to, and creates a local Sesame repository. This repository is used in order the UI options that are provided for the construction of the graph that represent the query to be derived. Specifically, this graph consists of FacetBoxes resembling the vertices of the graph that either refer to specific classes defined in the underlying ontologies or to concrete geospatial features, such as polygons or line strings, that can be defined by the user. FacetBoxes also enable the user to specify simple constraints on the range of various properties (mostly DataProperties) of the referenced class. These FacetBoxes are connected by PropertyEdges that represent Object- or Data Properties defined in the underlying ontologies.

Using these UI options that are provided through the Facet-Graph based Query Editor, the user is able to create a query with the construction of a graph. After the construction of the graph-based query, the user has two options. The first option is for the user to send the query directly to Strabon and retrieve the results. The Query Builder transforms automatically the graph-based query to its respective stSPARQL query string before sending it to Strabon. The second option is for the user to decide to modify the constructed query through the text based Query Editor. In the text-based Query Editor, the user can find the respective stSPARQL query string of the graph-based query and apply to it any changes he wants before sending the final query to Strabon. The user of course can use the text-based Query Editor to write directly a query in stSPARQL, without previously constructing a graph-based query.

In the scope of the TELEIOS project, the Visual Query Builder is implemented in order to take as input OWL ontologies and convert a graph-based query to its respective stSPARQL query string. However, the tool is based and built upon a more basic and abstract design. The core design of the Query Builder consists of an abstract model that offers to the tool the ability to become easily expandable and adaptable to other query languages and database types. The Visual Query Builder has also the ability to save and retrieve the query representations and it can extended in the future with other features.

Future work includes the implementation of a User Management / Access Control subcomponent, which will be dedicated to serve as a data source for user accounts and groups. This will enable the system to associate saved query models with the users and groups they belong to. In addition, this subcomponent will evaluate user credentials and will manage the access to specific features of the Query Builder system (i.e. loading, editing and saving query representations) in context of the logged in user. The storage of the user and group data could be realized through an external LDAP server.

Furthermore, the Query UI can be extended in order to provide a JavaScript API for client-side integration with other HMI components, through an extensible JavaScript prototype object, that will allow bidirectional, event driven communication between the Query builder UI and other HMI components. Thus, queries can be edited inside the Query Builder while changes to the actual Query String could be reported instantly to other components, which could then update their appearance by retrieving and processing the result set of the changed query.