Unit: eligibility-compiler
State: Implemented, awaiting validation in network environment
Sketch: mork-eligibility-compiler.md
Plan: eligibility-compiler.md (2026-09-23) — verification steps below are now slices A1–A5 there; step 5’s Drools/Pellet dependency is redesigned as a shared, test-scope-only module (Part B), never a dependency of tools/mork_compilers itself
Governing ADRs: ADR-A23, ADR-A24, ADR-A83 (Accepted 2026-09-25, test-only reasoning engine isolation)
A compiler family for deterministic, multi-backend eligibility condition execution. Narrowed scope (Phase 5 subset): elg:IntervalCondition with three backends, no native implementation.
eligibility_ir.py compiles elg:IntervalCondition into a backend-neutral IntervalPlan capturing value space and required intervals with closuresparql_backend.py): generates mork:QueryTemplate + exe:SparqlArtefact returning decision per conditionshacl_backend.py): generates readiness and containment shapes as sh:NodeShape + exe:ShaclArtefactswrl_backend.py): generates positive-only Horn clauses (exe:SwrlArtefact) inferring decision from required intervalsimplementsCondition, derivedFromEligibilityNode, derivedFromQuantificationNode, producesArtefact linkstools/mork_compilers/src/mork_compilers/ — shared IR, three backends, CLI, testsontology/mork/spec/Executable.ttl — exe:IntervalContainmentPlan, exe:SparqlArtefact, exe:ShaclArtefact, exe:SwrlArtefact term definitionselg:IntervalCondition → IntervalPlan → {SPARQL|SHACL|SWRL} → typed artefact with provenanceexp:ExecutableProjectionContract) — identified as separate ADR-grade architectural layerexe:EvaluationRun, exe:ConditionResult) — compilation only, not executionelg:IntervalContainment compiled; elg:ExactCondition, elg:SetMembershipCondition, elg:WildcardCondition refused with diagnostic|| unionThe authoring environment lacked Python interpreter, SHACL/SWRL engines, and SPARQL execution. Superseded by plans/eligibility-compiler.md, which turns the five steps below into slices A1–A5 and — because step 5 would otherwise pull a JVM reasoner and rules engine onto the main dependency path — designs a shared, test-only platform/reasoning-testkit module (Part B) so no product package ever depends on Drools/Pellet directly. Original five steps, kept here for history:
python -m unittest mork_compilers.test_mork_compilers -v (→ A1)ontology/mork/spec/Executable.ttl under OWL reasoner with Eligibility imported (→ A2)sparql_backend.compile_query_template() against ontology/eligibility/examples/interval-containment.ttl (→ A3)tools/mork_compilers/ with pyproject.tomlImplementation is complete and internally coherent. Runtime validation in a network-enabled environment with Python, OWL reasoner, SHACL engine, and SPARQL processor is required before production deployment. The sketch’s “Verification plan” section names the exact command matrix.
exp:ExecutableProjectionContract)AllRequired/AnySufficient combination rulesExactCondition, SetMembership, Wildcard with semantics)The deferred condition kinds and profile aggregation are carried by the
applied-ontology-readiness unit, Phase B (plan,
status), under ADR-A89 and ADR-A91. AOR-5 to
AOR-9 added ExactMatch, SetMembership and HierarchicalMatch concept plans
on all three backends, profile aggregation (AllRequired, AnySufficient),
diagnostic codes on every Undetermined, evidence bindings, a CLI for concept
conditions, and mise run check:mork-compilers (74 tests, generated SPARQL
executed against fixtures). The Phase 8 gate now runs the Eligibility
conformance cases through SPARQL and SHACL. Verification step 5 (a reasoner
loading the SWRL) still waits on this unit’s Part B, now drafted as
ADR-A83 (Proposed).
platform/reasoning-testkit wraps HermiT behind a test-only jar.
tools/reasoning_isolation_check.py keeps every other module free of
reasoners. A5 passes for concept, profile and bound-subject rules
(VP). Interval rules use
swrlb builtins, which HermiT does not evaluate, and wait on an Openllet
adapter.
A2’s reasoner half passes: Mork and the Executable closure are consistent under HermiT. It needed two Mork repairs (0.3.0 → 0.4.0): five comment-only GCI annotations now annotate their axioms, and three transitive order relations lost the asymmetry and irreflexivity OWL 2 DL forbids them, with acyclicity moved to SHACL shapes (ADR-A97).
Run the verification plan in a network-enabled environment. On pass, move to Phase 5 validation gate. On failure, diagnose and record results in this status file.