<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>DL</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Extending OWL2 Manchester Syntax to Include Missing Features from OWL2 Abstract Syntax</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Björn Gehrke</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Till Mossakowski</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Otto von Guericke University Magdeburg</institution>
          ,
          <addr-line>Universitätsplatz 2, 39106 Magdeburg</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>36</volume>
      <fpage>2</fpage>
      <lpage>4</lpage>
      <abstract>
        <p>There are multiple serialisations available to store OWL2 ontologies. While the language structure is specified in Abstract Syntax, a more human-friendly serialisation is Manchester Syntax. As both are serialisations of OWL2, they should be equipotent. However, some features are known to be inexpressible in Manchester Syntax. Most commonly known is the lack of expressing general concept inclusions in Manchester Syntax. This paper analyses the Manchester Syntax grammar and identifies a total of 19 inexpressible features and eight minor errors in the current Manchester Syntax grammar. Furthermore, changes to the Manchester Syntax grammar are proposed to make it equipotent to Abstract Syntax. The proposed changes are implemented in the OWL API1.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;OWL2</kwd>
        <kwd>Manchester Syntax</kwd>
        <kwd>GCI</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>For example, consider the following:</p>
      <p>SubClassOf ( ObjectIntersectionOf( :a :b ) :c )
This expression cannot be expressed in Manchester Syntax directly as the class frame only
allows a named class and no complex class expression.</p>
      <sec id="sec-1-1">
        <title>Commonly used editors like Protégé1 allow adding such General Class Axioms in a Manchester</title>
        <p>like style. The previous example would be written as</p>
        <p>:a and :b SubClassOf :c</p>
        <p>This serialisation, however, is not valid Manchester Syntax and trying to save ontologies
containing such axioms in Manchester Syntax results in those axioms being dropped.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Translation between Manchester Syntax and Abstract Syntax</title>
      <p>
        The W3C note for OWL2 Manchester Syntax contains an algorithm to translate Manchester
Syntax to Abstract Syntax. This translation is achieved by first converting every frame to
multiple simple frames with the same subject. Therefore, previously grouped axioms relating to
the same entity exist as single axioms. Now each frame expresses a single axiom which can be
transformed using a transformation function .  is given by a table  recursively
defining the transformation for each possible input.  −1 is, therefore, the inverse of the function
working as a reverse lookup in . The translation is depicted in Figure 1. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
      </p>
      <p>It is stated to run the algorithm in reverse to convert an ontology from Abstract Syntax to
Manchester Syntax. However, the steps provided in the algorithm - especially the transformation
function  - are written from a Manchester Syntax point of view, making  an injective
function from Manchester Syntax to Abstract Syntax.  cannot be bijective as at least general
concept inclusions are known to be not supported in Manchester Syntax.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Missing features</title>
      <p>The existing transformation table  does not map axioms directly but uses a meta-language
describing how a given ontology in Manchester Syntax can be transformed to Abstract Syntax.
Keeping this style, for each rule  in the Abstract Syntax grammar containing terminal elements,
there must be an entry  in  such that () = . Therefore, each non-terminal element
 in  is replaced by ().</p>
      <sec id="sec-3-1">
        <title>The existing translation specifications utilise  −1 for translation from Abstract Syntax to</title>
        <p>Manchester Syntax, although  is not bijective. To find missing features in Manchester</p>
      </sec>
      <sec id="sec-3-2">
        <title>Syntax,  −1 is redefined as a new partial transformation function  transforming Abstract</title>
        <p>
          Syntax to Manchester Syntax. It is defined by a transformation table . Using the whole
grammar [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], every single rule  (producing an axiom, expression, and other features) is mapped
to their Manchester Syntax representation  −1(), if possible. Otherwise, it is added to a set
Class: :a
        </p>
        <p>EquivalentTo: :b
 . At the end,  = {  | ∄ :  () =  −1() =  } contains all inexpressible features of
Manchester Syntax.</p>
        <p>In total, there are 27 features found not expressible in Manchester Syntax when strictly
following the existing grammar and transformation function. Those include spelling mistakes
such as “FunctionalObjectProperty” instead of “ObjectFunctionalProperty” and other minor
errors in  such as annotations being required in classFrame rule. Excluding such errors,
19 features are left that are truly inexpressible. Table 1 lists the 19 features not supported in
Manchester Syntax.</p>
        <p>The lack of expressivity of Manchester Syntax can be remedied a bit using conservative
