inference-engine 0.1.0-alpha.14

Native Rust RDF inference engine with a shared command-line interface
Documentation
---
title: Checked entailment decisions
permalink: /rdfs-ground/
nav_order: 10
grapharch:
  subject: urn:inference-engine:docs:rdfs-ground
---
# Checked decisions over an explicit RDFS source fragment

`entailment::Rdfs12FragmentEntailment` returns positive and negative RDFS 1.2
decisions within a checked source fragment. Both selected graphs must be
literal-free normative RDF. Asserted source roots may be:

- A triple whose predicate lies outside the RDF/RDFS/XSD namespaces.
- `p rdf:type rdf:Property`, with an ordinary named IRI `p`.
- Exactly `rdfs:Resource rdfs:subClassOf rdfs:Class`.
- Exactly `rdfs:Proposition rdfs:subClassOf rdf:Property`.

Other asserted standard-predicate triples remain unsupported. Standard names
in subjects/objects and nested triple terms are data components, not asserted
schema; nested property declarations and subclass statements never activate root
constraints. Scoped blanks and nested object triple terms are
supported in both graphs. Full RDFS decision support remains in development.

The complete decision fragment permits only ordinary predicates in target roots.
For a target with standard predicates, failure of its ordinary-predicate
projection disproves the whole target. Projection success leaves those standard
constraints unresolved and returns `Unsupported`, including an exact original
predicate occurrence. An empty projection cannot prove a nonempty standard tail.
A completed fixed-name/default-datatype certificate can also refute a standard
type constraint before matching is invoked, as described below.
A selective-property completion can also refute a fixed ordinary name's
property membership after checking every selected source predicate occurrence.

Admission streams the complete original source and then the complete target.
An excluded occurrence returns `Unsupported` with its term, original root,
source/target role and recursive path. A storage, metadata, cancellation or budget
failure returns an error. Neither is `NotEntailed`. The full `rdfs` execution
selector remains unavailable.

## The countermodel

