pub struct AssetAspectGraph {
pub asset_id: String,
pub asset_kind: AssetKind,
pub spatial_anchor: Option<SpatialAnchorLite>,
pub temporal_aspects: Vec<TemporalAspect>,
pub topics: Vec<TopicAssociation>,
pub owner_did: Option<String>,
}Expand description
A sub-graph for an asset at a spatial location with multiple temporal assertions and topic/concept associations.
This is the core type for the “asset sub-graph” concept. Each asset gets its own sub-graph (identified by a context hash) that contains:
- A spatial anchor (where the asset is/was)
- Multiple temporal aspects (when different things happened to it)
- Topic/concept associations (what the asset is about)
- Graph Quins (the compiled semantic graph entries)
Example: A live recording at a venue might have:
- Spatial anchor: the venue’s geodetic position
- Temporal aspects:
- Production date (when the recording was made)
- Publication date (when it was released)
- Event date (when the live performance happened)
- Topic associations:
- “jazz music” isAbout “this recording”
- “Carnegie Hall” associatedWith “this recording”
Fields§
§asset_id: StringUnique asset identifier
asset_kind: AssetKindThe kind of asset
spatial_anchor: Option<SpatialAnchorLite>Optional spatial anchor (where the asset is/was)
temporal_aspects: Vec<TemporalAspect>Multiple temporal assertions about this asset
topics: Vec<TopicAssociation>Topic/concept associations
owner_did: Option<String>Optional owner DID
Implementations§
Source§impl AssetAspectGraph
impl AssetAspectGraph
Sourcepub fn with_spatial_anchor(self, anchor: SpatialAnchorLite) -> Self
pub fn with_spatial_anchor(self, anchor: SpatialAnchorLite) -> Self
Set the spatial anchor.
Sourcepub fn with_temporal_aspect(self, aspect: TemporalAspect) -> Self
pub fn with_temporal_aspect(self, aspect: TemporalAspect) -> Self
Add a temporal aspect.
Sourcepub fn with_topic(self, topic: TopicAssociation) -> Self
pub fn with_topic(self, topic: TopicAssociation) -> Self
Add a topic association.
Sourcepub fn with_owner(self, did: &str) -> Self
pub fn with_owner(self, did: &str) -> Self
Set the owner DID.
Sourcepub fn context_hash(&self) -> u64
pub fn context_hash(&self) -> u64
The context hash for this asset’s sub-graph. This is derived from the asset ID and kind, so the same asset always maps to the same sub-graph context.
Sourcepub fn asset_id_hash(&self) -> u64
pub fn asset_id_hash(&self) -> u64
The asset ID hash (used as the subject in graph Quins).
Sourcepub fn to_quins(&self) -> Vec<NQuin>
pub fn to_quins(&self) -> Vec<NQuin>
Compile the full sub-graph to Quins. Returns a vector of NQuins representing all temporal aspects and topic associations in this asset’s sub-graph.
Sourcepub fn aspects_of_kind(&self, kind: TemporalAspectKind) -> Vec<&TemporalAspect>
pub fn aspects_of_kind(&self, kind: TemporalAspectKind) -> Vec<&TemporalAspect>
Find all temporal aspects of a specific kind.
Sourcepub fn earliest_aspect(&self) -> Option<&TemporalAspect>
pub fn earliest_aspect(&self) -> Option<&TemporalAspect>
The earliest temporal aspect (by instant).
Sourcepub fn latest_aspect(&self) -> Option<&TemporalAspect>
pub fn latest_aspect(&self) -> Option<&TemporalAspect>
The latest temporal aspect (by instant).
Sourcepub fn temporal_span(&self) -> Option<DurationBridge>
pub fn temporal_span(&self) -> Option<DurationBridge>
The duration between the earliest and latest temporal aspects. Useful for computing the span between production and publication, etc.
Sourcepub fn topics_with_relation(&self, relation: &str) -> Vec<&TopicAssociation>
pub fn topics_with_relation(&self, relation: &str) -> Vec<&TopicAssociation>
Find all topics with a specific relation.
Sourcepub fn topics_about(&self, subject: &str) -> Vec<&TopicAssociation>
pub fn topics_about(&self, subject: &str) -> Vec<&TopicAssociation>
Find all topics about a specific subject.