Class expressions are used to describe individuals that share common characteristics. This includes both class names (or named classes) and complex class expressions. The table below presents the keywords that are used to build up complex class expressions along with some examples. Class expressions can be nested to arbitrary depths in order to build up rich descriptions of the domain being modelled.

The Manchester OWL Syntax is used for presenting and writing various kinds of complex expressions in Protégé. This page provides a brief overview of the class expression syntax.

Class Expression Syntax

Keyword Example Intuitive Meaning
some hasPet some Dog Things that have a pet that is a Dog
This is the most common type of class expression. Also known as, an "SomeValueFrom restriction" or an "Existential Restriction". This kind of class expression consists of a property (in this case hasPet) and a class expression that is known as a filler (in this case the filler is Dog).

Individuals that are instances of this class expression have a relationship along the hasPet property to an individual that is an instance of class Dog.
value hasPet value Tibbs Things that have a pet that is Tibbs.
Here, Tibbs is a specific individual. Intuitively this would describe Tibb's owners. Note that this is a short cut for, and logically equivalent to, (hasPet some {Tibbs}), where the curly brackets describe a class of specific individuals - in this case, a class of one individual that is Tibbs. Also known as a "HasValue restriction"
only hasPet only Cat Things that have pets that are only Cats.
Note that this does not mean that these things must have a Cat, but if they do have a pet then it will be a Cat. Also known as an "AllValuesFrom restriction" or a "Universal restriction"
min hasPet min 3 Cat Things that have at least three pets that are Cats.
Things that have at least three pets that are Cats. Also known as a "Min cardinality restriction"
max hasPet max 5 Dog Things that have at most five pets that are Dogs.
Note that there may be more than five pets in total e.g. three Cats and five Dogs, but the number of Dogs will not be more than five. This class expression also means that there may be no pets at all. Also known as a "Max cardinality restriction"
exactly hasPet exactly 2 GoldFish Things that have exactly 2 GoldFish as pets.
Note that there may be more than two pets, but two of the pets are GoldFish - no more and no less. Also known as an "Exact cardinality restriction"
and Person and (hasPet some Cat) People that have a pet that's a Cat.
Here we have a class name and a complex class expression combined with the and keyword. The brackets are optional in this particular case, but have been included for clarity. Also known as an "Intersection" or a "Conjunction". We also say that each class expression in the conjunction is a "conjunct".
or (hasPet some Cat) or (hasPet some Dog) Things that have a pet that's a Cat or have a pet that's a Dog
Note that the or is not exclusive. That is, this class includes the things that have a Cat as a pet, or have a Dog as a pet, or have both a pet Dot and a pet Cat. Note that we could have also written this example as (hasPet some (Cat or Dog)) Also known as a "Union" or a "Disjunction". We also say that each class expression in the disjunction is a "disjunct".
not not (hasPet some Dog) Things that do not have a pet that's a dog.
This includes things that either do not have any pet, or if they have a pet then it's not a Dog. Note that this is logically equivalent to (hasPet only (not Dog)) Also known as a "negation".