What is an Ontology Syntax?

While formats determine how RDF triples are serialized, ontology syntaxes are purpose-built notations for expressing OWL axioms and class expressions.

Why Multiple Syntaxes?

OWL is a logical language with complex expressions like “the class of things that have at least 3 wheels and are made by a European manufacturer.” Different communities need different notations: logicians prefer Description Logic notation, ontology editors often use Manchester Syntax, and web developers prefer Turtle/RDF. All these syntaxes express the same OWL semantics.

Manchester Syntax

Designed for readability by ontology authors. Uses English-like keywords (some, only, and, or, min, max, exactly) and is widely used in tools like Protégé.

Class: Pizza
    SubClassOf:
        hasBase some PizzaBase,
        hasTopping some PizzaTopping
    DisjointWith:
        Pasta

Class: MargheritaPizza
    SubClassOf:
        Pizza,
        hasTopping only (MozzarellaTopping or TomatoTopping),
        hasTopping some MozzarellaTopping,
        hasTopping some TomatoTopping

OWL Functional Syntax

The normative syntax in the OWL 2 specification. Uses nested function-call notation that maps directly to the OWL 2 structural specification. Precise but less readable.

SubClassOf(
    :Pizza
    ObjectIntersectionOf(
        ObjectSomeValuesFrom(:hasBase :PizzaBase)
        ObjectSomeValuesFrom(:hasTopping :PizzaTopping)
    )
)

DisjointClasses(:Pizza :Pasta)

SubClassOf(
    :MargheritaPizza
    ObjectIntersectionOf(
        :Pizza
        ObjectAllValuesFrom(:hasTopping
            ObjectUnionOf(:MozzarellaTopping :TomatoTopping))
        ObjectSomeValuesFrom(:hasTopping :MozzarellaTopping)
        ObjectSomeValuesFrom(:hasTopping :TomatoTopping)
    )
)

OWL/XML

An XML serialization that mirrors the OWL 2 structural specification element by element. Useful when XML tooling is required but very verbose.

<SubClassOf>
  <Class IRI="#Pizza"/>
  <ObjectIntersectionOf>
    <ObjectSomeValuesFrom>
      <ObjectProperty IRI="#hasBase"/>
      <Class IRI="#PizzaBase"/>
    </ObjectSomeValuesFrom>
    <ObjectSomeValuesFrom>
      <ObjectProperty IRI="#hasTopping"/>
      <Class IRI="#PizzaTopping"/>
    </ObjectSomeValuesFrom>
  </ObjectIntersectionOf>
</SubClassOf>

Turtle for OWL

OWL axioms can also be expressed in Turtle using the OWL RDF mapping. This is the format OntoKit uses internally. Complex class expressions use blank nodes and RDF collections.

ex:Pizza a owl:Class ;
    rdfs:subClassOf [
        a owl:Restriction ;
        owl:onProperty ex:hasBase ;
        owl:someValuesFrom ex:PizzaBase
    ] , [
        a owl:Restriction ;
        owl:onProperty ex:hasTopping ;
        owl:someValuesFrom ex:PizzaTopping
    ] .

ex:Pizza owl:disjointWith ex:Pasta .

Description Logic Notation

The mathematical notation used in academic papers. OWL 2 DL corresponds to the Description Logic SROIQ(D). Compact but requires familiarity with logical symbols.

Pizza ⊑ ∃hasBase.PizzaBase ⊓ ∃hasTopping.PizzaTopping
Pizza ⊑ ¬Pasta

MargheritaPizza ⊑ Pizza
    ⊓ ∀hasTopping.(MozzarellaTopping ⊔ TomatoTopping)
    ⊓ ∃hasTopping.MozzarellaTopping
    ⊓ ∃hasTopping.TomatoTopping

Syntax Comparison

SyntaxAudienceReadabilityTool Support
ManchesterOntology authorsHighProtégé, OWL API
FunctionalSpec writersMediumOWL API, parsers
OWL/XMLXML pipelinesLowXML tools, OWL API
Turtle/RDFWeb developersMedium–HighRDFLib, Jena, OntoKit
DL NotationResearchersLow (specialized)Papers, textbooks

W3C References