Missing origin url in 2023-09-07 dataset
use anyhow::{Context, Result};
use bitvec::prelude::*;
use dsi_progress_logger::ProgressLogger;
use log::{debug, info};
use std::collections::VecDeque;
use std::path::PathBuf;
use swh_graph::graph::*;
use swh_graph::java_compat::mph::gov::GOVMPH;
const BASENAME: &str = "/dev/shm/vlorentz/default/graph";
// const BASENAME: &str = "/home/zack/graph/2022-12-07/compressed/graph";
pub fn main() -> Result<()> {
// Setup a stderr logger because ProgressLogger uses the `log` crate
// to printout
stderrlog::new()
.verbosity(3)
.timestamp(stderrlog::Timestamp::Second)
.init()
.unwrap();
let graph = load_unidirectional(PathBuf::from(BASENAME))
.context("Could not load graph")?
.init_properties()
.load_properties(|properties| properties.load_maps::<GOVMPH>())
.context("Could not load maps properties")?
.load_properties(|properties| properties.load_strings())
.context("Could not load strings properties")?;
let swhid = "swh:1:ori:3876059a87b12ed0bfec1f3f7fb684a9e1287547";
info!("looking up SWHID {swhid} ...");
let node_id = graph.properties().node_id(swhid).expect("Unknown SWHID");
info!("obtained node ID {node_id} ...");
let url = graph.properties().message_base64(node_id).expect("no message");
info!("obtained URL {url:?}");
Ok(())
}
errors with:
2024-01-24T10:46:38+00:00 - INFO - looking up SWHID swh:1:ori:3876059a87b12ed0bfec1f3f7fb684a9e1287547 ...
2024-01-24T10:46:38+00:00 - INFO - obtained node ID 29126529879 ...
thread 'main' panicked at rust/examples/origin.rs:40:58:
no message```