RDFS treats rdfs:domain and rdfs:range as inference rules, not validation rules.
That means the graph does NOT ask:
“Is this already a :Master?”
Instead, it concludes:
“Because this entity used the :teaches relationship, it MUST be a :Master.”
The Movie Casting Analogy
Imagine a movie production database.
The system contains this rule:
:teaches rdfs:domain :Master ;
rdfs:range :Ninja .
This means:
- whoever performs the action
:teaches is inferred to be a :Master
- whoever receives the action is inferred to be a
:Ninja
Now suppose someone accidentally enters:
:Pizza :teaches :Donatello .
The reasoner does NOT reject it.
Instead, it silently concludes:
:Pizza a :Master .
:Donatello a :Ninja .
Why This Feels Strange
If you come from SQL or object-oriented programming, your instinct is:
“Only Masters are allowed to teach.”
But RDF/RDFS thinks differently.
RDFS says:
“If something teaches, then it is a Master.”
The relationship itself becomes evidence for classification.
The Uniform Analogy
Think of predicates like uniforms in a school.
If someone walks into the building wearing a teacher uniform, the security guard assumes:
“That person is a teacher.”
The system does not verify credentials first.
The action or role automatically classifies the entity.
In RDF:
| Predicate Used | What the Graph Infers |
|---|
:teaches | subject is a :Master |
:teaches | object is a :Ninja |
Example
:Splinter :teaches :Donatello .
Automatically entails:
:Splinter a :Master .
:Donatello a :Ninja .
Important Distinction
| Technology Style | Meaning of "domain" |
|---|
| SQL / OOP | Restriction or validation |
| RDFS | Inference rule |
RDFS does not reject bad data.
It expands the graph with new inferred facts.
The Hidden Danger
A mistaken relationship can silently misclassify things.
For example:
:CoffeeMachine :teaches :Alice .
would infer:
:CoffeeMachine a :Master .
which is probably nonsense.
Where SHACL Fits
If you actually want to reject invalid data, you need SHACL.
RDFS says:
“I will infer types from relationships.”
SHACL says:
“I will validate whether the graph obeys the rules.”
Mental Model
Think of RDFS as an automatic classifier.
Predicates behave like semantic clues.
When the graph sees a relationship, it uses that relationship to infer what kinds of things the subject and object must be.
Key Insight
rdfs:domain and rdfs:range are not guardrails.
They are type-generating inference rules.
Using a predicate teaches the graph how to classify the connected entities.