LUA-URI-URN(3)

πŸ“¦
version 0.1+20130926+git14fa255d Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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 value urn is 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.isbn
  • uri.urn.issn
  • uri.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