Sources

The SourceRef type provides source attribution for events.

Creating Source References

use spatial_narrative::core::{SourceRef, SourceType};

let source = SourceRef::builder()
    .title("The New York Times")
    .source_type(SourceType::Article)
    .url("https://nytimes.com/article/123")
    .author("Jane Reporter")
    .date("2024-01-15")
    .build();

Source Types

TypeDescription
ArticleNews article or blog post
ReportOfficial report or document
WitnessEyewitness account
SensorAutomated sensor data
ArchiveHistorical archive
OtherOther source type

Properties

PropertyTypeDescription
source_typeSourceTypeCategory of source
titleOption<String>Source title
urlOption<String>URL reference
authorOption<String>Author/creator
dateOption<String>Publication date
notesOption<String>Additional notes

Examples

News Article

let source = SourceRef::builder()
    .source_type(SourceType::Article)
    .title("Breaking: Event Occurs")
    .url("https://news.example.com/article")
    .author("John Journalist")
    .date("2024-01-15")
    .build();

Sensor Data

let source = SourceRef::builder()
    .source_type(SourceType::Sensor)
    .title("Weather Station #42")
    .notes("Automated reading every 5 minutes")
    .build();

Historical Archive

let source = SourceRef::builder()
    .source_type(SourceType::Archive)
    .title("National Archives Collection")
    .url("https://archives.gov/document/123")
    .notes("Declassified 2020")
    .build();