extensions. Namely, an ontology in Abstract Syntax can be extended conservatively, and then
this conservative extension (which is even purely definitional) can be mapped to a an equivalent
ontology in Manchester Syntax. This is possible if the Abstract Syntax ontology does not use
the identified missing “DataSomeValuesFrom”, “DataAllValuesFrom”, or “Declarations” features
and works as follows:</p>
        <p>A general concept inclusion { ⊑ } can be written as { ≡ ,  ⊑ } with  being a
new atomic concept,  a complex concept and  a complex or atomic concept.</p>
        <p>In the same manner, a complex role inclusions { ⊑ } can be written as
{ ≡ ,  ⊑ } and any other missing feature involving complex object property expressions e.g.
{SymmetricObjectProperty()} as { ≡ , SymmetricObjectProperty()} with  being
an atomic role,  a complex role, and  a complex or atomic role.</p>
        <p>However, working with such conservative extensions often is inconvenient, because the
ontology will be cluttered with additional (often rather artificial) extra concepts and roles.
Therefore, we will extend Manchester Syntax in a way that directly supports all Abstract Syntax
features.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Grammar and translation table extensions</title>
      <p>Having identified inexpressible features of OWL2 Manchester Syntax, the following proposes
changes and additions to the existing Manchester Syntax grammar and translation table .
It adds support for all missing features. All changes are analysed for backwards compatibility.</p>
      <p>The proposed grammars utilise the meta-rules described in [3, Section 2]. Additionally, minor
errors (like spelling mistakes) are corrected implicitly.</p>
      <p>DataSomeValuesFrom and DataAllValuesFrom Although practically not usable,
as data ranges with arity greater than one are currently not expressible in Abstract Syntax
either[4, Section 7], adding the capability to Manchester Syntax removes the need to remember
and adjust this once expressing data ranges with arity greater than one is possible. This feature
can be added by allowing tuples of class expressions and single class expressions in the rule for
restriction. The tuples must be surrounded by parenthesis to ensure the grammar stays
unambiguous. Consequently, the following entries and rules must be added to  and the
grammar, respectively.</p>
      <p>Manchester Syntax</p>
      <p>Abstract Syntax
(1, ..., ) some 
(1, ..., ) only</p>
      <p>DataSomeValuesFrom( (1) ...  ()  ())</p>
      <p>DataAllValuesFrom( (1) ...  ()  ())
restriction ::= ...</p>
      <p>| ’(’ dataPropertyExpressionList ’)’ ’some’ dataPrimary
| ’(’ dataPropertyExpressionList ’)’ ’only’ dataPrimary
Annotations in declarations Allowing declarations to be annotated can be achieved in
multiple ways. One way is to change the semantics of an Annotations: frame section inside
a frame. According to , this is currently mapped to an AnnotationAssertion axiom in
Abstract Syntax with the frames subject as annotation subject. Instead, this annotation could be
added to the Declaration axiom.</p>
      <p>A second approach is to allow the Annotations: section - annotations non-terminal in the
Manchester Syntax grammar - in front of the IRI of a frame’s subject. In contrast to the first
proposal, this change keeps backward compatibility as annotations are optional. Consequently,
the following entries and rules must be changed in  and the grammar, respectively.</p>
      <p>Frame
AnnotationProperty: annotations IRI . . .</p>
      <p>Class: annotations IRI . . .</p>
      <p>DataProperty: annotations IRI . . .</p>
      <p>Datatype: annotations IRI . . .</p>
      <p>Individual: annotations IRI . . .</p>
      <p>ObjectProperty: annotations IRI . . .</p>
      <p>Declaration