This construction applies the conditions in
[RDF 1.2 Semantics §§5, 7, 8 and 9](https://www.w3.org/TR/2026/CRD-rdf12-semantics-20260924/).
It recognizes exactly the three mandatory default datatypes. It does not depend
on a finite constructor schedule or an unproved saturation cutoff.

Start with their fixed datatype denotations and literal values. Assign fresh,
distinct atoms to all other IRI names and to every source blank. Keep these atoms
separate from fixed datatype objects, literal values and constructor outputs.
Close this base under fresh tagged finite ternary trees. This universe `IR` has
an injective total constructor `IT(x,p,y)` on `IR³`. Choose `IP = IC = IR`, so every
resource can act as a property and a class. Interpret each triple term recursively
using `IT`; do not fold or identify different constructor outputs.

Choose class extensions as follows:

| Class | Extension |
| --- | --- |
| Resource, Class, Property, and all otherwise unrestricted classes | IR |
| Literal | Defined literal values LV |
| Each recognized default datatype | Its specified value space |
| Datatype | The three recognized datatype denotations |
| ContainerMembershipProperty | Canonical positive `rdf:_n` denotations |
| Proposition | The image of IT |

Define `rdf:type` from these extensions. Choose `rdfs:subClassOf` as the transitive
closure of identity, every class-to-Resource pair, the stipulated subclass axioms, the admitted source subclass pairs
(Resource-to-Class and/or Proposition-to-Property), and each recognized
datatype-to-Literal pair. These pairs preserve class-extension
inclusion: the exceptional sets lie in IR, and datatype values lie in LV.

Choose `rdfs:subPropertyOf` as identity together with `_n → member` and
`isDefinedBy → seeAlso`. Distinct reserved names prevent these nonidentity edges
from composing with one another, so the relation is already transitive. Its
nonidentity endpoint properties have empty binary extensions. No such edge
enters an ordinary predicate.

Set domain and range extensions to the stipulated axioms. Their nonempty reserved
relations satisfy universal Resource/Class/Property endpoint conditions. The
narrow Literal ranges of label/comment and Proposition range of reifies are
vacuous because those properties are empty. Subject/predicate/object and
first/rest are empty too. Container properties are in IP, their class and
Resource domain/range conditions hold, and nil belongs to List. The induced type
relation gives the required exact Property and datatype memberships. The default
value spaces and constructor image provide the required nonempty classes.

Every remaining reserved property is empty. Give each ordinary predicate exactly
its asserted source endpoint pairs under the fresh source assignment. Class and
binary property extensions are independent: choosing `ICEXT(c) = IR` does not
make `IEXT(c)` universal. The three admitted schema forms hold in this completion: every named resource
is a property, every resource is a class, and the constructor image is a subset
of the property set. No incoming nonidentity subproperty edge requires additional
ordinary pairs.

This is an RDFS interpretation satisfying the source. Fresh source blank atoms
cannot accidentally equal any target name, including fixed standard names and
datatype objects. Injective free constructors keep distinct nested source terms
separate. The symbolic model need not be materialized or enumerated.

## Existential targets and ordinary-predicate projection

Let `P` retain exactly the target roots with ordinary fixed predicates, preserving
all term identities, recursive structure and shared target blank scopes. It is a
conjunction of constraints from the original target, without asserting any quoted
contents. Ordinary property extensions in the constructed model are exactly the
assigned source endpoint pairs.

If a model assignment satisfied `P`, each root would equal a source pair. Fresh
atoms and injective recursive constructors let each occurring target blank's
denotation be represented by a source appearing term. One assignment across the
whole projection yields one consistent syntactic substitution across all its
patterns, including nested and outer appearances of the same blank. Different
target blanks may choose the same source representative. Distinct fixed names
cannot replace one another or a fresh source blank atom.

Complete failure of consistent simple matching therefore falsifies `P` in this
source model, and so falsifies the full target. This is a countermodel proof,
not failure to find a witness within a bounded construction schedule. Matching
success proves the full target only when no roots were discarded; ordinary
simple entailment then supplies the positive proof. Success with a standard
tail is inconclusive: this controller does not evaluate that tail.

Other source schema, literals and generalized positions remain outside admission. The
projection theorem gives no complete procedure for arbitrary schema-bearing
sources or standard-predicate targets. No broader consistency claim follows.

## Fixed names and default datatype classes

In the same completion, each ordinary named atom is separate from all three
fixed default datatype value spaces. A ground target conjunct
`u rdf:type D`, where `u` is an ordinary IRI and `D` is a shared mandatory default
datatype, is therefore false in this source model. Other existential conjuncts
cannot repair that false ground conjunct. The subject may occur as a source
subject, predicate or object, or may be absent from the source.

This is one chosen countermodel. It does not assert that ordinary IRIs can never
denote literal values, and it adds no unique-name rule. A blank subject cannot
receive this certificate: the nonempty value spaces provide existential
witnesses. Unrecognized datatype classes and memberships appearing only inside
quoted terms are also outside this certificate.

The controller classifies the root's subject, predicate and object using IRI
metadata already read during admission. It reuses `Rdf12Datatype::recognize_iri`
from the shared semantic crate; it does not maintain another datatype spelling
table or inspect a literal payload. Only root positions are observed. The current
root subject and first certificate are bounded records; no target graph is
collected. Full source and target admission, including final EOF, cancellation
and work limits, must succeed before returning the negative result. A later
excluded literal or read failure prevents promotion of an earlier candidate.

`NotEntailed { report, refutation }` distinguishes an `OrdinaryProjection`
refutation from `DefaultDatatypeMembership { datatype, occurrence }`. The latter
retains the exact original target subject, root, parent and path. Reports are
observations tied to caller-retained graph/snapshot identities, not independently
trusted proof objects. Matching counters are zero when the completed datatype
certificate makes matching unnecessary; no exhausted matching search is turned
into a negative verdict.

## Fixed property names and a selective-property completion

For the same admitted source, let `B` contain all required standard property
denotations, including every canonical `rdf:_n`, plus all named predicates
appearing in source roots or nested triple terms, plus the subjects of asserted
named-property declarations. Retain separate fresh atoms for
other names and source blanks. Generate finite constructor trees whose middle branches are properties. If the
source asserts Proposition-to-Property, constructor outputs are also properties;
otherwise only `B` are properties. This is a mutual finite-tree construction:
an atom is a property exactly when in `B`, while a constructor node is a property
exactly when that flag is present. It defines `IR` and `IP` without folding trees,
and gives an injective total `IT` on `IR × IP × IR`.
Choose `IC = IR` and `ICEXT(Property) = IP`. Keep the other class sets
from the first completion, with Proposition now the image of this constructor.

Include the admitted source subclass pairs in the generators of the transitive
subclass relation here too. Resource-to-Class preserves `IR ⊆ IR`;
Proposition-to-Property preserves `image(IT) ⊆ IP` by the constructor-property
choice above. These pairs must actually belong to the subclass relation:
class-extension inclusion alone does not assert a subclass triple.

Source triple terms are defined because each of their predicates belongs to `B`.
The standard subproperty relation has identity only on `IP`, plus the same
container and isDefinedBy edges. All endpoints are in `IP`, and the nonidentity
binary extensions are empty. Its domain/range constraints therefore hold.
ContainerMembershipProperty remains a subset of Property; Property is a subset
of Resource. The remaining standard conditions and exact ordinary source pairs
continue to hold. This is a source model without making every resource a property.

An ordinary named `q` absent from all source predicate occurrences and root
property declarations is outside `IP` in this completion. Consequently the fixed target conjunct
`q rdf:type rdf:Property` is false. Merely using `q` as a source subject/object
does not invalidate this certificate, while using it as a predicate inside an
unasserted quoted triple does. This does not assert the quoted contents.
Existential target subjects and claims appearing only inside quotes do not qualify.

The controller streams every eligible target candidate. For each it streams
original source occurrences through EOF, including recursive predicate positions
and asserted root property declarations.
It retains one current candidate/cursor and the first certificate, without a
predicate set or target list. Required early candidates cannot hide a later
unforced name. After a certificate, the remaining target rows are still read
through EOF, with charged skips and no more source probes. Errors or cancellation
discard pending evidence. A required name leaves this standard constraint
inconclusive; it is never treated as a failed membership claim.

Work is `O(C × S)` for `C` eligible candidates and `S` source occurrences.
Every graph scan, target read and candidate IRI read is charged. Before each
source occurrence read, two steps cover at most one root read and one authoritative
structural lookup; traversal also enforces its depth/occurrence/work caps. The
same cumulative search budget spans all candidates and the existing matcher.
Exhaustion is an error, never a negative answer. Backend indexing can optimize
these probes later; it is not needed for this bounded correctness contract.

`NamedPropertyMembership { occurrence }` retains the exact original target
subject/root/path. It describes this selective-property model, separately from
the full-property completion used for the other refutation conditions.

## Storage and resource contract

Implement `TripleSource`, `EntailmentTerms` and `IriTermAccess` over immutable
selected graphs and a shared exact identity domain. IRI access may borrow or share
metadata; cap owned bytes before allocation. Unknown keys and unsupported term
extensions fail, and metadata must already describe syntax-validated RDF terms.
Source and target identities preserve scoped blanks and canonical recursive term
equality. The operation performs no writes, dictionary growth or closure build.

A source handle represents the explicitly selected logical graph. Preserve its
snapshot and graph provenance with the result; an unrelated named graph is not
an implicit assumption. Keep the graph/dictionary immutable across admission and
matching scans. Use the original selected snapshot: an augmented RDFS scratch
graph normally contains standard vocabulary outside this fragment.

`Rdfs12FragmentLimits` supplies admission depth/occurrence/work caps, matching
caps and a per-IRI byte cap. Admission reuses the traversal's triple-term
classification. Admission performs at most one IRI read and blank check per
relevant appearance. Matching additionally charges every raw target row and
predicate metadata read, including rows discarded by projection. Only kept
patterns consume retained target slots. The shared matcher retains its explicitly
capped patterns, bindings and term worklist; arbitrary target spilling is not
provided. No source graph or dictionary is collected. Late failures, contradictory
post-admission metadata and exhausted limits remain errors. Unfiltered simple
matching keeps its existing work-budget behavior.

## Triple-term denotation certificates

A true target triple must have resource-valued endpoints. Recursively evaluating
`<<(s q o)>>` requires a tuple in the graph of `IT`, whose domain is
`IR × IP × IR`. In the selective completion above, a fixed ordinary named `q`
not forced into `B` has a resource denotation but is outside `IP`. No assignment
to target blanks can supply the missing constructor tuple. Structural induction
on nested triple terms equates this relational evaluation with the compositional
semantics: failure at that predicate prevents a value for every enclosing triple
term and therefore prevents truth of the root. No out-of-domain constructor value
is invented. Total IRI interpretation alone does not make every name a property.

`TripleTermPredicate { occurrence }` records the exact nested predicate, parent,
root and path. Every eligible target predicate is considered; a required earlier
candidate cannot hide a later refutable one. Source root/nested predicate uses
and asserted declarations disable a candidate. Quoted declarations do not.
Proposition-to-Property only adds constructor outputs to `IP`, leaving unforced
named atoms outside it. Resource-to-Class holds because `IC = IR`.

This scan uses the same cumulative budget as property probes and matching.
It retains one candidate and the first certificate, then traverses the remaining
target through EOF without more probes. Any late cursor/metadata/cancellation or
limit failure discards pending evidence. The symbolic countermodel is never built
as a graph, and no finite-pass absence is converted to a negative verdict.

## API migration

`SchemaFree*` becomes `Rdfs12Fragment*`, including `Rdfs12FragmentEntailment`,
because the admitted source now includes three explicit schema forms. There are
no compatibility aliases or second evaluator. `UnsupportedSourceSchema` replaces
`ReservedSourceVocabulary`: standard names in data components are now admitted,
while unsupported asserted schema is still rejected. `TripleTermPredicate` is a
new observational refutation variant. Retain graph/snapshot identities with every
result. The cumulative `search`/`search_steps` budget includes property probes,
triple-term predicate probes and consistent matching.

## Measured authored evidence

The revision-3 harness invokes this fragment uniformly on original source
snapshots. Unsupported scope continues to existing positive-proof phases;
actual errors abort a case. Expected verdicts only grade observed results.
All twenty authored cases now have decisions: thirteen positive proofs and seven
negative countermodel decisions, zero unsupported cases, failures or execution
errors. This includes both previously unsupported unestablished/untyped target
triple-term cases. The original manifest is unchanged. These authored cases are
separate from official W3C conformance and do not establish full RDFS compliance.

## Disk-backed acceptance

Run the native storage test with:

```sh
cargo test --locked --features oxigraph-disk-tests --test schema_free_ground_disk
```

It uses Oxigraph's RocksDB store and requires a C++ toolchain and libclang.
Linux CI installs those prerequisites and runs this test before the aggregate
publication gate. The storage feature is opt-in for tests; language binding
artifacts keep their normal feature set.

The fixture persists data, closes the writer and reopens read-only for each
check. An unselected named graph contains both the queried assertion and an RDFS
domain statement. Neither changes the selected source's decision. Adding the
assertion to the selected source changes the result to entailed; deleting it and
reopening restores the negative decision. The asserted quote remains entailed.
The database's quad count also proves the checker added no facts.

A second persisted fixture couples one blank across two quote assertions and a
standard type constraint. Conflicting source quotes disprove both full and
ordinary-only targets. Aligning the quotes makes the ordinary-only target
entailed, while the full target stays unsupported. Restoring the conflict after
another native write/reopen restores both negative results. An unselected graph
contains an aligned assertion and schema; neither affects the selected source.
All three checks retain exactly nine quads, proving the controller wrote no facts.

A third persisted fixture checks all three mandatory default classes. A matching
membership in an unselected graph does not affect the negative certificates.
Adding that membership to the selected source breaks this controller's source
admission and returns `Unsupported`; deleting it and reopening restores the
negative certificates. Quad counts stay 5 → 6 → 5. Existing projection and ground
acceptance tests continue to run alongside it.

A fourth persisted fixture checks two property candidates. An unselected graph
uses the otherwise unforced name as a predicate and does not affect the result.
Adding a selected triple term with that nested predicate invalidates the negative
certificate and returns an inconclusive result; deleting it and reopening restores
the certificate. Quad counts stay 4 → 5 → 4. Thus selected root and nested
predicate occurrences, rather than a global dictionary or foreign graph, control
the property set.

All native open/write/flush/close operations, snapshot construction and one-quad
reads use explicit blocking-task boundaries. The selected input remains immutable
through admission and matching. The fixture adapter has exactly eighteen declared
terms and at most nine quads; production Oxigraph adapter qualification remains a
separate task. It neither hydrates an arbitrary graph/dictionary nor substitutes
an in-memory store when a disk operation fails.

A fifth persisted fixture isolates target triple-term denotation. A property
declaration in the unselected graph cannot establish the target predicate.
Inserting that declaration in the selected source disables the negative
certificate; deleting it and reopening restores it. Quad counts stay 3 → 4 → 3,
with no controller writes. This tests authoritative declaration scope as well as
the constructor predicate certificate against actual persisted storage.