OWL2Gra takes profit of the knowledge described by the ontology and automatically generates a grammar for a DSL that allows to discourse about the domain described by that ontology.

The OWL2Gra project is composed of three engines. The main one is OWL2DSL, the component that converts an OWL ontology into an attribute grammar. The two additional modules are Onto2OWL and Ddesc2OWL. The former, Onto2OWL, converts ontologies written in OntoDL (a lightweight DSL to describe ontologies) into standard OWL XML that can be loaded into the well known Protégé system to future editing; the later, Ddesc2OWL, converts domain instances written in the DSL generated by OWL2DSL into the initial OWL ontology.




Slate 14 ShortPaper

Project Thesis

Project Details

OWL2GRA Architecture

The figure bellow represents all the processes and modules that are presented in this project showing how an abstract ontology( described in a simple ontology specification language) is transformed into an OWL XML ontology that is then transformed into an AntLR attribute grammar.


Module Onto2OWL is the first layer of this project. Onto2OWL creates a specification file in the standard notation for ontologies specification, OWL-XML, from an ontology specification written in OntoDL, a Domain Specific Language to describe in a simple, easy to use, way the ontologies. This module is composed by two important parts. The first is a parser for the input file written in a DSL that we have specially designed, called OntoDL. The second part is a java class that manipulates the information gathered by the parser and generates the OWL-XML standard file.

The OntoDL file describe the basic information about an ontology: Concepts, Hierarchies, Relations and Links. So, you will find something like this:

This module was created with the objective of generating OWL files from simple ontological descriptions of the domain. It can be used separately from the other components see the API.


With OWL2DSL it is possible to generate a grammar specification and a parser for a DSL to describe elements for the domain.

The main objective of this module was to generate a grammar that represents a certain domain specified by an Ontology written in any OWL standard. This grammar has a set of rules that are responsible for the generation:


DDesc2OWL is the last module of the OWL2Gra. The purpose of this module is to populate the initial ontology that was used to generate the grammar.

This Module is very simple; it receives three parameters, that are files, and processes them in different moments.

  • Grammar
    • The first important parameter is the path of the grammar file that was generated during the last phase. This grammar will need the Java class set (also generated at the previous stage).
  • Ddesc
    • The second file is the DDesc input file. This file describes all the instances that will create the individuals on the ontology.
  • Ontology
    • Finally, the last file is the original ontology that was used for the creation of the grammar by the OWL2DSL Module. This file will be processed again to rebuild the ontology in order to create the populated version.



This video shows the full process of this project.


Click on the image to enlarge.


This program can also be used by third part using the command line interface( instead of the graphical one shown in Examples described above).