Declaration (  ()
AnnotationProperty ( IRI ) )
Class (  () Class ( IRI ) )
Declaration (  ()
DataProperty ( IRI ) )
Declaration (  () Datatype (
IRI ) )
Declaration (  ()
NamedIndividual ( IRI ) )
Declaration (  ()
ObjectProperty ( IRI ) )
datatypeFrame ::= ’Datatype:’ [ annotations ] Datatype ...
dataPropertyFrame ::= ’DataProperty:’ [ annotations ] ← ˒
dataPropertyIRI ...
annotationPropertyFrame ::= ’AnnotationProperty:’ ← ˒
[ annotations ] annotationPropertyIRI ...
individualFrame ::= ’Individual:’ [ annotations ] individual ...
Features with object property expressions as subject Many features inexpressible in
Manchester Syntax have object property expressions as a subject. In Manchester Syntax,
however, the subject of a frame can only be an IRI, thus an object property. Changing the subject
from IRI to object property expression adds support for the following axioms to be used with
object property expressions:
• SubObjectPropertyOf
• ObjectInverseOf
• ObjectPropertyDomain
• ObjectPropertyRange
• InverseObjectProperties
• FunctionalObjectProperty
• InverseFunctionalObjectProperty
Nevertheless, simply changing the ObjectProperty: frames subject would also allow
statements describing AnnotationAssertion axioms. However, AnnotationAssertion
axioms can only have an IRI as the subject. Hence, the grammar must ensure such cases
are not possible. Apart from the AnnotationAssertion axiom, all derivations of the
objectPropertyFrame non-terminal produce valid axioms with the proposed changes.
However, complex object property expressions cannot be declared. Hence, no additional
entry in the declarations table is added. In addition to the changes in “Annotations in
declarations”, leading annotations are not allowed if a complex object property expression
is used. Consequently, the following entries and rules must be added to or changed in
 and the grammar, respectively. The following table only contains the translation for
ObjectPropertyDomain. All other axioms mentioned above are translated similarly. Note
that the non-terminal OPE is only introduced for better readability.</p>
      <p>Manchester Syntax
ObjectProperty: 
Domain:  description
Abstract Syntax
ObjectPropertyDomain(
T(annotations)  ()
T(description))
OPE ::= objectPropertyExpression
simpleObjectPropertySection ::= complexObjectPropertySection
| ’Annotations:’ annotationAnnotatedList
complexObjectPropertySection ::=</p>
      <p>’Domain:’ descriptionAnnotatedList
| ’Range:’ descriptionAnnotatedList
| ’Characteristics:’ ← ˒</p>
      <p>objectPropertyCharacteristicAnnotatedList
| ’SubPropertyOf:’ ← ˒</p>
      <p>objectPropertyExpressionAnnotatedList
| ’EquivalentTo:’ ← ˒</p>
      <p>objectPropertyExpressionAnnotatedList
| ’DisjointWith:’ ← ˒</p>
      <p>objectPropertyExpressionAnnotatedList
| ’InverseOf:’ ← ˒</p>
      <p>objectPropertyExpressionAnnotatedList
| ’SubPropertyChain:’ ← ˒</p>
      <p>annotations OPE ’o’ OPE { ’o’ OPE }
objectPropertyFrame ::=
’ObjectProperty:’ [ annotations ] IRI ← ˒</p>
      <p>{ simpleObjectPropertySection }
| ’ObjectProperty:’ OPE { complexObjectPropertySection }
General concept inclusions and HasKey A naive approach extends the misc frame to
include GCIs and HasKey axioms. It already contains all axioms not fitting to any other frame.
General concept inclusions containing complex class expressions instead of a simple class IRI
could be considered as such. Similarly, the HasKey axiom can be added there too. However,
this approach introduces two new keywords breaking backwards-compatibility.</p>
      <p>A much more natural way is to extend the class frame. Currently, it is possible to express a
SubClassOf axiom only with a simple IRI as a subclass. Changing this IRI to description
a complex class expression - allows expressing general concept inclusions. Furthermore, this
change also allows expressing HasKey axioms with complex class expressions. Additionally, an
IRI being a valid class expression ensures the backwards compatibility of this change.</p>
      <p>
        Similar to changing the object property frames subject, changing the class frames
