What the hell is water?
Understanding the fundamental difference between OWL and SHACL - open world vs closed world assumptions in RDF modeling
What the hell is water?
Assumptions in RDF Modeling
There is a famous parable David Foster Wallace used in his 2005 commencement speech:
Two young fish are swimming along. They pass an older fish who nods and says,
“Morning, boys. How’s the water?”
The two young fish swim for a while, and eventually one turns to the other and asks,
“What the hell is water?”
The point is that the most pervasive assumptions, the ones shaping everything we do, are often the hardest to see.
RDF modeling has exactly this problem.
When people debate SHACL vs OWL, they usually talk about surface distinctions:
entailment vs validation, inference vs constraints.
But what they are actually choosing, often without noticing, is a worldview: open world vs closed world.
And like freshwater vs saltwater, the fish may look the same, but they are fundamentally different.
OWL (The Open World)
In OWL, you are stating truths about the world.
The logic flows from Structure -> Type.
- Mindset: “If it acts like a duck, it is a duck.”
ex:Person a owl:Class ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty ex:hasParent ;
owl:cardinality 2 ;
] . “Every ex:Person has exactly two ex:hasParent relationships.”
| Type | Parents Present | Interpretation under OWL (Open World) |
|---|---|---|
| untyped | 2 parents | We can infer that the individual is ex:Person. |
| untyped | 1 or 0 | It may still be a Person; the graph may simply be incomplete. |
ex:Person | unknown | We infer that exactly two parents exist somewhere, even if they are not stated. |
ex:Person | 1 parent | The missing parent is assumed to exist. |
ex:Person | 3 parents | It is possible that two of the parents are actually the same individual. |
Key idea: absence of evidence is not evidence of absence.
Missing data is assumed. The world is incomplete.
OWL behaves like scientists who, when they find one fossil, assume more may still be buried.
SHACL (The Closed World)
In SHACL, the logic is inverted.
The logic flows from Type -> Structure.
- Mindset: “If you claim to be a duck, you had better have feathers.”
ex:Person a rdfs:Class, sh:NodeShape ;
sh:property [
sh:path ex:hasParent ;
sh:minCount 2 ;
sh:maxCount 2 ;
] . “Every ex:Person must have exactly two ex:hasParent relationships in the data being validated.”
| Type | Parents Present | Interpretation under SHACL (Closed World) |
|---|---|---|
| untyped | any | Not applicable. |
ex:Person | 2 parents | Valid. |
ex:Person | 1 or 0 | Invalid. |
ex:Person | 3 parents | Invalid. |
The graph is taken as complete.
If it is not there, it does not exist.
SHACL behaves like accountants:
“Show me the receipts. If they are not on the page, they do not count.”
This is what you are buying into when you make the choice of modeling with OWL vs modeling with SHACL: open world vs closed world, freshwater vs salt.
You can get entailment while modeling with SHACL by mixing in RDFS and OWL.
You can get validation while modeling with OWL by using SHACL.
Do not choose based only on functionality, you can get fish in either one. Choose the water.