# Graphol: A Graphical Language for Ontology Modeling Equivalent to OWL 2
## 4 The Graphol Language
### Graphol and OWL 2  
In this section we study the relationship between Graphol and OWL 2 [73], the W3C standard ontology language. We first study whether Graphol ontologies can be entirely expressed in OWL 2, and then consider the other way around. In fact, for a formal treatment we identify OWL 2 with its underlying DL \(\mathcal{SROIQ}(D)\) DL [66; 67] (some OWL 2 features not in \(\mathcal{SROIQ}(D)\), such as data type restrictions or key axioms, can be modeled in Graphol by using some additional graphical elements, as reported in the Eddy documentation [[https://github.com/obdasystems/eddy](https://github.com/obdasystems/eddy)]([https://github.com/obdasystems/eddy](https://github.com/obdasystems/eddy)) (accessed on 17 January 2022). These aspects are not described here for the sake of simplicity). According to the Graphol syntax given earlier, Graphol expressiveness goes slightly beyond that of OWL 2. This allowed us to maintain the formal definition of the syntax of our language simple, without burdening it with too many syntactic categories. Of course, due to this choice, reasoning in full Graphol is undecidable [11]. However, by suitably restricting the way in which Graphol expressions can be combined, we easily obtain decidable languages. In particular, we can limit Graphol in such a way that it becomes translatable in OWL 2. To precisely describe this restriction, we need to define _basic role expressions_, which are expressions constituted by either a role node or the inverse node with a role node as input. Below we give a proviso needed to our aims. **Proviso**. Role expressions given as input to domain or range restriction nodes, to self nodes, inverse nodes, complement nodes, or chain nodes can be only basic role expressions. Attribute expressions given as input to domain restriction nodes can be only attribute nodes. Role and attribute expressions having the complement node as sink cannot be the source of any inclusion edge. Role expressions having the chain node as sink cannot be the target of any inclusion edge and can be included only in basic role expressions. Attribute expressions in input to range restriction nodes can be only attribute nodes. Graphol inclusion assertions between value-domain expressions must involve at least a value-domain node (i.e., the source or the target of the assertion must be an atomic data type). Finally, value-domains and values are as in OWL 2, and the ontology must obey the same global restrictions imposed on OWL 2 (e.g., only regular role hierarchies are allowed and only simple roles can occur in cardinality restrictions) [66; 73]. **Theorem 1**. : _Every Graphol ontology constructed under the above proviso is correctly translatable into an OWL 2 TBox in linear time._  
Proof. : The function \(\Psi\) given in Section 4.2 is obviously applicable to a Graphol ontology restricted according to the above proviso. It is then easy to verify that each DL inclusion assertion returned by \(\Psi\) is an OWL 2 axiom. Since \(\Psi\) returns one DL inclusion assertion for each Graphol inclusion assertion, the cost of the transformation is linear. The following theorem considers instead transformation of OWL 2 TBoxes in Graphol. **Theorem 2**. : _Every OWL 2 TBox is correctly translatable into a Graphol ontology in linear time._  
Figure 5: Example of globally functional role represented without the compact notation (**left-hand side**), and examples (**right-hand side**) of globally functional role, inverse functional role, functional and inverse functional role, and functional attribute (resp., top left, top right, bottom left, and bottom right) represented with the compact notation. Proof. : We first observe that any OWL 2 ontology can be written as a set of inclusion assertions. Below, we provide some well-known correspondences useful for this aim (\(Q\) denotes a role or its inverse, whereas \(\top_{C}\) denotes the universal concept ). \[