Skip to main content

Data

Struct Data 

Source
pub struct Data {
Show 23 fields pub id: Uuid, pub name: String, pub raw_data_location: String, pub original_data_location: String, pub extension: String, pub mime_type: String, pub content_hash: String, pub owner_id: Uuid, pub created_at: DateTime<Utc>, pub updated_at: Option<DateTime<Utc>>, pub label: Option<String>, pub original_extension: Option<String>, pub original_mime_type: Option<String>, pub loader_engine: Option<String>, pub raw_content_hash: Option<String>, pub tenant_id: Option<Uuid>, pub external_metadata: Option<String>, pub node_set: Option<String>, pub pipeline_status: Option<String>, pub token_count: i64, pub data_size: i64, pub last_accessed: Option<DateTime<Utc>>, pub importance_weight: Option<f64>,
}
Expand description

Represents a piece of data in the system, such as a file or a text. Fields match the Python cognee data table schema for cross-SDK compatibility.

Fields§

§id: Uuid

Unique identifier for this data record (UUID v5, deterministic from content hash)

§name: String

Display name derived from the source (filename, URL, or text_<md5>.txt for inline text)

§raw_data_location: String

file:// URI pointing to the stored raw content in the file storage backend

§original_data_location: String

Original source location before any processing (file path, URL, or same as raw_data_location for inline text)

§extension: String

File extension of the stored content (e.g. “txt”, “pdf”, “html”)

§mime_type: String

MIME type of the stored content (e.g. “text/plain”, “application/pdf”)

§content_hash: String

MD5 hex digest of the raw content bytes (content-only, no owner mixing)

§owner_id: Uuid

ID of the user or agent that owns this data record

§created_at: DateTime<Utc>

Timestamp when this record was first created

§updated_at: Option<DateTime<Utc>>

Timestamp of the last update to this record, if any

§label: Option<String>

Human-readable label for the data item (from DataItem wrapper or user-provided)

§original_extension: Option<String>

Original file extension before any conversion

§original_mime_type: Option<String>

Original MIME type before any conversion

§loader_engine: Option<String>

Python loader engine name (e.g. “text_loader”, “pypdf_loader”)

§raw_content_hash: Option<String>

MD5 hash of the extracted-text file stored by the loader at ADD time (Python parity, ingest_data.py:195). Equals content_hash only when the extracted text is byte-identical to the raw input (plain text); for inputs the loader transforms (PDF, CSV, HTML, image, audio) the two hashes differ.

§tenant_id: Option<Uuid>

Tenant/organisation ID for multi-tenant isolation

§external_metadata: Option<String>

Arbitrary JSON metadata blob

§node_set: Option<String>

JSON list of node IDs associated with this data item

§pipeline_status: Option<String>

Pipeline processing status

§token_count: i64

Token count of the data (-1 = not yet computed)

§data_size: i64

Size of the data in bytes (-1 = not yet computed)

§last_accessed: Option<DateTime<Utc>>

Last access timestamp

§importance_weight: Option<f64>

Importance weight for ranking (0.0 to 1.0). Influences relevance scoring.

Implementations§

Source§

impl Data

Source

pub fn builder( id: Uuid, name: impl Into<String>, raw_data_location: impl Into<String>, original_data_location: impl Into<String>, extension: impl Into<String>, mime_type: impl Into<String>, content_hash: impl Into<String>, owner_id: Uuid, ) -> DataBuilder

Start building a new Data record with the required fields. All optional fields default to None; data_size defaults to -1.

Trait Implementations§

Source§

impl Clone for Data

Source§

fn clone(&self) -> Data

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Data

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Data

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Data

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Data

§

impl RefUnwindSafe for Data

§

impl Send for Data

§

impl Sync for Data

§

impl Unpin for Data

§

impl UnsafeUnpin for Data

§

impl UnwindSafe for Data

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.