Core Concepts
Subsumption
Section titled “Subsumption”Subsumption is the core reasoning operation. Class A subsumes class B when B is a subclass of A (directly or transitively).
In OWLGraph, type(A) matches all nodes typed as B because the materializer writes A onto every B node at insert time. You don’t write JOIN logic or UNION queries — the database handles it.
Animal subsumes Mammal subsumes Dog subsumes GoldenRetrieverQuery type(Animal) → returns GoldenRetrievers, Dogs, Cats, Birds, and everything else in the hierarchy.
Write-Time Materialization
Section titled “Write-Time Materialization”Rather than computing type hierarchies at query time (which gets expensive), OWLGraph materializes inferred facts during mutation processing.
When you write dgraph.type = "GoldenRetriever", the engine adds Dog, Mammal, and Animal as additional type edges on the same node — before the data reaches storage.
Why this matters:
- Reads are fast —
type(Animal)is a simple index lookup - No query-time reasoning overhead
- Consistent results regardless of query complexity
Inference Rules
Section titled “Inference Rules”The materializer applies these rules in order on every mutation:
| Rule | Trigger | Effect |
|---|---|---|
| Delete cascades | Type removed from node | Ancestor types also removed |
| Type hierarchy | dgraph.type set | All superclass types added |
| Domain inference | Property with rdfs:domain used | Domain type added to subject |
| Range inference | Property with rdfs:range used | Range type added to object |
| Inverse properties | Property with owl:inverseOf used | Reverse edge created |
| Symmetric properties | Symmetric property used | Reverse edge with same predicate |
| Property chains | Chain axiom matches in batch | Derived edge created |
| Disjointness check | After all inference | Mutation rejected if violated |
All inferred edges carry an owl.inferred=true facet so you can distinguish asserted from inferred facts.
OWL2 RL Profile
Section titled “OWL2 RL Profile”OWLGraph implements the OWL2 RL (Rule Language) profile. This is the OWL profile designed for materialization-based reasoning with polynomial-time complexity.
What’s supported:
- Class hierarchies (
rdfs:subClassOf) - Property domains and ranges (
rdfs:domain,rdfs:range) - Property characteristics (transitive, symmetric, functional, inverse functional, reflexive, irreflexive, asymmetric)
- Inverse properties (
owl:inverseOf) - Property chains (
owl:propertyChainAxiom) - Disjoint classes (
owl:disjointWith) - Class expressions (intersection, union, complement, some/all values from, has value)
- Equivalent classes (
owl:equivalentClass)
What’s not supported (by design):
- Full OWL DL tableau reasoning
- Open-world assumption reasoning
- Nominals (enumerated classes)
- Cardinality restrictions
The RL profile is the sweet spot for real-world applications — it handles the class hierarchies, property reasoning, and type inference that 95% of ontology-driven applications need, without the computational complexity of full DL reasoning.
Circuit Breaker
Section titled “Circuit Breaker”If a single mutation would generate more than 10,000 inferred edges, materialization is aborted and the mutation is rejected. This prevents runaway inference in pathological ontologies.
Retroactive Materialization
Section titled “Retroactive Materialization”When an ontology is loaded into a cluster that already contains data, OWLGraph triggers a background process that scans existing nodes and adds missing ancestor type edges. This runs asynchronously and doesn’t block the ontology load response.