Reading tools and contents
Ontology & Knowledge Graph Engineering

Chapter 3 of 10

RDFS, OWL 2, and formal semantics

Standards and reasoning

About 4 minutes · includes examples, an exercise, and references

Chapter at a glance

  • RDFS domain and range produce type entailments; they are not validation constraints.
  • OWL restrictions and open-world semantics do not guarantee explicit field presence.
  • owl:sameAs is substitutive identity and should never be a fuzzy-match label.

RDFS and OWL do more than document graph shape. They define semantics from which additional statements may be entailed. If GraduateStudent is a subclass of Student and Ada is a GraduateStudent, an RDFS-aware system can entail that Ada is a Student. If manages has Manager as its domain, asserting that Robin manages a project entails that Robin is a Manager. Domain and range axioms are inference rules, not input-validation messages; using them as if they reject mistyped data is a fundamental modeling error.

OWL 2 adds expressive class descriptions and property axioms. It can state equivalence, disjointness, inverse properties, property chains, cardinality restrictions, and value restrictions. An ontology might define RegulatedSupplier as a Supplier that supplies at least one RegulatedComponent. A reasoner can then classify individuals from asserted relations. This is useful when classifications must remain consistent across many applications, but every inference rule expands the consequence of each asserted triple.

Formal semantics changes how absence and identity behave. OWL generally uses an open-world assumption: an unasserted acquirer is not necessarily nonexistent. It also does not impose a unique-name assumption by default: two IRIs are not automatically known to denote different individuals. An explicit differentFrom statement or an applicable disjointness consequence may be needed. Conversely, sameAs is extremely strong: every property of one individual transfers to the other. Do not use exact equivalence as a loose deduplication hint.

Class versus individual modeling deserves deliberate treatment. A product model may be a class whose serial-numbered units are individuals, or it may itself be an individual related to product-family concepts. The correct choice depends on the questions and rules. “Can this entity have instances?” is not sufficient; ask whether class-level entailment, individual-level history, and identity lifecycle match the domain. Punishingly complex models often arise when every code-list value becomes an OWL class despite no need for class reasoning.

Restrictions describe classes; they do not necessarily force the graph to contain visible field values. The axiom that every Acquisition has exactly one acquirer means that any model of the ontology must assign one, but under open-world semantics a reasoner may satisfy the axiom with an unknown value rather than report a missing triple. Use SHACL when the ingestion contract requires one explicit acquirer value. OWL answers what follows if the axioms and facts are true; validation asks whether submitted data meets an operational contract.

Inconsistency is global under classical logic. If an entity is inferred into two disjoint classes, the ontology becomes inconsistent. Some stores isolate or tolerate inconsistencies; others may make reasoning results unusable. Design an inconsistency policy: reject the batch, quarantine affected assertions, run a non-entailing mode, or require review. Never assume that a reasoner will automatically repair the source claim.

Choose an OWL profile from workload needs. OWL 2 EL supports polynomial-time reasoning for large ontologies with extensive class and existential structure. OWL 2 QL is designed to support query answering over large instance data through rewriting. OWL 2 RL supports rule-based implementation over RDF triples. Full OWL 2 DL is more expressive but carries higher reasoning cost and stricter structural constraints. Profile conformance should be tested in continuous integration rather than discovered after production data grows.

Materialization computes and stores entailed triples ahead of queries. Query rewriting expands a query using ontology axioms. Forward materialization can make reads fast but increases storage, update work, and deletion complexity. Rewriting keeps asserted data compact but can produce large query plans. A hybrid may materialize stable hierarchies while rewriting selected relations. Whichever strategy is used, an answer should distinguish asserted evidence from entailed conclusions and identify the ontology version that justified the entailment.

Treat reasoning as a versioned compiler stage. Inputs are asserted graphs plus an ontology release; outputs are an entailment set, classifications, or rewritten queries. Record the reasoner configuration and profile. Add tests for intended entailments, forbidden entailments, satisfiability, and performance. Formal semantics creates leverage only when its consequences are observable and governed.

Key points

  • RDFS domain and range produce type entailments; they are not validation constraints.
  • OWL restrictions and open-world semantics do not guarantee explicit field presence.
  • owl:sameAs is substitutive identity and should never be a fuzzy-match label.
  • Select an OWL profile and reasoning strategy from measured workload needs.

OWL axioms for a regulated supplier

Read the expected behavior in the surrounding walkthrough, then copy and run this reference implementation.

OWL axioms for a regulated supplierturtle
@prefix ex: <https://kg.example/ontology/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

ex:RegulatedSupplier a owl:Class ;
  owl:equivalentClass [
    a owl:Class ;
    owl:intersectionOf (
      ex:Supplier
      [ a owl:Restriction ;
        owl:onProperty ex:supplies ;
        owl:someValuesFrom ex:RegulatedComponent ]
    )
  ] .

ex:Employee owl:disjointWith ex:ExternalOrganization .
ex:supplies rdfs:domain ex:Supplier .

Worked examples

Toy

Inferring a type

The graph asserts only that Mira operates Machine-7 and declares the domain of operates to be Operator.

An RDFS reasoner entails that Mira is an Operator. It does not validate that the source deliberately classified Mira, and the provenance of the inferred type differs from the source assertion.

  • Asserted triple
  • Axiom used
  • Entailed triple

System

Reasoning over access classifications

A graph infers sensitivity classes from data lineage and asset type.

Materialize only classifications whose rules and provenance are approved. Place inferred results in a release graph with ontology and input versions. Authorization still runs in a policy engine and must not blindly trust a stale inference cache.

  • Reasoning profile
  • Invalidation behavior
  • Separation of semantic classification and authorization

Exercise

Separate entailment from validation

Take six business rules and classify each as an OWL semantic axiom, a SHACL constraint, an application policy, or a combination.

  1. Write two intended entailment tests.
  2. Write one inconsistency test.
  3. Identify an axiom that would cause an unintended global inference.
  4. Choose EL, QL, RL, or no OWL profile and justify it.

Success criteria

  • No missing-field requirement is represented only as an OWL restriction.
  • Identity axioms use exact semantics.
  • The reasoning strategy names operational costs.
  • Tests distinguish asserted and inferred facts.

Reflect: Which rule seemed semantic at first but actually belonged in validation or authorization?

References and further reading