IRI normalization
Some commands (node, shex-validate), MCP tools (node_info, validate_shex) and the triple API of rudof_lib accept a node, term or shape label as a plain string. rudof parses these strings with the ShapeMap parser (shape labels and node selectors) or with the RDF 1.2 Turtle term parser (terms). Both parsers require IRIs in angle brackets: <http://example.org/Alice>.
To avoid burdening users with this detail, rudof applies a normalization step before handing the string to the parser. Two modes are available, controlled by the --strict-iris CLI flag or the strict_iris MCP field.
Lax mode (default)
A string is treated as a bare IRI and wrapped in <> if all four conditions hold:
- It does not already start with
<. - It does not start with
_:(blank node). - It does not start with
{(triple-pattern node selector such as{FOCUS a :Person}). - It contains the substring
://.
All other strings (prefixed names, already-bracketed IRIs) are passed through unchanged.
Known failure cases
The :// check is a heuristic. There are RFC 3987 absolute IRI schemes that do not contain ://:
| Scheme | Example | What happens |
|---|---|---|
urn: | urn:isbn:0451450523 | Not wrapped → parse error |
mailto: | mailto:user@example.com | Not wrapped → parse error |
data: | data:text/plain;base64,SGVsbG8= | Not wrapped → parse error |
There is also a false-positive risk. A prefixed name whose local part contains :// (for example ex:path//resource) is treated as a full IRI by mistake.
Normalization looks at the whole string, so it never wraps a bare IRI inside a term. In a triple term (<<( ex:alice ex:name "Alice" )>>), every IRI must be in angle brackets or prefixed, in both modes.
For any of these inputs, users must wrap the IRI explicitly: <urn:isbn:0451450523>.
Strict mode
No normalization is applied. Every IRI must be passed with explicit angle brackets. A bare IRI produces a clear parser error, making the problem visible immediately rather than producing a silent wrong result.