pub struct ContentStore { /* private fields */ }Expand description
Wraps Oxigraph Store, providing named-graph-aware RDF operations.
No other crate should import oxigraph directly.
Implementations§
Source§impl ContentStore
impl ContentStore
Sourcepub fn insert_triple_into(
&self,
subject: &str,
predicate: &str,
object: &ObjectValue,
graph: &str,
) -> Result<(), Box<dyn Error>>
pub fn insert_triple_into( &self, subject: &str, predicate: &str, object: &ObjectValue, graph: &str, ) -> Result<(), Box<dyn Error>>
Insert a triple into the specified named graph.
Sourcepub fn query_to_json(&self, sparql: &str) -> Result<Value, Box<dyn Error>>
pub fn query_to_json(&self, sparql: &str) -> Result<Value, Box<dyn Error>>
Execute a SPARQL SELECT or ASK query and return results as JSON.
Sourcepub fn load_turtle(&self, path: &Utf8Path) -> Result<(), Box<dyn Error>>
pub fn load_turtle(&self, path: &Utf8Path) -> Result<(), Box<dyn Error>>
Load a Turtle (.ttl) file into the default graph.
Sourcepub fn load_turtle_into(
&self,
path: &Utf8Path,
graph: &str,
) -> Result<(), Box<dyn Error>>
pub fn load_turtle_into( &self, path: &Utf8Path, graph: &str, ) -> Result<(), Box<dyn Error>>
Load a Turtle (.ttl) file into a specific named graph.
Sourcepub fn export_search_ntriples(&self) -> Result<String, Box<dyn Error>>
pub fn export_search_ntriples(&self) -> Result<String, Box<dyn Error>>
Export all triples as N-Triples for client-side SPARQL search.
Includes every triple from every named graph so that custom RDF
properties (from [rdf.custom] frontmatter) are queryable in the
browser alongside standard schema.org fields.
Sourcepub fn export_partitioned_ntriples(
&self,
partition_fn: &dyn Fn(&str) -> Option<String>,
) -> Result<HashMap<String, String>, Box<dyn Error>>
pub fn export_partitioned_ntriples( &self, partition_fn: &dyn Fn(&str) -> Option<String>, ) -> Result<HashMap<String, String>, Box<dyn Error>>
Export triples grouped by a partition function.
The partition_fn receives (graph_name) and returns an optional partition key.
Triples whose graph returns None go into the empty-key bucket (main search.nt).
The design tokens graph always partitions to "design-tokens".
Trait Implementations§
Source§impl Clone for ContentStore
impl Clone for ContentStore
Source§fn clone(&self) -> ContentStore
fn clone(&self) -> ContentStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more