hermes.stages
Stages
apply_stages walks a fixed tuple. Each function takes the draft and returns a query. Replacing a function is how a later technique enters the training-free pipeline.
Contract
def stage(sparql, *, ontology, context):
return sparql
STAGES = (guardrails, query_guided, context_guided, chase_backchase)
ontology is the vocabulary dict, not a path. The stages run on the first draft and again on the repair draft. Source: stages.py.
Guardrails
Declares known prefixes that the draft uses but does not declare, from the vocabulary and the RDF, RDFS, OWL, and XSD namespaces. Prefixes inside IRIs and string literals are ignored. Rejecting terms outside the vocabulary is the job of the verifier, which the planners use.
Query guided, context guided, chase and backchase later
These return the draft unchanged. Chase and Backchase now lives in the uniqgen system, over constraint tables, rather than as a post-processing stage.