pub trait RDFNodeParse<RDF>where
RDF: FocusRDF,{
type Output;
// Required method
fn parse_focused(&self, rdf: &mut RDF) -> Result<Self::Output, RDFError>;
// Provided method
fn parse(
&self,
node: &IriS,
rdf: &mut RDF,
) -> Result<Self::Output, RDFError> { ... }
}Expand description
A trait for parsing RDF data.
Types implementing RDFNodeParse can parse RDF graphs that maintain a focus node,
which represents the current node being examined during parsing. The RDF data structure
must implement the FocusRDF trait to support focus node operations.
This trait provides a combinator-based parsing API inspired by parser combinator libraries, allowing complex parsers to be built by composing simpler ones.
§Type Parameters
RDF- The RDF data structure type that implementsFocusRDF
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn parse(&self, node: &IriS, rdf: &mut RDF) -> Result<Self::Output, RDFError>
fn parse(&self, node: &IriS, rdf: &mut RDF) -> Result<Self::Output, RDFError>
Parses RDF data starting from the specified node.
This is the main entry point for parsing. It sets the focus node of the RDF graph
to node and then runs the parser implementation.
§Arguments
node- The IRI of the node to set as the focus before parsingrdf- The RDF graph data to parse