owl:inverseOf

Get the reverse direction of a relation for free.

0/3 done

Theory

Declaring :parentOf owl:inverseOf :childOf means: every :A :parentOf :B triple entails :B :childOf :A, and vice versa.

You only need to assert one direction; the reasoner fills in the other.

In practice this lets you ingest data in whatever direction your source system happens to expose (often only one) and then query in the natural direction for the question at hand — find all students of :Splinter and find all teachers of :Michelangelo become the same shape of query, even though the file on disk only stores :teaches.

Theory

Going deeper — OWL foot-guns

OWL is far more powerful than RDFS, and that power cuts both ways. Three axioms in this level are notorious for surprising people:

  • owl:inverseOf is symmetric in effort but not in storage. The reverse triples are inferred, never materialized in your file. If a downstream tool doesn't run a reasoner, those reverse edges simply aren't there. 'It works in my triplestore but not in the export' is almost always a missing reasoning step.
  • owl:sameAs is a sledgehammer. It says two IRIs are the same individual, so the reasoner merges all their triples in both directions — including ones you didn't intend. One wrong sameAs between near-duplicates can cascade into a graph where everyone shares everyone's properties. Prefer rdfs:seeAlso or a SKOS mapping when you only mean 'related', not 'identical'.
  • Cardinality is open-world, so it infers rather than rejects. owl:maxCardinality 1 on :hasBiologicalMother plus two different mothers does not raise an error — the reasoner concludes the two mother-IRIs must be owl:sameAs each other. Constraints in OWL are satisfied by inference, not by complaint; that's SHACL's department.

Rule of thumb: OWL answers 'what else is true?', never 'what is wrong?'. Keep that distinction and the foot-guns mostly disarm themselves.

Analogy

Saying Alice is Bob's parent automatically tells you Bob is Alice's child. You'd never write both in a diary entry. owl:inverseOf is that intuition, encoded.

It's also why family-tree apps never ask you to fill in both columns: enter one parent-child link and the child-parent link appears on its own. owl:inverseOf is that UX, baked into the data model.

Visualization

Master Student teaches studentOf (inverseOf)

One declaration, two directions. The reasoner mirrors :teaches into :studentOf for every matching triple.

Read the diagram as a single edge with two labels: the green arc going right is what you wrote (:teaches); the arc going back left is what the reasoner adds (:studentOf). No new data — just the same fact, viewed from the other end.

Reading in progress · 0 of 3 activities done