[x3d-public] Important: URNs as International Resource Identifiers

John Carlson yottzumm at gmail.com
Sun Aug 17 16:48:58 PDT 2025


It appears, according to the grammar of IRIs:

RFC 3987 - Internationalized Resource Identifiers (IRIs)
<https://datatracker.ietf.org/doc/html/rfc3987#section-2.2>

that URNs, like:

urn:web3d:media:textures/panoramas/horizon_3_back.jpg

Are NOT legal IRI references, at least according to ajv-formats-draft2019 -
npm <https://www.npmjs.com/package/ajv-formats-draft2019>

Which is really confusing, because I thought URNs were IRIs, just like URNs
are URIs.

I am going with IRIs and IRI references, because some IRIs include emojis,
which the IRI grammar handles, last I checked.   I don't think URIs include
emojis.

For further reference, here is the URN specification:

RFC 8141: Uniform Resource Names (URNs)
<https://www.rfc-editor.org/rfc/rfc8141#section-2>

So while the scheme is "urn"  there is no NID or NSS appearing in the IRI
grammar.

So how can I validate URN strings with JSON schema?

 Am I the first one to notice this?

Google AI says, use this in your JSON schema:

{
"type": "string",
"format": "uri",
"pattern":
"^urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
}


I guess I can use a "oneOf" superschema, to include both this uri format,
and the normal iri-reference format.

Does X3D have a collection of patterns for URNs?

Thanks!

Maybe I solved my problem?

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250817/658765a0/attachment.html>


More information about the x3d-public mailing list