Status: Planned OWL reasoning is on the roadmap but not yet implemented. This page describes the design philosophy and planned approach.

What Is OWL?

The Web Ontology Language (OWL) is a W3C standard for defining ontologies — formal descriptions of the types, properties, and relationships in a domain. OWL lets you express things like:

When an OWL reasoner processes these declarations, it can infer new facts. For example, if you know ":MountEverest rdf:type :Mountain" and ":Mountain rdfs:subClassOf :LandForm", the reasoner infers ":MountEverest rdf:type :LandForm".

SutraDB's Approach

SutraDB's core philosophy is "store first, reason second." The database stores exactly what you put in — nothing more. OWL reasoning is planned as an opt-in, query-time layer that never modifies stored data.

Typical Approach (Not Ours)

Many triplestores pre-compute all inferences and store them as additional triples (materialization). This means:

  • Insert is slow (triggers reasoning)
  • Storage bloats (inferred triples can 10x the data)
  • Hard to tell which facts are stored vs. inferred
  • Changing the ontology requires full recomputation

SutraDB's Approach

Reasoning happens at query time, on demand:

  • Insert is fast (no reasoning overhead)
  • Storage stays lean (only explicit facts)
  • Inferred facts are clearly distinguished
  • Ontology changes take effect immediately
  • Opt-in per query (disable for raw data access)

Configurable reasoning

The planned design lets you control reasoning per-query. When reasoning is off (the default), SutraDB behaves as a pure RDF-star store. When on, the query engine expands patterns to include inferred facts:

-- Without reasoning: only explicit Mountain instances
SELECT ?mountain WHERE {
  ?mountain a ex:Mountain .
}

-- With reasoning enabled: includes anything that is a subclass
-- of Mountain (e.g. Volcano, if Volcano rdfs:subClassOf Mountain)
-- Syntax TBD, possibly via query hint or PRAGMA

Planned OWL Features

FeatureOWL ConstructWhat It Does
Class hierarchy rdfs:subClassOf If A subClassOf B and X rdf:type A, infer X rdf:type B
Property hierarchy rdfs:subPropertyOf If P1 subPropertyOf P2 and X P1 Y, infer X P2 Y
Equivalence owl:equivalentClass Two classes treated as the same for type queries
Same identity owl:sameAs Two IRIs refer to the same real-world entity
Inverse properties owl:inverseOf If P1 inverseOf P2 and X P1 Y, infer Y P2 X
Restrictions owl:someValuesFrom Constrain what values a property can take for a class

Why Not RDFS?

SutraDB explicitly does not implement RDFS inference as a separate layer. RDFS inference (domain/range propagation, subclass/subproperty closure) is a subset of what OWL provides. Rather than implementing two reasoning systems, SutraDB plans to implement the useful subset of OWL that covers all RDFS use cases, with a single toggle.

OWL and Vectors

An interesting future direction is combining OWL reasoning with vector search. For example:

-- "Find things similar to this embedding that are Landforms"
-- With OWL reasoning on, this includes Mountains, Volcanoes,
-- Plateaus, etc. (all subclasses of LandForm)
SELECT ?entity WHERE {
  VECTOR_SIMILAR(?entity ex:hasEmbedding "..."^^sutra:f32vec, 0.8)
  ?entity a ex:LandForm .  -- expanded by reasoning
}

The query planner would execute the vector search first (fast, narrows to candidates), then check type membership with OWL expansion (includes subclasses). This is the full power of hybrid graph+vector+ontology queries.

Protégé Compatibility

SutraDB plans to be compatible with Protégé, the standard OWL ontology editor. This means:

This is planned for after the core OWL reasoning layer is implemented.