#[non_exhaustive]pub struct ImportDocument {
pub id: String,
pub title: String,
pub body: String,
pub metadata: Value,
pub entity_hints: Vec<EntityRef>,
pub valid_from: Option<DateTime<Utc>>,
}Expand description
One document fetched from an ImportSource.
Wrapped as a Fact by KnowledgeIngestionPipeline::run: body
becomes Fact.text; entity_hints, valid_from, id, and title
land under reserved keys in Fact.metadata; caller-supplied
metadata is merged (pipeline writes reserved keys LAST, so they
overwrite any collision — callers MUST NOT use reserved key names).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringStable external identifier (Confluence page id, Jira key, file
hash, …). Persisted as Fact.metadata.import_source_id.
title: StringDisplay name. Persisted as Fact.metadata.title.
body: StringDocument body — becomes Fact.text.
metadata: ValueCaller-supplied opaque metadata. Merged with pipeline-reserved
keys (valid_from, entities, import_source_id, title).
entity_hints: Vec<EntityRef>Pre-known entities (Article, Obligation, etc. for DORA;
owners for Confluence pages, …). Persisted as
Fact.metadata.entities so GraphAwareLongTerm::remember
surfaces them via the extractor’s hint path.
valid_from: Option<DateTime<Utc>>When the document is valid in the world (regulation effective
date, contract start, …). Persisted as Fact.metadata.valid_from
in RFC-3339; GraphAwareLongTerm parses it back.
Implementations§
Source§impl ImportDocument
impl ImportDocument
Sourcepub fn new(
id: impl Into<String>,
title: impl Into<String>,
body: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, title: impl Into<String>, body: impl Into<String>, ) -> Self
Build a document from required fields. Optional fields use their
Default values; set them via the builder-style with_* methods.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Attach caller-supplied metadata (merged into Fact.metadata by
KnowledgeIngestionPipeline::run).
Sourcepub fn with_entity_hints(self, hints: Vec<EntityRef>) -> Self
pub fn with_entity_hints(self, hints: Vec<EntityRef>) -> Self
Pre-seed entities the extractor should treat as authoritative.
Sourcepub fn with_valid_from(self, valid_from: DateTime<Utc>) -> Self
pub fn with_valid_from(self, valid_from: DateTime<Utc>) -> Self
Bi-temporal valid_from (e.g. regulation effective date).
Trait Implementations§
Source§impl Clone for ImportDocument
impl Clone for ImportDocument
Source§fn clone(&self) -> ImportDocument
fn clone(&self) -> ImportDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more