pub struct SpeciesCorpus {
pub context: String,
pub type_: String,
pub format: String,
pub corpus_iri: String,
pub taxon_concept_iri: String,
pub species_id: String,
pub revision: String,
pub sources: Vec<CorpusSource>,
pub assertions: Vec<EvidencedAssertion>,
pub gaps: Vec<KnowledgeGap>,
}Fields§
§context: String§type_: String§format: String§corpus_iri: String§taxon_concept_iri: String§species_id: String§revision: String§sources: Vec<CorpusSource>§assertions: Vec<EvidencedAssertion>§gaps: Vec<KnowledgeGap>Implementations§
Source§impl SpeciesCorpus
impl SpeciesCorpus
Sourcepub fn to_q42_graph(&self) -> Result<(HashMap<u64, String>, Vec<NQuin>), String>
pub fn to_q42_graph(&self) -> Result<(HashMap<u64, String>, Vec<NQuin>), String>
Lexicon and quins for the native .q42 representation, quins sorted by object.
Sourcepub fn from_q42_graph(
lex: &HashMap<u64, String>,
quins: &[NQuin],
) -> Result<Self, String>
pub fn from_q42_graph( lex: &HashMap<u64, String>, quins: &[NQuin], ) -> Result<Self, String>
Reconstructs and validates a SpeciesCorpus from an in-memory Q42 lexicon map and NQuin slice.
Sourcepub fn to_q42_bytes(&self) -> Result<Vec<u8>, String>
pub fn to_q42_bytes(&self) -> Result<Vec<u8>, String>
Encodes the corpus as a unified .q42 volume.
Sourcepub fn from_q42_bytes(bytes: &[u8]) -> Result<Self, String>
pub fn from_q42_bytes(bytes: &[u8]) -> Result<Self, String>
Decodes and validates a corpus from unified .q42 volume bytes.
Sourcepub fn from_q42_path(path: &Path) -> Result<Self, String>
pub fn from_q42_path(path: &Path) -> Result<Self, String>
Opens, verifies and decodes a corpus .q42 volume.
Sourcepub fn seal(&self) -> Result<SealedSpeciesCorpus, String>
pub fn seal(&self) -> Result<SealedSpeciesCorpus, String>
Native .q42 bytes, the CBOR-LD projection, the volume digest, and derived conflicts.
Conflicts stay in the volume as the disagreeing assertions; this also lists them.
Sourcepub fn to_cbor_ld(&self) -> Result<Vec<u8>, String>
pub fn to_cbor_ld(&self) -> Result<Vec<u8>, String>
CBOR-LD interchange projection (self-describe tag 55799).
Sourcepub fn from_cbor_ld(bytes: &[u8]) -> Result<Self, String>
pub fn from_cbor_ld(bytes: &[u8]) -> Result<Self, String>
Decodes and validates the CBOR-LD interchange projection.
Source§impl SpeciesCorpus
impl SpeciesCorpus
pub fn new( corpus_iri: &str, taxon_concept_iri: &str, species_id: &str, revision: &str, ) -> Self
Sourcepub fn from_json_value(value: Value) -> Result<Self, String>
pub fn from_json_value(value: Value) -> Result<Self, String>
Decodes a JSON-LD document of this shape and validates it.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Checks identity, unique ids, per-assertion evidence, source references and taxon binding.
Sourcepub fn facts(&self) -> Vec<CorpusFact<'_>>
pub fn facts(&self) -> Vec<CorpusFact<'_>>
Flattens every assertion into a fact a production reader can use without the evidence crate.
Sourcepub fn assertions_for<'a>(
&'a self,
property_iri: &'a str,
part_iri: Option<&'a str>,
) -> impl Iterator<Item = &'a EvidencedAssertion> + 'a
pub fn assertions_for<'a>( &'a self, property_iri: &'a str, part_iri: Option<&'a str>, ) -> impl Iterator<Item = &'a EvidencedAssertion> + 'a
Active assertions for property_iri, optionally restricted to a part.
Sourcepub fn conflicts(&self) -> Vec<CorpusConflict>
pub fn conflicts(&self) -> Vec<CorpusConflict>
Finds properties whose evidence-basis values disagree across independent root sources. Model assumptions, artistic choices and unknowns are not evidence and are excluded.
Trait Implementations§
Source§impl Clone for SpeciesCorpus
impl Clone for SpeciesCorpus
Source§impl Debug for SpeciesCorpus
impl Debug for SpeciesCorpus
Source§impl<'de> Deserialize<'de> for SpeciesCorpus
impl<'de> Deserialize<'de> for SpeciesCorpus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SpeciesCorpus
impl PartialEq for SpeciesCorpus
Source§impl Serialize for SpeciesCorpus
impl Serialize for SpeciesCorpus
impl StructuralPartialEq for SpeciesCorpus
Auto Trait Implementations§
impl Freeze for SpeciesCorpus
impl RefUnwindSafe for SpeciesCorpus
impl Send for SpeciesCorpus
impl Sync for SpeciesCorpus
impl Unpin for SpeciesCorpus
impl UnsafeUnpin for SpeciesCorpus
impl UnwindSafe for SpeciesCorpus
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more