Mastro in Protégé!
Protégé is the world's most popular and widely-used ontology editor. It offers a free and open-source environment for editing OWL 2 and RDF ontologies. Protégé is Java-based and is extensible through plug-ins. Now users can access all the features provided by the Mastro system, plus many more, such as mapping editing, through the Mastro Protégé Plug-in.
The Mastro Reasoner for DL-Lite ontologies implements the common interface of ontology reasoners in Protégé, providing all required services, beginning with classification, meaning the inference of a subsumption hierarchy for the classes described in the ontology, along with satisfiability checking of the ontology and of all its elements. The Mastro Reasoner, on startup, also approximates the ontology to conform to the DL-Lite language (if necessary), and initialises the data structures that are required to perform OBDA query answering.
The Mapping Editor allows to create, modify, and inspect a full Mastro mapping specification. Through a guided and easy-to-use interface, users can define views and mappings: the former are named SQL queries, while the latter are assertions, or rules, that link elements of the ontology to the SQL queries in the views. Through these mappings and views, the mapping specification defines the exact correspondence between the data in the sources and the classes and relations in the ontology.
The Query Engine handles all query answering-related operations. It provides an interface to define and document SPARQL queries over the ontology, and allows to save the queries in the query catalog, through which the user can see the ontology or mapping rewriting of the selected query, execute the query and see its results, possibly exporting them to file, or delete the query from the catalog.
Using the Plug-in
Starting the Reasoner
The Mastro DL-Lite Reasoner can be selected in Protégé's Reasoner menu. Upon startup, to operate the reasoner needs a mapping file (in XML format), which can be either pre-existing, or can be created through the Plug-in. If no path to a mapping file is provided in the Mastro Mappings View, then the plug-in will automatically search for, and load, a mappings.xml file in the same directory as the active ontology.
The Mastro Mappings View
The Mastro Mappings View manages the mapping specification, allowing to create, open, save a mapping file. The view contains the following panels:
- The Datasource Manager panel allows to define the JDBC parameters to connect to the datasource.
- The Ontology Predicate Mappings panel allows to create a new mapping or inspect, edit, and delete an existing one. Adding or editing a mapping will open a Mapping Editor dialog through which the ID, description, predicate, SQL View, and the functor or template of the mapping can be selected.
- SQL Views panel manages the SQL views that are used in the mappings. Adding or editing an SQL view will open an SQL View Editor dialog through which the name and SQL query of the view can be defined.
Any modification of the datasource, mappings, or views will require saving the mapping file to take effect.
The Mastro SPARQL View
The Mastro SPARQL View is used to query the Mastro OBDA System. It contains the following panels:
- Query Manager is used to manage all Mastro's queries. The query manager must be configured upon first use, providing the parameters for a MySQL database where all query information is stored. Once configured, the query engine can be started, and the user can add a query through the Query Editor, run a query, delete a query (or all queries), and show the rewritings or the log of a query's execution.
- Query Editor allows to create new queries, specifying a valid identifier and a valid SPARQL query. If a query is selected from the Query Manager the fields are automatically filled.
- Query Results shows the results for the selected query results, and allows to export the results of a query in a CSV file.