The Manchester OWL Syntax
The latest version of Protege-OWL features a new syntax, called the Manchester OWL Syntax, which is used when editing class expressions. This document describes the syntax for class expressions and is aimed at people who already know the previous Protege-OWL compact class expression syntax.
The Manchester OWL Syntax, is a new syntax that has been designed for writing OWL class expressions. It has been influenced by both the OWL Abstract Syntax and the DL style syntax, which uses description logic symbols such as the universal quantifier (∀) or the existential quantifier (∃).
Although the syntax borrows ideas from the OWL Abstract Syntax, it is much less verbose, meaning that it is quicker to write and easier to read. In a similar vein, whilst following the compactness of the DL Syntax, special mathematical symbols such as ∃, ∀, ¬ and have been replaced by keywords such as “some”, “only”, and “not”. The Manchester OWL Syntax also departs from the DL Syntax by using an infix notation rather than a prefix notation for keywords – in our experience, an infix notation makes the syntax easier to read and understand for non-logicians.
Examples
This section presents some examples to illustrate the changes from the previous Protege-OWL compact syntax to the new Manchester OWL syntax.
Restrictions
Restrictions now use an infix syntax rather than a prefix syntax. The description logic symbols that were previously used to indicate the type of restriction have been replaced with English language keywords.
| OWL | DL Symbol | Manchester OWL Syntax Keyword | Example |
|---|---|---|---|
| someValuesFrom | ∃ | some | hasChild some Man |
| allValuesFrom | ∀ | only | hasSibling only Woman |
| hasValue | ∋ | value | hasCountryOfOrigin value England |
| minCardinality | ≥ | min | hasChild min 3 |
| cardinality | = | exactly | hasChild exactly 3 |
| maxCardinality | ≤ | max | hasChild max 3 |
Boolean Class Constructors
Boolean class constructor symbols have simply been replaced by their English language counterparts.
| OWL | DL Symbol | Manchester OWL Syntax Keyword | Example |
|---|---|---|---|
| intersectionOf | ⊓ | and | Doctor and Female |
| unionOf | ⊔ | or | Man or Woman |
| complementOf | ¬ | not | not Child |
Complex Class Expressions
Complex class expressions can be constructed using the above boolean constructors and restrictions. For example,
Person and hasChild some (Person and
(hasChild only Man) and (hasChild some Person))
describes the set of people who have at least one child that has some children that are only men (i.e. grandparents that only have grandsons).
Note that brackets should be used to disambiguate the meaning of the expression.
Data values and Datatypes (OWL1.1)
Data values may be untyped or typed (eg int, boolean, float etc). The types available will depend on tool support, but will include those specified in the XSD recommendation.
Constants can be expressed without type by just enclosing them in double quotes, or with type
hasAge value "21"^^long
Usage of these datatypes in more general expressions is possible through their shortened name
hasAge some int
Several additional XSD facets can also be used to create new datatypes
Person and hasAge some int[>= 65]
Multiple facets can also be used. For example, when wishing to express numeric ranges
Person and hasAge some int[>= 18, <= 30].
| XSD facet | Meaning |
|---|---|
| < x, <= x | less than, less than or equal to x (more info) |
| > x, >= x | greater than, greater than or equal to x (more info) |
| length x | For strings, the number of characters must be equal to x (more info) |
| maxLength x | For strings, the number of characters must be less than or equal to x (more info) |
| minLength x | For strings, the number of characters must be greater than or equal to x (more info) |
| pattern regexp | The lexical representation of the value must match the regular expression, regexp (more info) |
| totalDigits x | Number can be expressed in x characters (more info) |
| fractionDigits x | Part of the number to the right of the decimal place can be expressed in x characters (more info) |
Please note: some xsd datatypes and facets may not be supported by particular reasoners at this current time.
A report on the current status of reasoner implementations is available
