Restrictions are the constraints you place on classes — they define what values properties can or must have for instances of a class. They appear in the RDF Studio editor under "Restrictions (subClassOf)" and "Equivalent Class Restrictions" on each class card.
OWL distinguishes between two kinds of restrictions, and understanding the difference is essential for ontology design.
A rdfs:subClassOf restriction says: "Every instance of this class MUST satisfy this constraint."
rdfs:subClassOf
But satisfying the constraint alone does not make something an instance of the class. These are one-way rules — they constrain, but they don't define.
An owl:equivalentClass restriction says: "Something IS an instance of this class if and only if it satisfies these constraints."
owl:equivalentClass
This is a two-way rule — it both constrains existing instances AND enables a reasoner to automatically classify new instances that match the pattern.
The Order class uses both types, and each serves a different purpose:
# EQUIVALENT CLASS — the defining characteristics of an Order nwo:Order owl:equivalentClass [ a owl:Class ; owl:intersectionOf ( [ owl:onProperty nwo:hasCustomer ; owl:qualifiedCardinality "1" ; owl:onClass nwo:Customer ] [ owl:onProperty nwo:hasOrderDetail ; owl:minQualifiedCardinality "1" ; owl:onClass nwo:OrderDetail ] [ owl:onProperty nwo:hasShipper ; owl:qualifiedCardinality "1" ; owl:onClass nwo:Shipper ] ) ] . # SUBCLASS — additional requirements, but not part of the definition nwo:Order rdfs:subClassOf [ owl:onProperty nwo:hasEmployee ; owl:qualifiedCardinality "1" ; owl:onClass nwo:Employee ] , [ owl:onProperty nwo:orderDate ; owl:cardinality "1" ] .
The defining characteristics should be the minimal set that uniquely identifies the concept. An Employee and an orderDate are required fields, but they're not definitional — many things could have an employee and a date without being an Order.
Think of it like a legal identity vs. requirements:
sameAs
If you run a reasoner (Pellet, HermiT), it uses equivalentClass to automatically classify untyped instances. subClassOf only constrains — it cannot infer class membership, and a missing value is reported by SHACL, not by the reasoner.
equivalentClass
subClassOf
Both restriction types appear as separate sections on each class card:
You can add restrictions to either section using the + button on each section header.
owl:qualifiedCardinality
Specifies that a property must have exactly N values of a specific type.
# Product must have exactly 1 Category nwo:Product rdfs:subClassOf [ a owl:Restriction ; owl:onClass nwo:Category ; owl:onProperty nwo:hasCategory ; owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ] . # Product must have exactly 1 Supplier nwo:Product rdfs:subClassOf [ a owl:Restriction ; owl:onClass nwo:Supplier ; owl:onProperty nwo:hasSupplier ; owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ] . # Order must have exactly 1 Employee (who processed it) nwo:Order rdfs:subClassOf [ a owl:Restriction ; owl:onClass nwo:Employee ; owl:onProperty nwo:hasEmployee ; owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ] .
In plain English: A Product must have exactly one Category and exactly one Supplier. An Order must be processed by exactly one Employee.
The two directions behave differently:
hasCategory
sh:minCount 1
owl:maxCardinality 1
owl:maxQualifiedCardinality 1
owl:differentFrom
owl:cardinality
Same as qualified cardinality but without specifying the type of the value. Used primarily for datatype properties.
# Product must have exactly 1 productName (any string) nwo:Product rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:productName ] . # Product must have exactly 1 unitPrice nwo:Product rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:unitPrice ] . # Product must have exactly 1 discontinued flag nwo:Product rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:discontinued ] . # Order must have exactly 1 orderDate nwo:Order rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:orderDate ] . # Employee must have exactly 1 firstName and 1 lastName nwo:Employee rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty foaf:firstName ], [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty foaf:lastName ] .
In plain English: Every Product MUST have a name, a price, and a discontinued flag. Every Order MUST have an order date. Every Employee MUST have a first name and last name.
hasCategory exactly 1 Category
rdfs:range
productName exactly 1
owl:minCardinality
owl:minQualifiedCardinality
Specifies that a property must have at least N values.
# OrderDetail must have at least 1 quantity value nwo:OrderDetail owl:equivalentClass [ a owl:Class ; owl:intersectionOf ( ... [ a owl:Restriction ; owl:minCardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:quantity ] ) ] . # Order must have at least 1 OrderDetail (qualified) nwo:Order owl:equivalentClass [ a owl:Class ; owl:intersectionOf ( ... [ a owl:Restriction ; owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger ; owl:onClass nwo:OrderDetail ; owl:onProperty nwo:hasOrderDetail ] ) ] . # Employee must cover at least 1 Territory nwo:Employee rdfs:subClassOf [ a owl:Restriction ; owl:minCardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:hasTerritory ] .
In plain English:
An Employee with zero territories is not flagged by the reasoner: under OWL's open-world assumption it simply assumes a territory exists that it has not been told about. A minimum is a rule for data validation — express it as a SHACL shape with sh:minCount 1, and SHACL validation reports the Employee as a violation.
owl:maxQualifiedCardinality
Specifies that a property can have at most N values of a specific type.
# Employee reports to at most 1 other Employee nwo:Employee rdfs:subClassOf [ a owl:Restriction ; owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ; owl:onClass nwo:Employee ; owl:onProperty nwo:reportsTo ] .
In plain English: An Employee can have zero or one manager, but never two. The CEO has no manager (zero), everyone else has exactly one.
This is subtly different from owl:qualifiedCardinality "1" (exactly one) — maxQualifiedCardinality "1" allows zero, making the relationship optional.
owl:qualifiedCardinality "1"
maxQualifiedCardinality "1"
owl:someValuesFrom
Specifies that there must be at least one value of a specific type. Similar to minQualifiedCardinality 1 but more commonly used in subclass restrictions.
minQualifiedCardinality 1
nwo:Category rdfs:subClassOf [ a owl:Restriction ; owl:onProperty nwo:includesProduct ; owl:someValuesFrom nwo:Product ] .
In plain English: Every Category must include at least one Product. There can't be an empty category.
If Category "Beverages" has no includesProduct statements pointing to any Product, the reasoner does not report it (open-world assumption); a SHACL shape with sh:minCount 1 does.
includesProduct
Open World vs. Closed World: OWL uses the open-world assumption — the absence of a triple doesn't mean it's false, just unknown. So a Category without products isn't necessarily invalid; it might just be missing data. SHACL validation uses the closed-world assumption and WILL flag it as a violation.
owl:allValuesFrom
Specifies that if a property has values, all of them must be of a specific type. It's a universal constraint — "everything must be this type."
nwo:Employee rdfs:subClassOf [ a owl:Restriction ; owl:allValuesFrom nwo:Employee ; owl:onProperty nwo:reportsTo ] .
In plain English: If an Employee reports to someone, that someone MUST also be an Employee. You can't report to a Customer or a Product — only to another Employee.
Given:
nwd:employee-1 nwo:reportsTo nwd:employee-2 . # Nancy Davolio → Andrew Fuller
The reasoner infers:
nwd:employee-2 a nwo:Employee .
This is powerful — just by knowing Nancy reports to Andrew, the reasoner knows Andrew must be an Employee.
The Employee class uses every type of restriction, making it a great example to study:
nwo:Employee a owl:Class ; rdfs:subClassOf # 1. Exactly one first name (unqualified cardinality) [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty foaf:firstName ], # 2. Exactly one last name (unqualified cardinality) [ a owl:Restriction ; owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty foaf:lastName ], # 3. At most one manager (max qualified cardinality) [ a owl:Restriction ; owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ; owl:onClass nwo:Employee ; owl:onProperty nwo:reportsTo ], # 4. At least one territory (min cardinality) [ a owl:Restriction ; owl:minCardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty nwo:hasTerritory ], # 5. Can only report to Employees (all values from) [ a owl:Restriction ; owl:allValuesFrom nwo:Employee ; owl:onProperty nwo:reportsTo ], # 6. Every Employee is a Person (simple subclass) nwo:Person .
This says: An Employee is a Person who has a first name, a last name, at most one manager (who must also be an Employee), and is assigned to at least one Territory.
hasSupplier
productName
unitPrice
discontinued
hasEmployee
orderDate
hasCustomer
hasOrderDetail
hasShipper
foaf:firstName
foaf:lastName
reportsTo
hasTerritory
hasProduct
quantity
hasRegion