- From: Sandro Hawke <sandro@w3.org>
- Date: Wed, 22 Apr 2009 15:27:59 -0400
- To: public-rif-wg@w3.org
1. We decided to have a "contains" predicate to check for whether some value is in a list. But it turns out the function name "contains" is already used for searching for one string inside another. I suggest "in", but would be okay with "list-contains" or "contains-item". 2. We got rid of deep-equal because you can just check for list identity. But it seems to me there will often be lists of data values, and data values generally need to be compared with the appropriate equality predicate for their type (numeric-equal, datetime-equal, duration-equal, XMLLiteral-equal, compare+numeric-equal 0, text-compare+numeric-equal 0, etc). I suggest bringing back deep-equal for when you want comparison on data values to be done using datatype equality instead of identity. (This does suggest having a literal-equal or data-value-equal predicate; literal-equal(x,y) is the same as deep-equal(list(x), list(y))). 3. I think we omitted some useful XPath functions because they involve sequences. We may want to add them back now. The ones I see: - codepoints-to-string - string-to-codepoints 4. Note that many list functions compare list items: in, index-of, delete, union, intersect, except, distinct-values In XPath, some of these (union, intersect, except) are restricted to only be sequences of "nodes", and the others take an optional "collation" parameter, which indicates how strings are compared (eg allowing 'Strasse' and 'Straße' to compare as equal). I think the simplest approach is to provide a collation parameter on all of them, and use literal-equal for literals. Oh, hmmm. Now I realize I'm confused and worried about using rif:iri (or rif:local) with builtins. Does: ex:foo = 1 ential: external(numeric-equal(ex:foo, 1)) ? Or is that a syntax error? This comes up when we think about index-of with a list of 'objects' (eg rif:iris); we need to have a way to compare to the things in the list. -- Sandro
Received on Wednesday, 22 April 2009 19:28:09 UTC