W3C home > Mailing lists > Public > public-rif-wg@w3.org > August 2009

DTB: Problem/Erratum for DTBin function string-join

From: Axel Polleres <axel.polleres@deri.org>
Date: Mon, 17 Aug 2009 21:28:27 +0100
Message-ID: <4A89BD6B.80206@deri.org>
To: "Public-Rif-Wg (E-mail)" <public-rif-wg@w3.org>
Hi all,

While working on the all-builtins use case, I realize a slight 
error/problem in DTB now with the function:


its xpath/xquery counterpart fn:string-join(...)

takes two arguments:
- a sequence of strings
- a "separator" string

now I realize - since this function was introduced when we didn't heva 
lists in RIF yet, that we seem to have expected a "flattened" list as 
input, i.e. we give the schemas

( ?arg1 ?arg2; func:string-join(?arg1 ?arg2 ) )

( ?arg1 ?arg2 ?arg3; func:string-join(?arg1 ?arg2 ?arg3 ) )


( ?arg1  ?arg2 ... ?argn; func:string-join(?arg1 ?arg2 ... ?argn ) )

Anyways, the semantics is defined in terms of fn:string-join, which 
didn't work so far, but only works with a small fix, i.e. interpreting 
the first n-1 arguments as the sequence argument of the CPAth/Xquery 
fn:string-join function. "Historically" this is IMO what we meant, as 
there was no lists.

Thus, I see two options for fixing this:

a) stick with the flattened version, interpreting the first n-1 
arguments as the sequence argument of the CPAth/Xquery fn:string-join 
function and the last argument as the separator string.

b) make the function with a fixed arity of 2,  the domain of the first 
argument being a list of strings and the second argument the separator 

I implemented option a) now, since it is the "least intrusive" change to 
the current doc, see


however, b) seems somehow the more natural way to proceed. The 
disadvantage/worry I see with b) is that we might want to implement
"emulating" sequences by lists as input in other functions as well... 


Dr. Axel Polleres
Digital Enterprise Research Institute, National University of Ireland, 
email: axel.polleres@deri.org  url: http://www.polleres.net/
Received on Monday, 17 August 2009 20:29:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 17 August 2009 20:29:15 GMT