GraphQuery

class GraphQuery(store: PropositionStore, contextId: <Error class: unknown class>? = null, maxDepth: Int = 5, authorityResolver: AuthorityResolver = StructuralAuthorityResolver())

Portable facade giving consumers a graph view over proposition data without requiring a graph backend.

Entity neighbourhoods and paths are derived store-agnostically from repeated 1-hop proposition queries: a proposition that mentions two resolved entities IS the edge between them. Proposition lineage is assembled from the proposition's own durable fields. When the wrapped store declares GraphQueryCapable, operations route to that native override instead; otherwise the portable default bodies run. Unscoped queries always route native; a context-scoped query routes native only when the store declares GraphQueryCapable.honorsContextFilter (so it confines the walk to the context itself) — otherwise it stays on the context-scoped portable path. Operations never throw for a missing capability — they degrade to empty/typed/null results.

Traversal is bounded by maxDepth and guarded by a visited set so cyclic data terminates.

Parameters

store

the backing proposition store

contextId

optional scope; when present, queries are confined to this context

maxDepth

hop ceiling for the default-body neighbourhood/path traversal; must be >= 1

Throws

if maxDepth is less than 1

Constructors

Link copied to clipboard
constructor(store: PropositionStore, contextId: <Error class: unknown class>? = null, maxDepth: Int = 5, authorityResolver: AuthorityResolver = StructuralAuthorityResolver())

Properties

Link copied to clipboard

Whether the wrapped store natively backs entity-axis graph queries.

Functions

Link copied to clipboard
fun neighborhood(entityId: String, depth: Int = 1, minAuthority: AuthorityTier? = null): GraphNeighborhood

The entity neighbourhood reachable from entityId within depth hops.

Link copied to clipboard
fun pathBetween(entityIdA: String, entityIdB: String, minAuthority: AuthorityTier? = null): List<GraphPath>

The paths connecting entityIdA to entityIdB; an empty list when none exists (never throws).

Link copied to clipboard
fun whyExplain(propositionId: String): PropositionLineage?

The lineage behind the proposition with the given id, or null if it does not exist.

Link copied to clipboard

Return a copy of this query with a different authority resolver.