krrood.entity_query_language.rdr.underspecified#

Adapter from an underspecified EQL Match to RDR attribute inference.

An underspecified query marks the attributes to infer with ... (Ellipsis) and may carry concrete attribute constraints plus a domain of instances, e.g.:

an(Animal)(hair=True, species=...).from_(animals)

This adapter reads that query: it locates the ... inference targets, keeps the concrete attributes as an ordinary EQL filter (the ellipsis conditions stripped out), and streams the domain instances that pass the filter — the cases an RDR backend then fills.

Single-class RDR fills a single, scalar attribute; an ... slot whose declared type is an unbounded iterable (list/set/…) is rejected here and left to a future MultiClassRDR.

Classes#

RippleDownRulesMatchParser

Reads an underspecified Match for RDR-based attribute inference.

Module Contents#

class krrood.entity_query_language.rdr.underspecified.RippleDownRulesMatchParser#

Reads an underspecified Match for RDR-based attribute inference.

match: krrood.entity_query_language.query.match.Match#

The underspecified query whose ... attributes are inferred.

property case_type: Type#

The type whose instances are being completed (e.g. Animal).

property variable: krrood.entity_query_language.core.variable.Variable#

The EQL variable the query ranges over.

property inference_targets: List[krrood.entity_query_language.query.match.AttributeMatch]#

The ... attribute leaves to infer (each validated as single-valued).

single_target() → krrood.entity_query_language.query.match.AttributeMatch#
Returns:

The sole inference target, enforcing the single-class invariant.

property target_attribute_name: str#

The name of the single attribute this query asks to infer.

filtered_cases() → Iterator[Any]#

Lazily yield the domain instances that satisfy the concrete (non-...) constraints — ordinary EQL evaluation, with the ellipsis conditions stripped.