pub struct TurtleValidator { /* private fields */ }Expand description
Line-oriented Turtle syntax validator.
Implementations§
Source§impl TurtleValidator
impl TurtleValidator
Sourcepub fn validate(&self, input: &str) -> ValidationReport
pub fn validate(&self, input: &str) -> ValidationReport
Validate an entire Turtle document string.
Sourcepub fn validate_prefix_declaration(&self, line: &str) -> Option<ValidationIssue>
pub fn validate_prefix_declaration(&self, line: &str) -> Option<ValidationIssue>
Validate a single @prefix or PREFIX declaration line.
Returns Some(Error) if the line is malformed.
Sourcepub fn validate_triple_line(
&self,
line: &str,
known_prefixes: &[String],
) -> Option<ValidationIssue>
pub fn validate_triple_line( &self, line: &str, known_prefixes: &[String], ) -> Option<ValidationIssue>
Validate a single non-prefix Turtle line.
Returns Some(Warning) for unknown prefixes, Some(Error) for
unclosed angle brackets, etc.
Sourcepub fn validate_iri(&self, iri: &str) -> bool
pub fn validate_iri(&self, iri: &str) -> bool
Returns true when iri looks like a valid (absolute) IRI.
This is a heuristic check — it just verifies the IRI contains a scheme separator and no bare whitespace.
Sourcepub fn validate_prefix_name(&self, prefix: &str) -> bool
pub fn validate_prefix_name(&self, prefix: &str) -> bool
Returns true when prefix is a valid Turtle prefix name (PN_PREFIX).
A prefix name consists of letters, digits (after the first character), underscores, hyphens, and dots (but not as the last character).
Sourcepub fn count_triples_approx(input: &str) -> usize
pub fn count_triples_approx(input: &str) -> usize
Count the approximate number of triples in a Turtle document by counting
statement-ending . tokens on non-comment lines.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TurtleValidator
impl RefUnwindSafe for TurtleValidator
impl Send for TurtleValidator
impl Sync for TurtleValidator
impl Unpin for TurtleValidator
impl UnsafeUnpin for TurtleValidator
impl UnwindSafe for TurtleValidator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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