SourceAnalysisContext

data class SourceAnalysisContext constructor(val schema: <Error class: unknown class>, val entityResolver: EntityResolver, val contextId: <Error class: unknown class>, val knownEntities: List<KnownEntity> = emptyList(), val relations: Relations = Relations.empty(), val promptVariables: Map<String, Any> = emptyMap(), val sourceLocator: SourceLocator? = null, val perspective: ExtractionPerspective? = null, val mintNewEntities: Boolean = false, val mintedEntityProperties: Map<String, Any> = emptyMap(), val sourceRevision: SourceRevisionRef? = null, val profile: ExtractionContentProfileRef? = null, val currentRun: ExtractionRunRef? = null)

Base context for analyzing sources. Individual analyzers may extend this to require additional fields as needed.

Parameters

schema

the schema to use for analysis

entityResolver

the entity resolver to use for entity disambiguation

knownEntities

optional list of known entities to assist with disambiguation and prompt context

relations

optional collection of additional relation types beyond those defined in the schema

promptVariables

optional additional model data for analysis. Must be passed to any templated LLM prompts used.

perspective

optional per-call extraction perspective. When set it overrides the extractor instance's default perspective for this analysis only (see ExtractionPerspective). null (the default) means "use the extractor's own perspective" — zero behaviour change.

sourceLocator

optional pointer to where this run's material lives. When set, the pipeline stamps it onto every extracted proposition's provenance, so a caller that knows the real source (a file, a URI, a connector record) gets richer grounding than the content-hash fallback.

sourceRevision

optional revision of sourceLocator — the provider's own identifier for the version of that source this run reads. Setting it requires a sourceLocator whose key it matches, so a revision can never name a source the run is not actually reading.

profile

optional extraction content profile the host wants this analysis attributed to. EXPERIMENTAL. DICE carries the reference and nothing else — it selects no provider, model, or credential, and no DICE code reads policy out of it. The host authorizes the profile and binds it to whatever it means. null (the default) is the whole of the existing behaviour. Independent of perspective, schema and contextId: setting one never constrains another.

currentRun

optional reference to the extraction run this analysis belongs to. EXPERIMENTAL, and unlike profile this one is read. An analysis carrying a run has its structural wiring, graph projection and grounding run over the propositions the repository returned rather than the ones extraction minted — the two differ whenever the backend deduplicates, and the returned ones are what is actually stored — and, where the host configured a PropositionRunLinkStore, each stored proposition is attributed to this run. null (the default) means the analysis is attributed to no run and behaves exactly as it did before extraction runs existed.

mintNewEntities

whether a mention the resolver could NOT match to an existing entity may be persisted as a NEW entity node. Default FALSE: unresolved mentions stay unresolved (the proposition is still persisted; its mention simply carries no resolvedId), so extraction never creates phantom "mentioned in proposition" nodes for things the graph doesn't know — a term the user merely asked about must not become an entity. Opt in per ingestion for sources whose mentions deserve nodes.

Constructors

Link copied to clipboard
constructor(schema: <Error class: unknown class>, entityResolver: EntityResolver, contextId: <Error class: unknown class>, knownEntities: List<KnownEntity> = emptyList(), relations: Relations = Relations.empty(), promptVariables: Map<String, Any> = emptyMap(), sourceLocator: SourceLocator? = null, perspective: ExtractionPerspective? = null, mintNewEntities: Boolean = false, mintedEntityProperties: Map<String, Any> = emptyMap(), sourceRevision: SourceRevisionRef? = null, profile: ExtractionContentProfileRef? = null, currentRun: ExtractionRunRef? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Builder step: has context ID, needs entity resolver.

Link copied to clipboard

Builder step: has context ID and entity resolver, needs schema.

Properties

Link copied to clipboard
val contextId: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Base properties stamped onto every entity MINTED by this analysis (no-op when mintNewEntities is false). The caller knows things the pipeline does not — e.g. ownership/scoping properties a multi-tenant deployment requires on new nodes for them to be visible to scoped queries. Stamped values win over extractor-supplied properties of the same key.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val schema: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the context ID as a String for Java interop.

Link copied to clipboard

Returns a copy that says this analysis belongs to the given extraction run. EXPERIMENTAL.

Link copied to clipboard

Returns a copy with the specified known entities added.

Link copied to clipboard

Returns a copy whose minted entities carry the given base properties (e.g. ownership/scoping fields). See mintedEntityProperties.

Link copied to clipboard

Returns a copy allowing (or forbidding) this analysis to persist NEW entities for mentions the resolver could not match. See mintNewEntities.

Link copied to clipboard

Returns a copy carrying the given per-call extraction perspective, which overrides the extractor instance's default for this analysis only.

Link copied to clipboard

Returns a copy attributed to the given extraction content profile. EXPERIMENTAL. Changes no other field and no extraction behaviour — see profile.

Link copied to clipboard

Returns a copy with the specified template model.

Link copied to clipboard

Returns a copy with the specified relations collection.

Returns a copy with the specified relations added.

Link copied to clipboard

Returns a copy that grounds this run's propositions in the given source.

Link copied to clipboard

Returns a copy carrying a revision of this context's source. Throws if this context has no locator, or if the revision names a different source key.