This package provides an object orientish way to use URIs, with the URI scheme identifying the kind of objects. URIs can be parsed with parts extracted, replaced, or added. A method can be identified from the scheme and then evaluated. The objects are stored in an OAV mapping and use OAV delegation and parent identification. This OAV mapping is called the urispace.
A URI is a Uniform Resource Indicator and a URL is a Uniform Resource Locator, a subset of URIs. The other kind of URI is the experimental URN Uniform Resource Name. A URL indicates one specific location of a resource and how to access it. A URN indicates a resource in general; the URN must then be resolved to a URL automatically. URNs are still experimental; in practice all URIs are just URLs. These routines can however manipulate both URLs and URNs.
Each URI belongs to a scheme, such as 'ftp' or 'telnet'. The scheme begins the URI (except the relative scheme). A URI without a beginning scheme is always the '(relative)' scheme URL. If the scheme cannot be identified in the urispace OAV mapping, it is treated as a generic scheme.
The syntax of a URI depends on its scheme; the syntax defines the URI as sequence of parts with various delimiters. For example, with the URL 'ftp://hodgepodge/x/y/z;type=d', the scheme is 'ftp' and the parts are 'scheme' (ftp), 'host' (hodgepodge), 'path' (/x/y/z), and the 'parameter' (;type=d). The 'ftp' scheme has additional parts such as 'user' and 'port' which are empty in this specific URI. Each part of a URI is named; these names are used to extract, replace, and remove parts in parsed URIs. Part names are case sensitive.
Information about URIs is stored in an OAV mapping referred to as the urispace. This includes the parsing pattern, the generation format, the list of parts, and definitions of methods. OAV permits objects to be delegated, and for parents to be searched. All this flexibility is available for resolving information about URIs. The uri command consults this OAV mapping to parse URIs and evaluate methods on them.
The uri command has a static mapping compiled into it to provide a default set of definitions. A default internal urispace is initially defined. This space can be supplemented by defining another mapping, possibly delegating to or copying from the original default mapping. The new mapping can then be made the new urispace.
The wyrm-urispace defines standard URLs for file, data, ftp, gopher, http, mailto, news, nntp, pop, relative, and nonstandard URLs for oav mappings and no resource. A generic URI is defined which should match most other URIs. The methods open, get, put, delete, status, and children methods are defined for each of these URIs, though in many cases the default implementation is to return an error that the operation is not really implemented.
wyrm_urispace optionally replace the urispace with the mapping. If no urispace is given and no urispace has yet been defined, the default urispace is openned. If the static default urispace is not found, an empty one is created. Then the current (or new) urispace is returned.