axiom.axiomatize

Lift supported RDF graph patterns into structural elements.

The public entry point is axiomatize(), which partitions a graph into the currently implemented StructuralElement models. The implementation uses RDFLib graph triple-pattern lookup rather than SPARQL or a secondary in-memory index.

Exceptions

AxiomatizationError

Base class for graph-to-structural-element lifting errors.

UnsupportedGraphError

Raised when graph content is outside the supported v1 axiomatization.

MalformedGraphError

Raised when a recognized supported pattern has an invalid RDF shape.

Functions

axiomatize(...)

Lift supported RDF graph patterns from graph into structural elements.

Module Contents

exception axiom.axiomatize.AxiomatizationError

Bases: ValueError

Base class for graph-to-structural-element lifting errors.

exception axiom.axiomatize.UnsupportedGraphError

Bases: AxiomatizationError

Raised when graph content is outside the supported v1 axiomatization.

exception axiom.axiomatize.MalformedGraphError

Bases: AxiomatizationError

Raised when a recognized supported pattern has an invalid RDF shape.

axiom.axiomatize.axiomatize(graph: rdflib.Graph) → tuple[axiom.structural_element.StructuralElement, Ellipsis]

Lift supported RDF graph patterns from graph into structural elements.

The caller is expected not to mutate graph while axiomatization is in progress. V1 is strict: any initial input triple that cannot be assigned to a currently supported structural element causes UnsupportedGraphError.