pub trait RdfStarParser {
// Required methods
fn parse_embedded_triple(
&mut self,
input: &[u8],
) -> Result<(u64, [u64; 3]), RdfStarParseError>;
fn parse_triple(
&mut self,
input: &[u8],
) -> Result<(u64, u64, u64), RdfStarParseError>;
fn parse_quad(
&mut self,
input: &[u8],
) -> Result<(u64, u64, u64, u64), RdfStarParseError>;
fn supports_quads(&self) -> bool;
fn supports_named_graphs(&self) -> bool;
fn format_name(&self) -> &'static str;
}Expand description
Trait for RDF-Star parsers across multiple formats
All parsers must implement this trait to ensure consistent conversion from format-specific syntax to Virtual IDs.
Required Methods§
Sourcefn parse_embedded_triple(
&mut self,
input: &[u8],
) -> Result<(u64, [u64; 3]), RdfStarParseError>
fn parse_embedded_triple( &mut self, input: &[u8], ) -> Result<(u64, [u64; 3]), RdfStarParseError>
Parse an embedded triple from format-specific syntax
Returns (Virtual ID, [subject_id, predicate_id, object_id])
Sourcefn parse_triple(
&mut self,
input: &[u8],
) -> Result<(u64, u64, u64), RdfStarParseError>
fn parse_triple( &mut self, input: &[u8], ) -> Result<(u64, u64, u64), RdfStarParseError>
Parse a regular triple (subject, predicate, object)
Sourcefn parse_quad(
&mut self,
input: &[u8],
) -> Result<(u64, u64, u64, u64), RdfStarParseError>
fn parse_quad( &mut self, input: &[u8], ) -> Result<(u64, u64, u64, u64), RdfStarParseError>
Parse a quad (subject, predicate, object, graph)
Returns None if the format doesn’t support quads
Sourcefn supports_quads(&self) -> bool
fn supports_quads(&self) -> bool
Check if this parser supports quad formats (named graphs)
Sourcefn supports_named_graphs(&self) -> bool
fn supports_named_graphs(&self) -> bool
Check if this parser supports named graphs
Sourcefn format_name(&self) -> &'static str
fn format_name(&self) -> &'static str
Get the format name for error reporting