GroundingResolver

Resolves a com.embabel.dice.proposition.Proposition grounding id to the source entity node(s) that back it. The single, pluggable definition of the resolution convention — shared by the edge writer (GroundingWiringService) and the source-text readers — so the rule lives in exactly one place instead of being re-implemented (inconsistently) at each call site.

A grounding id is either the full node id (email:<user>:<hash>) or a namespace-stripped form (email:<hash>) that some extractors stamp. Implementations decide how tolerant resolution is; see DefaultGroundingResolver for the standard exact-then-namespace-suffix behaviour.

Callers that write an edge MUST use the resolved node's real NamedEntityData.id, not the grounding string, or a stripped id would MERGE-create a phantom bare {id} node.

Inheritors

Functions

Link copied to clipboard
abstract fun resolve(groundingId: String): <Error class: unknown class>?

Single best resolution: the exact match, else the unique match. Returns null when nothing matches OR the result is ambiguous (more than one node) — an ambiguous match is never silently collapsed to an arbitrary node.

Link copied to clipboard
abstract fun resolveAll(groundingId: String): List<<Error class: unknown class>>

Every entity groundingId resolves to. Empty when nothing matches. A proposition grounded in several sources legitimately resolves to several nodes, so this returns all of them.