W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2009

Re: [TF-LIB] COALESCE is an unhelpful choice of name

From: Sandro Hawke <sandro@w3.org>
Date: Sat, 14 Nov 2009 10:51:03 -0500
To: Lee Feigenbaum <lee@thefigtrees.net>
cc: Alexandre Passant <alexandre.passant@deri.org>, Paul Gearon <gearon@ieee.org>, SPARQL Working Group <public-rdf-dawg@w3.org>
Message-ID: <1583.1258213863@waldron>
> Then again, that's what COALESCE means also, so this is a case of once I 
> think about it, none of the names make sense to me.   :)

One more bit of data: Perl and Python use their "or" operator (which is
"||" in perl) for roughly this functionality.

For example:

   $ perl
   print(0 || 2);
   2

   $ python
   Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) 
   >>> print False or 0 or 2
   2

In our case, it's not skipping over zero or false, just unbound, right?

So how about FIRST_BOUND?  In Prolog terminology, it'd be either
FIRST_GROUND or FIRST_NONVAR, since once a variable is bound, it's not
considered a variable any more.

What happens if all the terms are unbound?  An error?  In that case it
could just be a special n-ary form of something to assert it's bound --
leave off the 'first'.  NONVAR(x) returns its argument, unless x is an
unbound variable.  NONVAR(x, y) is the "obvious" extension to try x,
then y, etc.

    -- Sandro


> :)
> 
> Lee
> 
> Alexandre Passant wrote:
> > 
> > On 13 Nov 2009, at 19:05, Paul Gearon wrote:
> > 
> >> On Fri, Nov 13, 2009 at 6:59 PM, Steve Harris 
> >> <steve.harris@garlik.com> wrote:
> >>> On 13 Nov 2009, at 13:01, Andy Seaborne wrote:
> >>>
> >>>> I don't find the name COALESCE very helpful.
> >>>>
> >>>> None of these seem good but they are better to me:
> >>>>
> >>>> VAL
> >>>> VALUE
> >>>> FIRST
> >>>> FIRST_VAL
> >>>> PROTECT
> >>>> SAFE
> >>>
> >>> None of these float my boat, but out of interest, what's the source 
> >>> of your
> >>> dislike for COALESCE? I find it pretty obvious, but then I've been 
> >>> using SQL
> >>> for too long.
> >>
> >> Personally, I'd never heard of this function, and it's been completely
> >> opaque to me. I've come back to it a few times now (each time after a
> >> break of a couple of weeks) and every time I've had to look up some
> >> documentation to remind myself of what it meant.
> >>
> >> But then, I haven't used SQL much in recent years.
> > 
> > I was in the same case, it took me a while before figuring out what that 
> > function what about.
> > It may be obvious from people with an SQL background but it's 
> > apparently, based on the feedback here, not a relevant name for people 
> > that don't have such background.
> > 
> > So, do we in general want to stick to SQL naming or focus on something 
> > easy to understand for people coming to SPARQL without any bg on SQL ?
> > I'd prefer the second option and then chose a more relevant name (as 
> > MELD for instance, or synonyms as FUSE)
> > 
> > Best,
> > 
> > Alex.
> > 
> >>
> >> Regards,
> >> Paul Gearon
> >>
> > 
> > -- 
> > Dr. Alexandre Passant
> > Digital Enterprise Research Institute
> > National University of Ireland, Galway
> > :me owl:sameAs <http://apassant.net/alex> .
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
Received on Saturday, 14 November 2009 15:51:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:40 GMT