pub struct KnowledgeGraph {
pub triples: Vec<Triple>,
pub shapes: Vec<ShaclShape>,
}Fields§
§triples: Vec<Triple>§shapes: Vec<ShaclShape>Implementations§
Source§impl KnowledgeGraph
impl KnowledgeGraph
pub fn new() -> Self
pub fn from_graph(graph: &Graph) -> Result<Self, KgError>
pub fn to_turtle(&self) -> String
Sourcepub fn from_turtle(turtle: &str) -> Result<Self, KgError>
pub fn from_turtle(turtle: &str) -> Result<Self, KgError>
Parse a simple Turtle snippet into a KnowledgeGraph. This is a best-effort parser
expecting the exact triple format generated by to_turtle() in this crate.
Sourcepub fn to_graph(&self) -> Result<Graph, KgError>
pub fn to_graph(&self) -> Result<Graph, KgError>
Convert the knowledge graph back into a Graph by interpreting triples exported by to_turtle.
pub fn validate_shacl(&self) -> Result<Vec<Violation>, KgError>
pub fn to_rdf_xml(&self) -> String
pub fn escape_turtle_literal(input: &str) -> String
pub fn escape_xml(input: &str) -> String
Trait Implementations§
Source§impl Clone for KnowledgeGraph
impl Clone for KnowledgeGraph
Source§fn clone(&self) -> KnowledgeGraph
fn clone(&self) -> KnowledgeGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KnowledgeGraph
impl Debug for KnowledgeGraph
Auto Trait Implementations§
impl Freeze for KnowledgeGraph
impl RefUnwindSafe for KnowledgeGraph
impl Send for KnowledgeGraph
impl Sync for KnowledgeGraph
impl Unpin for KnowledgeGraph
impl UnwindSafe for KnowledgeGraph
Blanket Implementations§
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
Mutably borrows from an owned value. Read more