[Bug 14971] [FO3.0] uri-collection() - confusion over purpose

https://www.w3.org/Bugs/Public/show_bug.cgi?id=14971

--- Comment #1 from Michael Kay <mike@saxonica.com> 2012-02-15 00:10:56 UTC ---
After discussion in the WG on a couple of occasions, the  preference is to
remove any strong linkage between the results required for uri-collection() and
collection(). For example, given a collection URI C, uri-collection(C) might
include URIs that cannot be dereferenced or are otherwise unsuited to inclusion
in the results of collection(C), while collection(C) might include resources
that have no individual URIs, such as documents representing the rows in a
relational table or view. However, the set of collection URIs recognized by
collection() should be the same as the set of URIs recognized by
uri-collection().

However, the note under the description of "available collections" describes a
constraint that we must respect, namely that if a document node $N is returned
by collection(U), then either document-uri($N) must be empty, or
doc(document-uri($N)) must be $N. 

The changes to implement this are as follows: Rewrite the rules for
uri-collection as:

In the dynamic context, *available collections* provides a mapping from URIs to
collections of nodes. In some cases these nodes may have URIs, and it is useful
to be able to retrieve the URIs without accessing the nodes. The
fn:uri-collection function returns a sequence of URIs.

The set of URIs accepted by the fn:collection function SHOULD be the same as
the set of URIs accepted by the fn:uri-collection function.

The zero-argument form of the function returns the document URIs of the
document nodes in the default collection.

The single-argument form returns the document URIs of the document nodes in the
collection with a given collection URI. If the value of the argument is an
empty sequence, the action is as for the zero-argument form of the function. If
the argument is a relative URI reference, it is resolved against the Dynamic
Base URI property from the dynamic context.

There is no requirement that the URIs in the result of this function should all
be distinct.

Notes

One purpose in providing this function is to allow the URIs of the documents in
a collection to be retrieved without incurring the cost (which might be
significant in some implementations) of dereferencing the URIs to obtain the
actual nodes; the application might choose to dereference some of the URIs and
ignore others. In addition, an application that dereferences the URIs
individually can use try/catch to recover from failures that occur while
dereferencing an individual URI, whereas when fn:collection is used, try/catch
can only recover from a failure to retrieve the collection as a whole.

It is true for every URI U, and therefore for every URI in the result of
fn:uri-collection, that in the absense of errors, when doc(U) returns a
document node D, then document-uri(D) should be U. However, the
fn:uri-collection function MAY return URIs that cannot be dereferenced, or that
refer to resources other than document nodes; and equally the fn:collection
function MAY return resources that have no document URI. There is therefore no
necessary one-to-one correspondence between the results of fn:collection(C) and
fn:uri-collection(C).

It is also true for every URI U, and therefore for every URI in the result of
fn:uri-collection, that there is no necessary relationship between the results
of doc(U) and unparsed-text(U). It is possible that either, neither, or both of
these calls will succeed, and if both succeed, there is no necessary
relationship between the results returned by the two calls. While the
architecture of the web demands that at some semantic level both must be
representations of the same resource, this assertion is in practice
unenforceable and untestable. In particular, there is no guarantee that
fn:parse-xml(fn:unparsed-text(U)) returns the same result as fn:doc(U), since
fn:doc and fn:unparsed-text may retrieve different resource representations as
a result of content negotiation.

[This last note belongs in the general introduction to this family of functions
and not specifically to fn:uri-collection].

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 15 February 2012 00:10:59 UTC