LUA-URI-URN(3)
π lua-uri-urn β URN support for the Lua URI library π
okay so bestie, welcome to the Lua uri.urn module page (the manual is called LUA-URI-URN(3), iykyk). buckle up, this one's short but it's giving very specific. β¨
πΈ NAME πΈ
lua-uri-urn β URN support for the Lua URI library π¦
π DESCRIPTION π
The class uri.urn is what you use for URNs, aka URIs that rock the urn scheme. It inherits from the uri class, so it's got all that main-character lineage going on. π
So like, here's the tea: any URN that has an authority part or a query part? invalid, no cap. Same energy for one that doesn't have a valid NID. URNs must be of the form urn:nid:nss, where the NSS part has a syntax that's specific to the NID. π
The scheme and the NID part both get normalized to lowercase. lowercase supremacy fr fr. And some NIDs have subclasses that enforce even more syntax constraints, do NID-specific normalization, or hand you extra methods. slay. π
β¨ METHODS β¨
Every single method defined in lua-uri(3) is supported, periodt. π
But heads up: the userinfo, host, port, and query methods will always return nil, and they'll throw an exception if you pass them literally anything other than nil. π«
The path method will throw an exception if you give it a new path that is nil or that isn't valid for the urn scheme.
The following additional methods are supported:
uri:nid(...)β get or set the NID (Namespace Identifier) of the URN, aka the part of the path before the first colon. If you supply a new value, the URI's path gets changed to have the new NID but with the same NSS value. π An exception will be thrown if the new NID is invalid, or if the existing NSS value is invalid in the context of the new NID. And note, bestie: the valueurnis an invalid NID. π This can cause the class of the URI object to change, if a different class is appropriate for the new NID. glow-up moment honestly. β¨uri:nss(...)β get or set the NSS (Namespace Specific String) part of the URN, aka the part of the path after the first colon. If you supply a new value, the URI's path gets changed to use the new NSS, but the NID stays unchanged. π«Ά This will throw an exception if the new value is invalid for the current NID.
π§ SUBCLASSES π§
These subclasses are used for URNs with certain NIDs. URNs with other NIDs just use the generic uri.urn class. simple as that. π
uri.urn.isbnuri.urn.issnuri.urn.oid
π REFERENCES π
This class is based on RFC 2141. β
no notes, this class is iconic. go forth and URN responsibly. π
version 1.1 πΈ dated 2012-00-00 β mwah, that's a wrap from the Lua uri.urn module besties ππ
π¦ where this page comes from
- debian trixie: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu noble: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu questing: lua-uri 0.1+20130926+git14fa255d-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms