pub struct Rdf12LiteralValidator { /* private fields */ }Expand description
Bounded lexical inspection under the three mandatory RDF 1.2 datatypes.
Uses shared structural metadata checks and rdf-reasoning lexical semantics.
Unknown encountered datatypes remain opaque. This does not implement datatype
value comparison or graph-wide consistency and never rewrites a source term.
Implementations§
Source§impl Rdf12LiteralValidator
impl Rdf12LiteralValidator
Sourcepub const fn new(maximum: u64) -> Self
pub const fn new(maximum: u64) -> Self
Set a strict byte budget, including opaque datatype payloads. A zero budget permits only an empty lexical form, verified through an EOF probe.
Sourcepub async fn validate<R: LiteralReader>(
&self,
reader: &mut R,
) -> Result<LiteralReport, LiteralError<R::Error>>
pub async fn validate<R: LiteralReader>( &self, reader: &mut R, ) -> Result<LiteralReport, LiteralError<R::Error>>
Validate metadata, then stream the lexical form using 4099 bytes of scratch.
No whole literal is retained. At most three incomplete UTF-8 bytes carry between reads. An exact byte budget permits the final EOF probe; exceeding it fails. Callers separately budget total attempt work across literals.
§Errors
Invalid standard metadata, invalid UTF-8, a recognized lexical violation, cancellation, resource exhaustion or a backend error abort inspection. A lexical violation is semantic evidence about this literal; it does not certify graph inconsistency or authorize publishing a partial inference.
Sourcepub async fn inspect<R: LiteralReader>(
&self,
reader: &mut R,
) -> Result<LiteralInspection, LiteralError<R::Error>>
pub async fn inspect<R: LiteralReader>( &self, reader: &mut R, ) -> Result<LiteralInspection, LiteralError<R::Error>>
Inspect the entire payload, retaining only its first shared lexical violation.
A semantic diagnostic is returned only after successful UTF-8 inspection through EOF. Later transport/cancellation/resource errors invalidate it. Scratch stays fixed at 4099 bytes plus one violation, even for huge values.
§Errors
Invalid metadata/UTF-8, storage, cancellation or byte/reader limits abort.