pub struct Rudof { /* private fields */ }
Expand description
This represents the public API to interact with rudof
Implementations§
Source§impl Rudof
impl Rudof
pub fn new(config: &RudofConfig) -> Rudof
pub fn config(&self) -> &RudofConfig
pub fn update_config(&mut self, config: &RudofConfig)
Sourcepub fn reset_data(&mut self)
pub fn reset_data(&mut self)
Resets the current RDF Data
Sourcepub fn reset_dctap(&mut self)
pub fn reset_dctap(&mut self)
Resets the current DCTAP
Sourcepub fn reset_shacl(&mut self)
pub fn reset_shacl(&mut self)
Resets the current SHACL shapes graph
Sourcepub fn get_shacl_from_data(&mut self) -> Result<()>
pub fn get_shacl_from_data(&mut self) -> Result<()>
Get the shapes graph schema from the current RDF data
Sourcepub fn get_shacl(&self) -> Option<&ShaclSchema>
pub fn get_shacl(&self) -> Option<&ShaclSchema>
Get the current SHACL
Sourcepub fn get_shex(&self) -> Option<&ShExSchema>
pub fn get_shex(&self) -> Option<&ShExSchema>
Get the current ShEx Schema
Sourcepub fn get_shapemap(&self) -> Option<&QueryShapeMap>
pub fn get_shapemap(&self) -> Option<&QueryShapeMap>
Get the current shapemap
Sourcepub fn dctap2shex(&mut self) -> Result<()>
pub fn dctap2shex(&mut self) -> Result<()>
Converts the current DCTAP to a ShExSchema Stores the value of the ShExSchema in the current shex
Sourcepub fn shex2plant_uml<W: Write>(
&self,
mode: &UmlGenerationMode,
writer: &mut W,
) -> Result<()>
pub fn shex2plant_uml<W: Write>( &self, mode: &UmlGenerationMode, writer: &mut W, ) -> Result<()>
Generate a UML Class-like representation of a ShEx schema according to PlantUML syntax
pub fn serialize_data<W: Write>( &self, format: &RDFFormat, writer: &mut W, ) -> Result<()>
Sourcepub fn serialize_shapemap<W: Write>(
&self,
format: &ShapeMapFormat,
formatter: &ShapeMapFormatter,
writer: &mut W,
) -> Result<()>
pub fn serialize_shapemap<W: Write>( &self, format: &ShapeMapFormat, formatter: &ShapeMapFormatter, writer: &mut W, ) -> Result<()>
Serialize the current ShapeMap
Sourcepub fn serialize_shex<W: Write>(
&self,
format: &ShExFormat,
formatter: &ShExFormatter,
writer: &mut W,
) -> Result<()>
pub fn serialize_shex<W: Write>( &self, format: &ShExFormat, formatter: &ShExFormatter, writer: &mut W, ) -> Result<()>
Serialize the current ShEx Schema
pub fn run_query_str(&mut self, str: &str) -> Result<QuerySolutions<RdfData>>
pub fn run_query<R: Read>( &mut self, reader: &mut R, ) -> Result<QuerySolutions<RdfData>>
pub fn serialize_shacl<W: Write>( &self, format: &ShaclFormat, writer: &mut W, ) -> Result<()>
Sourcepub fn reset_validation_results(&mut self)
pub fn reset_validation_results(&mut self)
Resets the current ShEx validation results The action is necessary to start a fresh validation
Sourcepub fn reset_shex(&mut self)
pub fn reset_shex(&mut self)
Resets the current validator This operation removes the current shex_schema
Sourcepub fn read_shacl<R: Read>(
&mut self,
reader: R,
format: &ShaclFormat,
base: Option<&str>,
reader_mode: &ReaderMode,
) -> Result<()>
pub fn read_shacl<R: Read>( &mut self, reader: R, format: &ShaclFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<()>
Reads a SHACL schema from a reader
base
is used to resolve relative IRIsformat
indicates the Shacl format
Sourcepub fn read_dctap<R: Read>(
&mut self,
reader: R,
format: &DCTAPFormat,
) -> Result<()>
pub fn read_dctap<R: Read>( &mut self, reader: R, format: &DCTAPFormat, ) -> Result<()>
Reads a DCTAP
and replaces the current one
format
indicates the DCTAP format
Sourcepub fn read_dctap_path<P: AsRef<Path>>(
&mut self,
path: P,
format: &DCTAPFormat,
) -> Result<()>
pub fn read_dctap_path<P: AsRef<Path>>( &mut self, path: P, format: &DCTAPFormat, ) -> Result<()>
Reads a DCTAP
and replaces the current one
format
indicates the DCTAP format
Sourcepub fn read_shex<R: Read>(
&mut self,
reader: R,
format: &ShExFormat,
base: Option<&str>,
) -> Result<()>
pub fn read_shex<R: Read>( &mut self, reader: R, format: &ShExFormat, base: Option<&str>, ) -> Result<()>
Reads a ShExSchema
and replaces the current one
It also updates the current ShEx validator with the new ShExSchema
base
is used to resolve relative IRIsformat
indicates the ShEx format according toShExFormat
Sourcepub fn validate_shacl(
&mut self,
mode: &ShaclValidationMode,
shapes_graph_source: &ShapesGraphSource,
) -> Result<ValidationReport>
pub fn validate_shacl( &mut self, mode: &ShaclValidationMode, shapes_graph_source: &ShapesGraphSource, ) -> Result<ValidationReport>
Validate RDF data using SHACL
mode: Indicates whether to use SPARQL or native Rust implementation shapes_graph_source: Indicates the source of the shapes graph, which can be extracted from the current RDF data, or from the current SHACL schema. If there is no current SHACL schema, it tries to get it from the current RDF data
Sourcepub fn validate_shex(&mut self) -> Result<ResultShapeMap>
pub fn validate_shex(&mut self) -> Result<ResultShapeMap>
Validate RDF data using ShEx It uses a ShEx validator which is current ShEx schema and the current ShapeMap that should
Sourcepub fn add_endpoint(&mut self, iri: &IriS, prefixmap: &PrefixMap) -> Result<()>
pub fn add_endpoint(&mut self, iri: &IriS, prefixmap: &PrefixMap) -> Result<()>
Adds an endpoint to the current RDF data
Sourcepub fn read_data<R: Read>(
&mut self,
reader: R,
format: &RDFFormat,
base: Option<&str>,
reader_mode: &ReaderMode,
) -> Result<()>
pub fn read_data<R: Read>( &mut self, reader: R, format: &RDFFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<()>
Parses an RDF graph from a reader and merges it with the current graph
Sourcepub fn clean_rdf_graph(&mut self)
pub fn clean_rdf_graph(&mut self)
Cleans the in-memory graph
Sourcepub fn shapemap_add_node_shape_selectors(
&mut self,
node: NodeSelector,
shape: ShapeSelector,
)
pub fn shapemap_add_node_shape_selectors( &mut self, node: NodeSelector, shape: ShapeSelector, )
Add a pair of node selector and shape selector to the current shapemap
Sourcepub fn read_shapemap<R: Read>(
&mut self,
reader: R,
shapemap_format: &ShapeMapFormat,
) -> Result<()>
pub fn read_shapemap<R: Read>( &mut self, reader: R, shapemap_format: &ShapeMapFormat, ) -> Result<()>
Read a shapemap
pub fn reset_shapemap(&mut self)
Sourcepub fn nodes_prefixmap(&self) -> PrefixMap
pub fn nodes_prefixmap(&self) -> PrefixMap
Returns the RDF data prefixmap
Sourcepub fn shex_shapes_prefixmap(&self) -> Option<PrefixMap>
pub fn shex_shapes_prefixmap(&self) -> Option<PrefixMap>
Returns the shapes prefixmap
If no ShEx schema has been set, returns None
Sourcepub fn get_rdf_data(&self) -> &RdfData
pub fn get_rdf_data(&self) -> &RdfData
Get current RDF Data
Sourcepub fn shex_schema_without_imports(&mut self) -> Result<SchemaWithoutImports>
pub fn shex_schema_without_imports(&mut self) -> Result<SchemaWithoutImports>
Obtains the current shex_schema
after resolving import declarations
If the import declarations in the current schema have not been resolved, it resolves them
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rudof
impl !RefUnwindSafe for Rudof
impl !Sync for Rudof
impl Unpin for Rudof
impl !UnwindSafe for Rudof
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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