SPEX enables the user to visually construct the query in the query pane (Top left, main part of the screen). In the background, the data entered by the user is stored and translated into the syntax of SPARQL, the language in which RDF databases are queried.
The user can additionally add constraints to certain elements of the visually constructed query: In case any element of the query can be related to space or time (for example countries or wars), it is highlighted, and spatial constraints can be added using the map window (top right of the screen). Temporal constraints are added using the timeline (right side, under the map window). These constraints are also translated into the sparql syntax, and added to the existing query.
Linked data Vocabularies used for space and time representation (compare class FilterExpander.js):
- XSD Date and Time Data Types (xsd:gYear)
- W3C Geo (WGS84 based)
- GeoSPARQL Ontology (OGC compatible)
Execution of the query and displaying the results
The resulting SPARQL query is sent (as a string, as a HTTP request) to the SPARQL endpoint specified in the tool (textfield at the top right). The response of this HTTP request contains the result of the query, which is extracted and displayed as a table in the results pane (bottom left, under the query pane). In addition, if the results have any spatial data (points, geometries), these are displayed in the map window. Any temporal information (points of time, time intervals) is displayed in the timeline. The queries are fired in real-time: Every time the user modifies the visual query, a new query is sent to the endpoint and the results are loaded into the results pane.
To aid the user while constructing the visual query, the tool makes suggestions: Whenever the user starts making a change to the existing visual query at a particular point, another query is fired in the background, which retrieves information about what additions to the query at this point have any results at all. These possibilities are the displayed to the user as suggestions, from which he/she can choose.