Within a object whose URL is well
defined, the URI of another object
may be given in abbreviated form,
where parts of the two URIs are the
same. This allows objects within
a group to refer to each other without
requiring the space for a complete
reference, and it incidentally allows
the group of objects to be moved
without changing any references.
This is not discussed in detail here,
it is only mentioned so that the
characters required by the technique
be reserved for that purpose. It
must be emphasised that when a reference
is passed in anything other than
a well controlled context, the full
form must always be used.
In the World-Wide Web applications,
the context URI of the document or
object containing a reference. In
this case partial URIs can be generated
by virtual objects and stored in
real objects, without the need for
dramatic change if the higher-order
parts of a hierarchical naming system
are modified. Apart from terseness,
this gives greater robustness to
practical systems, by enabling information
hiding between system components.
The partial form relies on a property
of the URI syntax that certain characters
("/") and certain path elements ("..",
".") have a significance reserved
for representing a hierarchical space,
and must be recognised as such by
both clients and servers.
A partial form can be distinguished
from a full form in that a full form
must have a colon and that colon
must occur before any slash characters.
Systems not requiring partial forms
should not use any unencoded slashes
in their naming schemes.
The rules for the use of a partial
name relative to the URI of the
context are:
- If the scheme parts are different,
the whole absolute locator must be
given. Otherwise, the scheme is omitted,
and:
- If the the partial URI starts with
a non-zero number of consecutive
slashes, then everything from the
context URI up to (but not including)
the first occurence of exectly the
same number of consecutive slashes
is taken to be the same and so prepended
to the partial URL to form the full
URL. Otherwise:
- The last part of the path of the
context URI (anything following the
rightmost slash) is removed, and
the given partial URI appended in
its place, and then:
- Within the result, all occurrences
of "xxx/../" or "/." are recursively
removed, where xxx, ".." and "."
are complete path elements.
Note: If a path of the context locator
ends in slash, partial URIs will
be treated differently to their treatment
with respect to the same path without
a slash. The trailing slash indicates
a void segment of the path.
Examples
IIn the context of URI
magic://a/b/c//d/e/f
the partial URIs would expand as
follows:
- g
- magic://a/b/c//d/e/g
- /g
- magic://a/g
- //g
- magic://g
- ../g
- magic://a/b/c//d/g
- g:a
- g:a
In the context of the URI
magic://a/b/c//d/e/
the resutls would be exactly the
same.