Skip to main content

sanitize_term

Function sanitize_term 

Source
pub fn sanitize_term(token: &str) -> Option<String>
Expand description

Percent-encode every repairable IRI inside a canonical term token, returning None when nothing changed. The token-level counterpart of sanitize_iri_content; it rebuilds quoted triples and literal datatypes around the repaired IRI so the result is still a canonical token.

A Some result carries no defect, exactly as for sanitize_iri_content. A quoted triple whose subject cannot be repaired is therefore returned as None even when its object could be: a partial repair changes IRIs without making the term loadable, and the report would count it as fixed. Found by the iri fuzz target.