subject might lead to invalid axioms. In addition, the DisjointWith section must also be
excluded. It is mapped to the DisjointUnionOf axiom in Abstract Syntax. Similar to the
AnnotationAssertion axiom, the DisjointUnionOf axiom allows only a class and not a
complex class expression [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Consequently, the following entries and rules must be changed in
or added to  and the grammar, respectively.
      </p>
      <p>Manchester Syntax
Class: 
SubClassOf:  
Class: 1
EquivalentTo:  2
Class: 1
DisjointWith:  2 . . . 
Class: 
HasKey:  
Abstract Syntax
SubClassOf(
 ()  ()  ())
EquivalentClasses(
 ()  (1)  (2))
DisjointClasses(
 ()  (1) . . .  ())
HasKey(
 ()  ()  ())
simpleClassSection ::= complexClassSection
| ’Annotations:’ annotationAnnotatedList
| ’DisjointUnionOf:’ [ annotations ] description2List
complexClassSection ::= ’SubClassOf:’ descriptionAnnotatedList
| ’EquivalentTo:’ descriptionAnnotatedList
| ’DisjointWith:’ descriptionAnnotatedList
| ’HasKey:’ [ annotations ]
( objectPropertyExpression | dataPropertyExpression )
{ objectPropertyExpression | dataPropertyExpression }
classFrame ::=</p>
      <p>’Class:’ [ annotations ] IRI { simpleClassSection }
| ’Class:’ description { complexClassSection }</p>
    </sec>
    <sec id="sec-5">
      <title>5. Implementation</title>
      <p>We implemented the presented extensions in the reference implementation OWL API in the
pull requests 10502 for version 5 and 11043 for version 4. They are available in the OWL API
version 5.5.0 and waiting to be merged for version 4.</p>
      <p>During the implementation, it turned out, that the OWL API already supports object property
expressions as frame subjects: Their implementation follows the proposed changes of section
4. Furthermore, and as mentioned, the OWL API does not support DataSomeValueFrom and
DataAllValuesFrom for data ranges with an arity greater than one. Therefore, changes in
the underlying data types are required. This is a major change with no current practical use.
Hence, these two features are not implemented in the OWL API.
2https://github.com/owlcs/owlapi/pull/1050
3https://github.com/owlcs/owlapi/pull/1104</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion</title>
      <p>A translation from OWL2 Abstract Syntax to OWL2 Manchester Syntax was constructed yielding
19 inexpressible features (27 including minor errors in ) in Manchester Syntax. A change of
the existing grammar and translation table is proposed for each such inexpressible feature. With
these changes, all constructs expressible in OWL2 DL are expressible in Manchester Syntax,
marking both syntaxes equipotent. A collection of axioms in Figure 2 highlight the features and
show what constructs can now be expressed in Manchester Syntax.</p>
      <p>The proposed changes have been implemented in the OWL API and are available from version
5.5.0 and once merged will be available in the next version 4 release. With these changes, the
more human-readable Manchester Syntax can be used for serious ontology development without
drawbacks. While many developers use tools such as Protégé independent of the serialisation,
these features are still essential: For example, manually resolving conflicts or tracking changes
when developing with a version control system such as git is much simpler in Manchester
Syntax than in Abstract Syntax or XML.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>W3C-Owl-</surname>
            Working-Group, OWL 2
            <given-names>Web</given-names>
          </string-name>
          <string-name>
            <surname>Ontology Language Document Overview (Second Edition)</surname>
          </string-name>
          ,
          <source>Recommendation, W3C</source>
          ,
          <year>2012</year>
          . https://www.w3.org/TR/2012/ REC-owl2
          <string-name>
            <surname>-</surname>
          </string-name>
          overview-20121211/. Latest version available at https://www.w3.org/TR/ owl2-overview/.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>R. S.</given-names>
            <surname>Uli</surname>
          </string-name>
          <string-name>
            <surname>Sattler</surname>
          </string-name>
          ,
          <article-title>Being complex on the left-hand-side: General concept inclusions</article-title>
          ,
          <source>Ontogenesis</source>
          (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Horridge</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. F.</given-names>
            <surname>Patel-Schneider</surname>
          </string-name>
          ,
          <article-title>Owl 2 web ontology language manchester syntax</article-title>
          , W3C Working Group Note (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>B.</given-names>
            <surname>Motik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Patel-Schneider</surname>
          </string-name>
          ,
          <string-name>
            <surname>B. Parsia,</surname>
          </string-name>
          <article-title>OWL 2 Web Ontology Language Structural Specification</article-title>
          and
          <string-name>
            <surname>Functional-Style Syntax (Second Edition)</surname>
          </string-name>
          ,
          <source>Recommendation, W3C</source>
          ,
          <year>2012</year>
          . https://www.w3.org/TR/2012/REC-owl2
          <string-name>
            <surname>-</surname>
          </string-name>
          syntax-20121211/. Latest version available at https: //www.w3.org/TR/owl2-syntax/.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>