Skip to main content

Crate purrdf_core

Crate purrdf_core 

Source
Expand description

purrdf-core – oxigraph-free, PyO3-free RDF 1.2 kernel for the PurRDF Rust workspace.

This crate is the ring-fenced core (purrdf P2b) extracted out of purrdf: the immutable value-interned IR, the owned value model, structured diagnostics, dataset capability flags, the loss ledger, and provenance. It models RDF 1.2 terms directly, preserves source/location context where adapters can provide it, and keeps reporting structured but SARIF-free. The oxigraph adapters and the PyO3 extension surface live in the sibling purrdf crate; nothing here may pull oxigraph — that is the acceptance gate.

§no_std readiness

The immutable IR (ir) is the kernel’s purest layer and is file-IO-free (no std::fs/std::io), the first prerequisite for an eventual alloc-only no_std core for embedded / C-ABI consumers. The remaining blocker is the interner’s std::collections::{HashMap, HashSet} (not in alloc); migrating it to hashbrown is tracked as P3c. New IR code therefore prefers core::/alloc:: over std:: where the item exists in both (e.g. core::fmt, alloc::sync::Arc) so the eventual #![no_std] flip stays mechanical. Per the purrdf plan, no_std is for embedded/C-ABI targets and is not a WASM prerequisite. Common types are re-exported from prelude.

Re-exports§

pub use backend::RdfParseRequest;
pub use backend::RdfParserBackend;
pub use backend::RdfSerializeRequest;
pub use backend::RdfSerializer;
pub use backend::SerializeGraph;
pub use backend::SparqlEngine;
pub use backend::SparqlRequest;
pub use backend::SparqlResult;
pub use backend::TermFactory;
pub use bundle::ArtifactIndex;
pub use bundle::ArtifactRecord;
pub use bundle::BundleError;
pub use bundle::RdfBundle;
pub use bundle::SegmentUnitMap;
pub use bundle::UnitCatalog;
pub use bundle::UnitMetadata;
pub use collections::RdfListError;
pub use content_id::Blake3ContentId;
pub use content_id::ContentIdScheme;
pub use content_store::Bytes;
pub use content_store::ContentDigest;
pub use content_store::ContentStore;
pub use content_store::ContentStoreError;
pub use dataset_view::DatasetMut;
pub use dataset_view::DatasetView;
pub use dataset_view::GraphMatch;
pub use dataset_view::GraphMatchValue;
pub use dataset_view::ViewTermId;
pub use describe::Describer;
pub use describe::describe;
pub use diagnostic::RdfDiagnostic;
pub use diagnostic::RdfLocation;
pub use diagnostic::RdfLoss;
pub use diagnostic::RdfSeverity;
pub use fno::FnFunction;
pub use fno::FnImpl;
pub use fno::FnMapping;
pub use fno::FnOutput;
pub use fno::FnParam;
pub use fno::FnParamMapping;
pub use fno::FnReturnMapping;
pub use fno::FnoCatalog;
pub use fno::to_ntriples as fno_to_ntriples;
pub use fno::to_quads as fno_to_quads;
pub use hash::FastHasher;
pub use hash::FastMap;
pub use hash::FastSet;
pub use hash::IdSet;
pub use ir::BlankScope;
pub use ir::BudgetExceeded;
pub use ir::CanonHash;
pub use ir::Canonicalized;
pub use ir::CountingDemandProvider;
pub use ir::DatasetDiff;
pub use ir::DatasetSink;
pub use ir::FrozenDatasetSource;
pub use ir::GlobalDictionary;
pub use ir::GlobalTermId;
pub use ir::GtsBundle;
pub use ir::HandleEntry;
pub use ir::HandleKey;
pub use ir::InMemoryPageProvider;
pub use ir::MutableDataset;
pub use ir::PageFault;
pub use ir::PageId;
pub use ir::PagePart;
pub use ir::PageProvider;
pub use ir::PageTranslation;
pub use ir::PagedDataset;
pub use ir::PagedFreezeError;
pub use ir::PagedQuadOverlap;
pub use ir::PagedQuadTable;
pub use ir::PipelineBundle;
pub use ir::PipelineBundleError;
pub use ir::QuadHandle;
pub use ir::QuadIds;
pub use ir::QuadPatternCursor;
pub use ir::QuadProbePlan;
pub use ir::QuadRef;
pub use ir::QuadValues;
pub use ir::RdfDataset;
pub use ir::RdfDatasetBuilder;
pub use ir::RdfDatasetVisitor;
pub use ir::RdfEnvelope;
pub use ir::SubsetPageProvider;
pub use ir::TermId;
pub use ir::TermRef;
pub use ir::TermValue;
pub use ir::ValidatedRdfDatasetBuilder;
pub use ir::canonicalize;
pub use ir::canonicalize_with;
pub use ir::dataset_diff;
pub use ir::datasets_isomorphic;
pub use ir::try_canonicalize;
pub use ir::try_canonicalize_with;
pub use lookaside::RdfBlobOrigin;
pub use lookaside::RdfBlobRecord;
pub use lookaside::RdfLookaside;
pub use lookaside::RdfLookasideKind;
pub use lookaside::RdfLookasideResource;
pub use lookaside::RdfMetadataEntry;
pub use lookaside::RdfMetadataValue;
pub use lookaside::RdfOpaqueNodeRecord;
pub use lookaside::RdfSegmentRecord;
pub use lookaside::RdfSignatureRecord;
pub use lookaside::RdfSuppressionRecord;
pub use loss::LossEntry;
pub use loss::LossLedger;
pub use loss::PROJECTION_CODECS;
pub use loss::gts_to_rdf_loss_ledger;
pub use loss::loss_matrix_json;
pub use loss::pair_loss_ledger;
pub use loss::rdf_to_gts_loss_ledger;
pub use loss::transcode_loss_matrix_json;
pub use model::RdfAnnotation;
pub use model::RdfLiteral;
pub use model::RdfQuad;
pub use model::RdfReifier;
pub use model::RdfTerm;
pub use model::RdfTermKind;
pub use model::RdfTextDirection;
pub use model::RdfTriple;
pub use provenance::ArtifactId;
pub use provenance::ArtifactInterner;
pub use provenance::AssertionOccurrence;
pub use provenance::Attribution;
pub use provenance::AttributionRole;
pub use provenance::DatasetProvenance;
pub use provenance::OriginKind;
pub use provenance::OriginSetId;
pub use provenance::OriginSetInterner;
pub use provenance::ProvenanceError;
pub use provenance::UnitId;
pub use provenance::UnitInterner;
pub use provenance::check_provenance;
pub use small::IdVec;
pub use sssom::SSSOM_DEFAULT_VALIDATION_TYPES;
pub use sssom::SssomDiagnostic;
pub use sssom::SssomMapping;
pub use sssom::SssomMappingSet;
pub use sssom::SssomMeta;
pub use store::RdfStoreCapabilities;
pub use turtle::emit_annotation;
pub use turtle::emit_quad;
pub use turtle::emit_reifier;
pub use turtle::emit_resource;
pub use turtle::emit_term;
pub use turtle::rule_iri;
pub use turtle::write_dataset_annotation;
pub use turtle::write_dataset_quad;
pub use turtle::write_dataset_reifier;
pub use turtle::write_dataset_term;
pub use turtle_render::render as render_canonical_turtle;

