Module volksdata.namespace

Namespace map module.

Handles a global map of URI namespaces and their prefixes.

Class Namespace

namespace:add (pfx, ns) Add a prefix-namespace pair to the NS map.
namespace:denormalize_uri (fq_uri) De-normalize (shorten) a fully qualified URI string to a ns-prefixed URI.
namespace:get_ns (pfx) Get a namespace for a given prefix.
namespace:get_pfx (ns) Get a prefix for a given full namespace.
namespace:iter () Iterate over the prfix-namespace map.
namespace:normalize_uri (pfx_uri) Normalize a ns-prefixed URI string to a fully qualified URI.
namespace:remove (pfx) Remove an entry from the NS map.


Class Namespace

Namespace class.
namespace:add (pfx, ns)
Add a prefix-namespace pair to the NS map.

Parameters:

Returns:

    nil
namespace:denormalize_uri (fq_uri)
De-normalize (shorten) a fully qualified URI string to a ns-prefixed URI.

Parameters:

  • fq_uri string Fully qualified URI.

Returns:

    string Prefixed URI.
namespace:get_ns (pfx)
Get a namespace for a given prefix.

Parameters:

  • pfx string Namespace prefix.

Returns:

    string
namespace:get_pfx (ns)
Get a prefix for a given full namespace.

Parameters:

Returns:

    string
namespace:iter ()
Iterate over the prfix-namespace map.

Returns:

    function Iterator function that yields one prefix-ns pair for each call, and nil at the end of the iteration.
namespace:normalize_uri (pfx_uri)
Normalize a ns-prefixed URI string to a fully qualified URI.

Parameters:

  • pfx_uri string Prefixed URI.

Returns:

    string Fully qualified URI.
namespace:remove (pfx)
Remove an entry from the NS map.

Parameters:

  • pfx string Prefix to remove.

Returns:

    nil
generated by LDoc 1.5.0 Last updated 2026-01-02 15:30:28