Source Analysis Context
Base context for analyzing sources. Individual analyzers may extend this to require additional fields as needed.
Parameters
the schema to use for analysis
the entity resolver to use for entity disambiguation
optional list of known entities to assist with disambiguation and prompt context
optional collection of additional relation types beyond those defined in the schema
optional additional model data for analysis. Must be passed to any templated LLM prompts used.
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.
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.
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.
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.
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.
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
Types
Builder step: has context ID, needs entity resolver.
Builder step: has context ID and entity resolver, needs schema.
Properties
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.
Functions
Returns the context ID as a String for Java interop.
Returns a copy that says this analysis belongs to the given extraction run. EXPERIMENTAL.
Returns a copy with the specified known entities added.
Returns a copy whose minted entities carry the given base properties (e.g. ownership/scoping fields). See mintedEntityProperties.
Returns a copy allowing (or forbidding) this analysis to persist NEW entities for mentions the resolver could not match. See mintNewEntities.
Returns a copy carrying the given per-call extraction perspective, which overrides the extractor instance's default for this analysis only.
Returns a copy with the specified template model.
Returns a copy with the specified relations collection.
Returns a copy with the specified relations added.
Returns a copy that grounds this run's propositions in the given source.
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.