The Web Ontology Language (OWL) is the W3C standard for writing ontologies a machine can reason over. It supplies a vocabulary for classes, properties and individuals, and axioms strong enough that software can derive new facts and detect contradictions. OWL 2 became a W3C Recommendation in 2009, second edition 2012. What an ontology is and how to design one is covered at /concepts/ontologies/; this is the syntax reference.
Syntaxes
RDF/XML is the normative exchange syntax every conforming tool must read and write. Turtle is the readable RDF serialization used for hand-editing. Functional Syntax is the specification’s own form. Manchester Syntax uses English keywords instead of triples and is what Protégé shows. OWL/XML is XML that is not RDF. All carry the same axioms.
The axiom “a Parent is any Person who has at least one child”, in Turtle:
ex:Parent a owl:Class ;
owl:equivalentClass [
a owl:Class ;
owl:intersectionOf (
ex:Person
[ a owl:Restriction ;
owl:onProperty ex:hasChild ;
owl:minCardinality "1"^^xsd:nonNegativeInteger ]
)
] .
And in Manchester Syntax:
Class: Parent
EquivalentTo: Person and (hasChild min 1 owl:Thing)
Manchester fits on one line because it hides the blank nodes RDF needs to attach a restriction to a property. Both produce identical inferences, and an ontology in Turtle or RDF/XML is RDF triples (/languages/resource-description-framework/).
Classes
ex:Person a owl:Class .
ex:Professor rdfs:subClassOf ex:Person .
ex:Human owl:equivalentClass ex:Person .
ex:Person owl:disjointWith ex:Organization .
rdfs:subClassOf states that every member of one class is a member of another, owl:equivalentClass that two classes have the same members, and owl:disjointWith that nothing belongs to both, which makes inconsistency detection possible. owl:Thing is the class of everything and owl:Nothing the empty class; a class inferred equivalent to owl:Nothing is unsatisfiable.
Class expressions
Classes can be built from others, not only named:
ex:WorkingParent owl:intersectionOf ( ex:Parent ex:Employee ) .
ex:Agent owl:unionOf ( ex:Person ex:Organization ) .
ex:NonPerson owl:complementOf ex:Person .
ex:PrimaryColour owl:oneOf ( ex:Red ex:Green ex:Blue ) .
owl:intersectionOf is AND, owl:unionOf OR, owl:complementOf NOT, and owl:oneOf enumerates a class by listing its members. Each takes an RDF list.
Property types
ex:worksAt a owl:ObjectProperty ; rdfs:domain ex:Person ; rdfs:range ex:Organization .
ex:birthDate a owl:DatatypeProperty ; rdfs:range xsd:date .
ex:editorNote a owl:AnnotationProperty .
An object property links an individual to an individual, a datatype property to a literal, and an annotation property carries documentation reasoners ignore, where labels and comments belong.
Property characteristics
ex:hasParent owl:inverseOf ex:hasChild .
ex:partOf a owl:TransitiveProperty .
ex:spouseOf a owl:SymmetricProperty .
ex:hasParent a owl:AsymmetricProperty .
ex:birthDate a owl:FunctionalProperty .
ex:hasISBN a owl:InverseFunctionalProperty .
ex:relatedTo a owl:ReflexiveProperty .
ex:hasParent a owl:IrreflexiveProperty .
Most useful inference comes from here. owl:inverseOf means asserting one direction yields the other, and owl:TransitiveProperty closes chains, so partOf across three hops is entailed. Symmetric holds both ways, asymmetric never both, reflexive and irreflexive control self-relation. owl:FunctionalProperty allows at most one value per subject; owl:InverseFunctionalProperty identifies subjects by a key, so two books with the same ISBN are the same book.
Restrictions
A restriction defines an anonymous class by a condition on a property: an owl:Restriction with owl:onProperty and one constraint.
[ a owl:Restriction ; owl:onProperty ex:hasChild ; owl:someValuesFrom ex:Person ]
[ a owl:Restriction ; owl:onProperty ex:hasChild ; owl:allValuesFrom ex:Person ]
[ a owl:Restriction ; owl:onProperty ex:country ; owl:hasValue ex:France ]
[ a owl:Restriction ; owl:onProperty ex:hasChild ; owl:minCardinality "1"^^xsd:nonNegativeInteger ]
[ a owl:Restriction ; owl:onProperty ex:hasChild ; owl:maxCardinality "3"^^xsd:nonNegativeInteger ]
[ a owl:Restriction ; owl:onProperty ex:hasSpouse ; owl:cardinality "1"^^xsd:nonNegativeInteger ]
[ a owl:Restriction ; owl:onProperty ex:hasChild ;
owl:minQualifiedCardinality "2"^^xsd:nonNegativeInteger ; owl:onClass ex:Doctor ]
owl:someValuesFrom is existential: at least one value is in that class. owl:allValuesFrom is universal: every value that exists is in that class, satisfied trivially when there are none. owl:hasValue pins the property to one individual; the qualified forms count only values of a given owl:onClass.
Individuals
ex:MarieCurie a owl:NamedIndividual, ex:Person .
ex:MarieCurie owl:sameAs <https://www.wikidata.org/entity/Q7186> .
ex:MarieCurie owl:differentFrom ex:PierreCurie .
owl:NamedIndividual declares an individual explicitly, which a valid OWL DL ontology requires. owl:sameAs asserts that two IRIs denote the same thing, carrying cross-dataset identity; owl:differentFrom must be stated, because OWL does not assume it.
OWL vs RDFS
| Capability | RDFS | OWL 2 |
|---|---|---|
| Classes, subclasses, properties, subproperties | Yes | Yes |
| Domain and range | Yes | Yes |
| Disjoint classes | No | Yes |
| Cardinality constraints | No | Yes |
| Inverse, transitive, symmetric, functional properties | No | Yes |
| Classes defined by restrictions | No | Yes |
| Class equivalence and individual identity | No | Yes |
| Consistency checking | No | Yes |
| Reasoning cost | Low, rule-based | Higher, profile-dependent |
RDFS gives inheritance and typing. OWL adds the logic to define classes rather than only name them, and to have a reasoner report that an ontology contradicts itself. Many production graphs stop at RDFS plus a few OWL properties.
Profiles, and OWL DL vs OWL Full
Each profile is a syntactic subset chosen so one reasoning task runs in polynomial time.
OWL 2 EL targets very large class hierarchies. It keeps existential restrictions, intersection and property chains, and drops universal restrictions, negation, disjunction, inverse properties, and cardinality. Classifying hundreds of thousands of classes is fast, which is why ontologies such as SNOMED CT sit here.
OWL 2 QL targets query answering over large instance data, weak enough that a reasoner can rewrite a query into SQL or SPARQL against the raw data with no materialization.
OWL 2 RL targets rule engines. Its constructs run as forward-chaining rules over triples, so it is what most triple stores support and what to assume when a store advertises OWL reasoning without naming a profile.
OWL DL is the full description-logic-compatible language: expressive, decidable, and requiring that classes, properties and individuals stay in separate name spaces. OWL Full drops those restrictions and loses decidability, so no complete reasoner exists.
How reasoning works
Reasoning computes entailments: what must be true given the assertions and the axioms.
ex:partOf a owl:TransitiveProperty .
ex:Building rdfs:subClassOf
[ a owl:Restriction ;
owl:onProperty ex:locatedIn ;
owl:someValuesFrom ex:City ] .
ex:locatedIn rdfs:subPropertyOf ex:partOf .
ex:EiffelTower a ex:Building ; ex:locatedIn ex:Paris .
ex:Paris ex:partOf ex:IleDeFrance .
ex:IleDeFrance ex:partOf ex:France .
A reasoner derives these; none of them are asserted:
ex:EiffelTower ex:partOf ex:Paris . # subPropertyOf
ex:EiffelTower ex:partOf ex:IleDeFrance . # transitivity
ex:EiffelTower ex:partOf ex:France . # transitivity again
ex:Paris a ex:City . # from the someValuesFrom restriction
The last line is the interesting one. Nothing typed Paris as a city; the reasoner concludes it because the Eiffel Tower is a Building, every Building is in some City, and its only asserted locatedIn value is Paris. A query for everything inside France now returns the Eiffel Tower, and one for cities returns Paris.
Open world, and no unique names
Two assumptions explain most confusion about what OWL will and will not do.
Under the open-world assumption, anything not stated is unknown rather than false. A Person with no birthDate does not violate a rule that Persons have one; the reasoner concludes the birthDate exists and is unknown. Adding owl:minCardinality 1 raises no error on incomplete data, the opposite of a NOT NULL column. An OWL ontology reports a problem only by deriving a contradiction, such as an individual in two disjoint classes.
Under the no-unique-name assumption, two IRIs may denote the same thing unless an axiom says otherwise. Declaring hasSpouse functional and asserting two spouses raises no error either; the reasoner concludes the IRIs are the same person, and an error requires owl:differentFrom.
Both make OWL the wrong tool for asking whether a batch of records is complete. That job belongs to SHACL, which validates under a closed world and reports what is wrong.
Reasoners and tools
Protégé, from Stanford, is the standard editor; it can run a reasoner in place and show the justification for any inferred axiom. HermiT and Pellet (maintained as openllet) are full OWL 2 DL reasoners, and ELK is an EL reasoner for very large hierarchies. GraphDB, Stardog, Apache Jena, and RDF4J all reason over stored data, most of them closer to OWL 2 RL than full DL.
For developers
Pick a profile from the reasoning task. Large hierarchy to classify: EL. Modest ontology over huge instance data at runtime: QL, or a rule engine in RL. Consistency checking of complex definitions: OWL DL with HermiT.
Choose between materialization and query-time inference before loading data. Materialization computes entailments once and writes them into the store: fast queries, slow and sometimes non-incremental updates, since deleting an asserted triple can require recomputing everything that depended on it. Query-time inference keeps the store small and pushes cost into every query. Read-heavy graphs materialize; frequently updated graphs infer at query time.
Keep ontology, instance data, and inferred triples in three named graphs, so a revised ontology reloads without touching the data.
For SEOs
schema.org is defined with a light RDFS and OWL-style vocabulary: types form a class hierarchy, properties declare schema:domainIncludes and schema:rangeIncludes (weaker than rdfs:domain and rdfs:range), and there are almost no logical axioms, since a vocabulary for millions of publishers cannot declare anyone’s markup inconsistent. An SEO consumes an ontology rather than authoring one: choose the most specific applicable type, use documented properties, and link entities to public identifiers with sameAs. See /ecosystems/schema-org/.
Related pages
FAQ
What is OWL used for?
OWL defines the classes, properties, and logical axioms of an ontology so software can reason over data described with it. A reasoner infers types and relationships that were never asserted, computes a class hierarchy from definitions, and detects contradictions such as an individual in two disjoint classes. It is used in biomedicine, finance and engineering.
What is the difference between OWL and RDFS?
RDFS provides classes, subclasses, properties, subproperties, domain and range, which are enough for inheritance and typing. OWL adds disjointness, cardinality, property characteristics such as inverse and transitive, class definitions built from restrictions, and identity between individuals. OWL therefore supports consistency checking, which RDFS cannot express, at a higher reasoning cost.
What are the OWL 2 profiles?
OWL 2 defines three profiles that trade expressivity for guaranteed performance. EL keeps existential restrictions and suits very large class hierarchies. QL is weak enough that queries can be rewritten against raw data with no materialization. RL runs as forward-chaining rules and is what most triple stores support.
Why does OWL not reject invalid data?
OWL uses the open-world assumption, so a missing value is unknown rather than false, and it does not assume that different IRIs denote different things. A cardinality axiom states what is true rather than constraining what may be stored, so incomplete data produces inferences. SHACL validates RDF against expected shapes.
Sources and further reading
- W3C, OWL 2 Web Ontology Language Primer: https://www.w3.org/TR/owl2-primer/
- W3C, OWL 2 Web Ontology Language Structural Specification: https://www.w3.org/TR/owl2-syntax/
- W3C, OWL 2 Web Ontology Language Profiles: https://www.w3.org/TR/owl2-profiles/
- W3C, OWL 2 Manchester Syntax: https://www.w3.org/TR/owl2-manchester-syntax/
- Protégé: https://protege.stanford.edu/