Modules§

backend
Narrow purrdf backend traits (P2d).
bundle
The self-describing bundle resource layer (S3).
collections
RDF Collection (rdf:first/rdf:rest/rdf:nil) and Container (rdf:Seq/rdf:Bag/rdf:Alt with rdf:_1, rdf:_2, …) traversal over a DatasetView.
content_id
The BLAKE3 GTS content-id domain: blake3:<hex> term references.
content_store
Content-addressed blob store for the self-describing bundle (S3).
dataset_view
The static, allocation-free read view over an RDF dataset (purrdf P2, ). See docs/design/purrdf-backend-contract.md.
describe
Per-subject subgraph extraction — the Symmetric Concise Bounded Description (SCBD) of a resource.
diagnostic
Structured diagnostics: severity, source/GTS locations, conversion losses, and the RdfDiagnostic record callers translate to their reporting layer.
fno
Native FnO (W3C Function Ontology) typed model + serializer.
hash
The workspace’s single, fixed-key hashing policy for in-memory lookup tables.
ir
The immutable, value-interned RDF 1.2 dataset IR (C1).
lookaside
Structured non-triple material (RdfLookaside) that travels with an RDF store: typed sidecar resources, metadata entries, segment/blob records, suppressions, opaque nodes, and signature records.
loss
The machine-readable RDF↔GTS loss ledger (C0).
model
The owned RDF 1.2 value model: terms, literals (including base-direction literals), triples, quads, reifiers, and statement annotations.
prelude
The common purrdf-core surface, for use purrdf_core::prelude::*;.
provenance
Generic provenance sidecar for the immutable RDF 1.2 dataset (S2).
small
Shared small-vector primitives for the workspace’s hot, short-lived id rows.
sssom
Native SSSOM (Simple Standard for Sharing Ontology Mappings) codec.
store
Dataset/import capability flags (RdfStoreCapabilities).
turtle
Native RDF 1.2 Turtle emitter for crate::store stores.
turtle_render
The canonical, review-friendly Turtle renderer over the purrdf IR — the oxigraph-free half of the on-disk normalizer.

Macros§

smallvec
Creates a SmallVec containing the arguments.

Structs§

SmallVec
A Vec-like container that can store a small number of elements inline.