The reference to extract the parent from
The parent reference, or undefined if iri has none: root paths of hierarchical and internal references,
opaque identifiers (for example, urn:example:a), relative references with an empty path (for example, "",
?q, #f, whose parent depends on the base they are resolved against), and invalid references (for example,
strings carrying an isolated UTF-16 surrogate or opening with //)
Extracts the identifier of the collection enclosing a reference.
Navigates one level up a path hierarchy: the parent of a member (
a/b) is the collection holding it (a/), and the parent of a collection (a/b/) is the collection enclosing it (a/). The parent always ends with a slash, drops the query and fragment ofiri, and keeps its variant:http://example.org/a/b?q#f,app:/a/b/): an absolute identifier sharing scheme and authority (http://example.org/a/,app:/a/), down to the root path (http://example.org/aandhttp://example.org/a/both yieldhttp://example.org/)/a/b): a root-relative path (/a/), down to the root path (/ayields/)a/b,a,../a/): a path-relative reference (a/,./,../); as relative references may climb indefinitely, a parent always exists, expressed through..segments where needed (..yields../../)Dot segments are resolved per RFC 3986 § 5.2.4, so
http://example.org/a/./b/../cyieldshttp://example.org/a/anda/../byields./; leading..segments of relative references are kept, as no base is available to absorb them.