This section demonstrates what actually happens when you run a reasoner against the Northwind ontology. We'll walk through concrete inference chains and show how new facts emerge from existing data.
Before diving into examples, it's important to understand that different reasoners do different things:
These reasoners compute all possible inferences at load time and store them as new triples. Your SPARQL queries are fast because inferred triples are already in the database.
Data loaded → Reasoner runs → Inferred triples added → Queries hit all triples
Pro: Query performance identical to explicit data Con: Materialization can be slow and uses more storage
Instead of pre-computing inferences, these reasoners rewrite your SPARQL query to include the inference logic at query time.
Query submitted → Reasoner rewrites query → Expanded query executes → Results include inferences
Pro: No materialization delay, always up-to-date Con: Queries can be slower due to expanded complexity
These do complete logical analysis — consistency checking, unsatisfiable class detection, and full classification. Not designed for querying, but for validating ontology correctness.
Ontology loaded → Full logical analysis → Report of errors/inferences
Pro: Catches ALL logical issues Con: Slow, doesn't scale to large datasets
Starting data in the database:
# Customer places order nwd:order-10248 nwo:hasCustomer nwd:customer-VINET . # Vins et alcools Chevalier # Order has line items nwd:orderDetail-10248-11 nwo:belongsToOrder nwd:order-10248 . nwd:orderDetail-10248-42 nwo:belongsToOrder nwd:order-10248 . nwd:orderDetail-10248-72 nwo:belongsToOrder nwd:order-10248 . # Line items reference products nwd:orderDetail-10248-11 nwo:hasProduct nwd:product-11 . # Queso Cabrales nwd:orderDetail-10248-42 nwo:hasProduct nwd:product-42 . # Singaporean Hokkien Fried Mee nwd:orderDetail-10248-72 nwo:hasProduct nwd:product-72 . # Mozzarella di Giovanni
The placesOrder property is the inverse of hasCustomer:
placesOrder
hasCustomer
# From: nwd:order-10248 nwo:hasCustomer nwd:customer-VINET # Inferred: nwd:customer-VINET nwo:placesOrder nwd:order-10248 .
Similarly, hasOrderDetail is the inverse of belongsToOrder:
hasOrderDetail
belongsToOrder
# From: nwd:orderDetail-10248-11 nwo:belongsToOrder nwd:order-10248 # Inferred: nwd:order-10248 nwo:hasOrderDetail nwd:orderDetail-10248-11 . nwd:order-10248 nwo:hasOrderDetail nwd:orderDetail-10248-42 . nwd:order-10248 nwo:hasOrderDetail nwd:orderDetail-10248-72 .
Now the boughtProduct chain fires: Customer ←hasCustomer– Order ←belongsToOrder– OrderDetail –hasProduct→ Product
boughtProduct
Customer ←hasCustomer– Order ←belongsToOrder– OrderDetail –hasProduct→ Product
# Inferred via property chain: nwd:customer-VINET nwo:boughtProduct nwd:product-11 . nwd:customer-VINET nwo:boughtProduct nwd:product-42 . nwd:customer-VINET nwo:boughtProduct nwd:product-72 .
Result: From 7 triples of basic order data, the reasoner produced 7 inferred triples, including the direct customer-to-product links that would otherwise require a complex SPARQL query.
Starting data:
nwd:employee-1 nwo:hasTerritory nwd:territory-06897 . # Nancy Davolio → Wilton nwd:employee-1 nwo:hasTerritory nwd:territory-19713 . # Nancy Davolio → Neward nwd:territory-06897 nwo:hasRegion nwd:region-1 . # Wilton → Eastern nwd:territory-19713 nwo:hasRegion nwd:region-1 . # Neward → Eastern
livesIn
The livesIn chain traverses: Employee → hasTerritory → Territory → hasRegion → Region
# Inferred: nwd:employee-1 nwo:livesIn nwd:region-1 .
# From: nwd:territory-06897 nwo:hasRegion nwd:region-1 # Inferred: nwd:region-1 nwo:containsTerritory nwd:territory-06897 . nwd:region-1 nwo:containsTerritory nwd:territory-19713 .
# Nancy is an Employee, Employee subClassOf Person # Inferred: nwd:employee-1 a nwo:Person .
What happens when you add a new employee to the database?
nwd:employee-new nwo:reportsTo nwd:employee-1 . # reports to Nancy Davolio nwd:employee-new foaf:firstName "Alice" . nwd:employee-new foaf:lastName "Smith" . nwd:employee-new nwo:hasTerritory nwd:territory-06897 . # Wilton
Since Employee → reportsTo only Employee:
Employee → reportsTo only Employee
# We stated: nwd:employee-new nwo:reportsTo nwd:employee-1 # allValuesFrom infers: the RANGE must be Employee # But wait — we already know Nancy is an Employee. Nothing new here.
Since manages is the inverse of reportsTo:
manages
reportsTo
# Inferred: nwd:employee-1 nwo:manages nwd:employee-new .
Since livesIn = hasTerritory → hasRegion:
livesIn = hasTerritory → hasRegion
# From: nwd:employee-new nwo:hasTerritory nwd:territory-06897 + nwd:territory-06897 nwo:hasRegion nwd:region-1 # Inferred: nwd:employee-new nwo:livesIn nwd:region-1 .
The FOAF vocabulary declares foaf:firstName rdfs:domain foaf:Person. OWL RL rule prp-dom says:
foaf:firstName rdfs:domain foaf:Person
If p rdfs:domain C and x p y, then infer x rdf:type C.
p rdfs:domain C
x p y
x rdf:type C
Since foaf:firstName and foaf:lastName are used in the data:
foaf:firstName
foaf:lastName
# From: nwd:employee-new foaf:firstName "Alice" # FOAF declares: foaf:firstName rdfs:domain foaf:Person # OWL RL prp-dom infers: nwd:employee-new rdf:type foaf:Person . # From: foaf:Person rdfs:subClassOf foaf:Agent (also in FOAF vocabulary) # OWL RL cax-sco additionally infers: nwd:employee-new rdf:type foaf:Agent .
You don't need to write nwd:employee-new a foaf:Person — using a FOAF property is enough. The reasoner reads the vocabulary's rdfs:domain axiom and infers the type automatically.
nwd:employee-new a foaf:Person
rdfs:domain
On Northwind: once reasoning is turned on and materialized (Connect ▸ Databases ▸ card ⋮ ▸ Config ▸ REASONER), all 9 employees are typed foaf:Person and foaf:Agent, even though the data only stores their names as foaf:firstName / foaf:lastName literals. No explicit rdf:type foaf:Person triple was ever written — foaf:firstName has rdfs:domain foaf:Person (rule prp-dom), and foaf:Person rdfs:subClassOf foaf:Agent (rule cax-sco).
foaf:Person
foaf:Agent
rdf:type foaf:Person
rdfs:domain foaf:Person
prp-dom
foaf:Person rdfs:subClassOf foaf:Agent
cax-sco
In Explore ▸ Browse, classes whose instances are all inferred show a purple border and an ↑ — after materializing, nwo:Person, foaf:Person and foaf:Agent each show 9.
nwo:Person
# This data is INCONSISTENT: nwd:entity-1 a nwo:Product . nwd:entity-1 a nwo:Person .
Product and Person are declared disjoint (owl:disjointWith), so nothing can be both. A reasoner flags this immediately.
owl:disjointWith
# This data creates a problem: nwd:order-10248 nwo:hasCustomer nwd:customer-VINET . nwd:order-10248 nwo:hasCustomer nwd:customer-ALFKI .
hasCustomer is functional, so the reasoner infers nwd:customer-VINET owl:sameAs nwd:customer-ALFKI. If VINET and ALFKI have different IDs (and customerID is functional too), this cascading inference may lead to an inconsistency.
nwd:customer-VINET owl:sameAs nwd:customer-ALFKI
customerID
# An Order without an OrderDetail: nwd:order-incomplete a nwo:Order . nwd:order-incomplete nwo:hasCustomer nwd:customer-VINET . nwd:order-incomplete nwo:hasShipper nwd:shipper-1 . # Missing: hasOrderDetail — required by the equivalentClass definition
The Order's equivalentClass requires minQualifiedCardinality 1 OrderDetail. Under OWL's open-world assumption this is not an inconsistency — the reasoner simply assumes an order detail exists that it has not been told about. To report the missing detail, validate with a SHACL shape using sh:minCount 1.
equivalentClass
minQualifiedCardinality 1 OrderDetail
sh:minCount 1
hasProduct
hasRegion
containsTerritory
hasTerritory
Employee
Person
Customer/Supplier/Shipper
Organization
Rough estimate: the Northwind data graph holds about 31,000 explicit triples; full OWL RL reasoning in RDF Studio adds about 25,500 inferred triples to it — about 6,500 new relationship links and about 19,000 type assertions.
These checks require a full OWL DL reasoner (HermiT/Pellet) and cannot be done by production triplestores:
In RDF Studio: the first three of these DL-level checks are built in. Model ▸ Ontologies runs an OWL 2 DL consistency check with HermiT — the same reasoner Protégé drives from its "Start Reasoner" command — and reports unsatisfiable classes and contradictions without leaving the app.