Skip to main content

RDFNodeParse

Trait RDFNodeParse 

Source
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 implements FocusRDF

Required Associated Types§

Source

type Output

The type returned when parsing succeeds.

Required Methods§

Source

fn parse_focused(&self, rdf: &mut RDF) -> Result<Self::Output, RDFError>

The internal parsing implementation that operates on the current focus node.

This method performs the actual parsing logic without modifying which node is focused. It is called by parse after the focus has been set.

§Arguments
  • rdf - A mutable reference to the RDF graph with the focus already set

Provided Methods§

Source

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 parsing
  • rdf - The RDF graph data to parse

Implementors§

Source§

impl<RDF> RDFNodeParse<RDF> for BooleanParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for BoolsPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for FocusParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::Term

Source§

impl<RDF> RDFNodeParse<RDF> for HasTypeParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for InstancesParser<RDF>
where RDF: FocusRDF,

Source§

type Output = Vec<<RDF as Rdf>::Subject>

Source§

impl<RDF> RDFNodeParse<RDF> for IntegersPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for IriOrBlankNodeParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for IriParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::IRI

Source§

impl<RDF> RDFNodeParse<RDF> for IrisOrBnodesPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for IrisPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for IsIriParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for ListParser<RDF>
where RDF: FocusRDF,

Source§

type Output = Vec<<RDF as Rdf>::Term>

Source§

impl<RDF> RDFNodeParse<RDF> for LiteralParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::Literal

Source§

impl<RDF> RDFNodeParse<RDF> for LiteralsPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for NeighborhoodParser<RDF>
where RDF: FocusRDF,

Source§

type Output = HashMap<<RDF as Rdf>::IRI, HashSet<<RDF as Rdf>::Term>>

Source§

impl<RDF> RDFNodeParse<RDF> for NilParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for NonEmptyValuesPropertyParser<RDF>
where RDF: FocusRDF,

Source§

type Output = HashSet<<RDF as Rdf>::Term>

Source§

impl<RDF> RDFNodeParse<RDF> for ObjectParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for ObjectsPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SetFocusParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for ShaclPathParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SingleBoolPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SingleInstanceParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::Subject

Source§

impl<RDF> RDFNodeParse<RDF> for SingleIntegerPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SingleIriOrBlankNodePropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SingleIriPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SingleStringPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SingleValuePropertyAsListParser<RDF>
where RDF: FocusRDF + 'static,

Source§

type Output = Vec<<RDF as Rdf>::Term>

Source§

impl<RDF> RDFNodeParse<RDF> for SingleValuePropertyParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::Term

Source§

impl<RDF> RDFNodeParse<RDF> for StringsPropertyParser<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for SubjectsWithValuePropertyParser<RDF>
where RDF: FocusRDF,

Source§

type Output = Vec<<RDF as Rdf>::Subject>

Source§

impl<RDF> RDFNodeParse<RDF> for TermAsIri<RDF>
where RDF: FocusRDF,

Source§

impl<RDF> RDFNodeParse<RDF> for TermParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::Term

Source§

impl<RDF> RDFNodeParse<RDF> for TypeParser<RDF>
where RDF: FocusRDF,

Source§

type Output = <RDF as Rdf>::Term

Source§

impl<RDF> RDFNodeParse<RDF> for ValuesPropertyParser<RDF>
where RDF: FocusRDF,

Source§

type Output = HashSet<<RDF as Rdf>::Term>

Source§

impl<RDF, A> RDFNodeParse<RDF> for FailureParser<A>
where RDF: FocusRDF,

Source§

impl<RDF, A> RDFNodeParse<RDF> for SuccessParser<A>
where RDF: FocusRDF, A: Clone,

Source§

impl<RDF, A, B, P, Then, Else> RDFNodeParse<RDF> for IfThenElseParser<A, P, Then, Else>
where RDF: FocusRDF, P: Fn(&A) -> bool, Then: RDFNodeParse<RDF, Output = B>, Else: RDFNodeParse<RDF, Output = B>,

Source§

impl<RDF, A, F> RDFNodeParse<RDF> for ApplyRdfParser<RDF, F>
where RDF: FocusRDF, F: Fn(&mut RDF) -> Result<A, RDFError>,

Source§

impl<RDF, A, F, O> RDFNodeParse<RDF> for ApplyParser<A, F, O>
where RDF: FocusRDF, F: Fn(&A) -> Result<O, RDFError>,

Source§

impl<RDF, A, P> RDFNodeParse<RDF> for CondParser<A, P>
where RDF: FocusRDF, P: Fn(&A) -> bool,

Source§

impl<RDF, P> RDFNodeParse<RDF> for SatisfyParser<RDF, P>
where RDF: FocusRDF, P: Fn(&RDF::Term) -> bool,

Source§

impl<RDF, P, A> RDFNodeParse<RDF> for TypeDispatchParser<P>
where RDF: FocusRDF, P: RDFNodeParse<RDF, Output = A>,