The S PARQLING system for SPARQL queries over G RAPHOL ontologies Sara Di Bartolomeob , Gianluca Pepeb , Valerio Santarellia,b , Domenico Fabio Savoa,b (a) Sapienza Università di Roma hlastnamei@diag.uniroma1.it (b) OBDA Systems hlastnamei@obdasystems.com Abstract. In this demo we present the S PARQLING system for SPARQL query building based on the G RAPHOL visual language for ontologies. The characteriz- ing feature of S PARQLING is the idea to preserve and take advantage of the native diagrammatic representation of G RAPHOL ontologies, allowing the user to navi- gate it, and to construct a graph-based representation of the query over it through a simple point-and-click mechanism. The system then automatically transforms the graphical query into the SPARQL syntax. 1 Introduction In computer science, an ontology is the formal conceptualization of a domain of interest, and its purpose it to favor sharing and integration of knowledge among information systems and to provide an abstract representation of the domain which is understood and agreed upon by ontology designers and domain experts. Ontologies commonly are formalized through languages such as Description Log- ics [4] (DLs) or the W3C standards RDF(S)1 and OWL 22 . Typically however, it is rare to encounter people in industrial settings who possess the skills to interpret the logic-based formulas used in such languages. This represents a significant issue in the adoption of ontologies in these settings, because it creates a bottleneck in the ontol- ogy design phase, where ontology engineers must work with domain experts. To mit- igate this problem, numerous graphical languages for ontologies [5, 7, 10] have been proposed in recent years, and among the latest of these efforts is G RAPHOL [6, 11]. The main features of G RAPHOL are that it presents an entirely graphical syntax based on Entity-Relationship diagrams, it has a formal DL-based semantics, and is able to fully capture OWL 2. The effectiveness of G RAPHOL as the language for representing ontologies has been validated in several recent and ongoing research and instrustrial projects [2, 3]. Ontologies, aside from acting as a conceptualization of a domain, are gaining steam as a means to access and manage data. In fact, triple stores are now commonly used to 1 http://www.w3.org/TR/rdf-primer-20040210/ 2 http://www.w3.org/TR/owl2-primer Fig. 1. The user interface of the S PARQLING system. manage (Linked) enterprise data [15], and semantic technologies such as ontologies are used to manage legacy data stores [12]. In these settings, the standard query language for triple stores and ontologies is SPARQL3 . SPARQL, while simpler in structure than traditional query languages such as SQL, still suffers from the same drawback as tradi- tional ontology languages, i.e., it is not easily understood by people who lack specific training or background. Going back to the idea of using graphical solutions to support usability, there have been several proposals for visual SPARQL query building systems in recent years, from those that allow query formulation in natural language or through context-sensitive completion mechanisms [9, 13], to those that provide support for con- structing graph-based representations of the SPARQL query [1, 8, 14]. In this demonstration, we present the latest of these systems, S PARQLING. S PAR - QLING is a web application that allows to build SPARQL queries based on the G RAPHOL language, whose characterizing feature is the idea to preserve and take advantage of the native diagrammatic representation in G RAPHOL of the ontology. Through S PARQLING’s interface, the user can navigate the ontology and formulate a graph-based representation of a SPARQL query over it through a simple point-and-click mechanism. To illustrate the main features of S PARQLING, we will invite attendees of the demo to experiment it on the Base Register of Individuals, Families, and Cohabita- tion (BRIFC) ontology, developed during a joint project between Sapienza University of Rome, OBDA Systems, and the Italian National Institute of Statistics (Istat) [3]. S PARQLING is an open-source project, available on Github4 , and is supported by OBDA Systems5 . 3 https://www.w3.org/TR/rdf-sparql-query/ 4 https://github.com/picorana/painless_sparql 5 https://www.obdasystems.com/ 2 The S PARQLING System S PARQLING is a web-based application for constructing SPARQL queries by exploiting the G RAPHOL representation of the ontology. The development of S PARQLING origi- nates in systems for Ontology-based Data Management [12], hence it currently supports the conjunctive query fragment of SPARQL. As shown in Figure 1, the system interface is divided in three main sections, which we describe briefly. The main area contains the G RAPHOL diagrams. Through the tools in this area, the user can navigate and inspect the ontology along with its documentation. The G RAPHOL representation allows the user to clearly perceive its structure and content, facilitating the task of constructing the query over the ontology. Indeed, the mental pro- cess of writing a query is natural when looking at a G RAPHOL diagram because it recalls the act of tracing a path on it. Through the interaction with the G RAPHOL diagram the user builds the ontology query, whose visual representation, called query graph is pro- vided in the second area. This representation has the structure of a graph, to naturally recall SPARQL’s basic graph patterns, where nodes represent subjects or objects of each triple pattern, and edges represent predicates. To provide a visual correspondence with G RAPHOL, the graphical representation of the ontology predicates in the query graph is the same as in G RAPHOL. The third section shows the SPARQL representation of the query, which the user can inspect or modify. Each change in the SPARQL query is immediately mirrored in the query graph, and viceversa, to keep the two versions con- stantly aligned. The user can choose to interact with both representations of the query, or only with one of the two, according to his preference. To add a triple to the basic graph pattern of the query, the user double clicks on a predicate symbol in the G RAPHOL diagram. According to the specific predicate symbol, the corresponding edge and nodes are automatically added to the query graph. Actions on specific nodes of the graph are performed through contextual menus that appear by right clicking on a node. The application is developed in JavaScript, using the Cytoscape.js library6 for the rendering of the G RAPHOL diagram and the query graph, and the cola.js library7 for the force-directed layout of the query graph. 3 Application scenario and Demo Section Overview We demonstrate the S PARQLING system through the Base Register of Individuals, Fam- ilies, and Cohabitation (BRIFC) ontology, developed in Graphol during a joint project between Sapienza University of Rome, OBDA Systems, and the Italian National Insti- tute of Statistics (Istat) [3]. The BRIFC ontology depicts a portion of the domain of the Italian Integrated Sys- tem of Statistical Registers of Istat, which acts as the base for Istats production surveys. The ontology is composed of two modules: the first regarding people, their family re- lationships, and their level of education; the second regarding the Italian territory and citizen residential data. In the project, the ontology was developed in support of the 6 http://js.cytoscape.org/ 7 http://ialab.it.monash.edu/webcola/ adoption of the OBDM approach for data access and quality checking. The experi- mentation has confirmed the effectiveness of this approach for these purposes, and of G RAPHOL as a means of representation of the ontology both in the design phase and in the deployment phase. Currently, we have given way to the experimentation of the S PARQLING system as the tool for the production of SPARQL queries in the project. During the demo, attendees will interact with the S PARQLING system, inspecting the G RAPHOL BRFIC ontology and experiencing how the SPARQL query construction process is simplified through the use of the system interface. We will also show how S PARQLING can interact with the SPARQL endpoint in the Mastro system8 for OBDM. References 1. O. Ambrus, K. Möller, and S. Handschuh. Konduit VQB: a Visual Query Builder for SPARQL on the Social Semantic Desktop. In Proc. of VISSW2010, 2010. 2. N. Antonioli, F. Castanò, S. Coletta, S. Grossi, D. Lembo, M. Lenzerini, A. Poggi, E. Virardi, and P. Castracane. Ontology-based data management for the italian public debt. In Proc. of FOIS 2014, pages 372–385, 2014. 3. R. M. Aracri, A. M. Bianco, R. Radini, M. Scannapieco, L. Tosco, F. Croce, D. F. Savo, and M. Lenzerini. On the Experimental Usage of Ontology-based Data Management for the Italian Integrated System of Statistical Registers: Quality Issues. In Proc. of Q2018, 2018. 4. F. Baader, D. Calvanese, D. McGuinness, D. Nardi, and P. F. Patel-Schneider, editors. The Description Logic Handbook: Theory, Implementation and Applications. Cambridge Uni- versity Press, 2nd edition, 2007. 5. S. Brockmans, R. Volz, A. Eberhart, and P. Löffler. Visual modeling of OWL DL ontologies using UML. In Proc. of ISWC 2004, volume 3298 of LNCS, pages 198–213. Springer, 2004. 6. M. Console, D. Lembo, V. Santarelli, and D. F. Savo. Graphol: Ontology representation through diagrams. In Proc. of DL 2014, volume 1193 of CEUR, pages 483–495, 2014. 7. R. Falco, A. Gangemi, S. Peroni, D. Shotton, and F. Vitali. Modelling OWL ontologies with Graffoo. In Proc. of ESWC 2014 (Satellite Events), volume 8798 of LNCS, pages 320–325, 2014. 8. F. Haag, S. Lohmann, S. Siek, and T. Ertl. QueryVOWL: Visual composition of SPARQL queries. In Proc. of ISWC 2015, pages 62–66. Springer, 2015. 9. E. Kaufmann, A. Bernstein, and R. Zumstein. Querix: A natural language interface to query ontologies based on clarification dialogs. In Proc. of ISWC 2006, pages 980–981. Springer, 2006. 10. S. Krivov, R. Williams, and F. Villa. GrOWL: A tool for visualization and editing of OWL ontologies. J. of Web Semantics, 5(2):54–57, 2007. 11. D. Lembo, D. Pantaleone, V. Santarelli, and D. F. Savo. Easy OWL Drawing with the Graphol Visual Ontology Languag. In Proc. of KR 2016, pages 573–576, 2016. 12. M. Lenzerini. Ontology-based Data Management. In Proc. of CIKM 2011, pages 5–6, 2011. 13. L. McCarthy, B. Vandervalk, and M. Wilkinson. SPARQL Assist language-neutral query composer. BMC Bioinformatics, 13(1):S2, 2012. 14. A. Soylu, M. Giese, E. Jimenez-Ruiz, E. Kharlamov, D. Zheleznyakov, and I. Horrocks. Op- tiqueVQS: towards an ontology-based visual query system for big data. In Proc. of MEDES 2013, pages 119–126. ACM, 2013. 15. D. Wood. Linking enterprise data. Springer Science & Business Media, 2010. 8 www.obdasystems.com/mastro