Form of UCD-based queries

Yuji SHIRASAKI yuji.shirasaki at nao.ac.jp
Wed Jun 1 08:34:32 PDT 2005


From: "Wil O'Mullane" <womullan at skysrv.pha.jhu.edu>
Subject: Re: Form of UCD-based queries
Date: Wed, 1 Jun 2005 10:42:34 -0400

> There may be a way but in most SQLs if you do 
> 
> select 'x' from tab
> 
> you get 
> 'x' back 
> not a a colum called x

That is because a single quate is used to express a string constant,
on the other hand a double quate is used to expression delimited 
identifier.

In addition, "x" does not represent a column called x but a column 
called "x". A double quate is a part of the column name.

> I just tried this on sql server created a function which returns a string and the did
> select dbo.ucd() from ABELL
> 
> i get back
> Column1
> RA
> RA
> RA
> RA
> :
> 
> not the values of the ra column

ucd('ucd_expression') is a function not only of a string 'ucd_expression' 
but also of all the column values, so this is actually an abbreviation of 

   ucd('ucd_expression', column1, column2, column3, ...)

Yuji SHIRASAKI

> On Wed, Jun 01, 2005 at 03:23:40PM +0100, Tony Linde wrote:
> > Hi Yuji,
> > 
> > > To avoid this confusion, why don't we use just a function 
> > > calling like ucd('pos.eq;src') ?
> > 
> > I'd thought of that at first but figured it would confuse the issue. 
> > 
> > But thinking on't further, it might actually fit. We could define that the
> > function ucd(_string_) should simply be resolved by the end-point of the
> > ADQL query into the unique column identified by the UCD '_string_' or the
> > column which best fit that UCD if it was multiply defined.
> > 
> > We ought to go on to define guidelines for inclusion of appropriate metadata
> > in the returned results so that end-users or (more importantly) downstream
> > applications can manipulate multiple sets of results in a meaningful way.
> > 
> > So no changes to ordinary parsers is required - if the end-point does not
> > understand the ucd() function, it'll treat it as undefined. And not much
> > change to the spec is required except to indicate that this is a special
> > function and what to do about it. (Tho' I'm not suggesting it go into the
> > v1.0 spec but we could have a 1.01 WD released soon after the 1.0REC.)
> > 
> > What do others think?
> > 
> > Cheers,
> > Tony. 
> > 
> > > -----Original Message-----
> > > From: Yuji SHIRASAKI [mailto:yuji.shirasaki at nao.ac.jp] 
> > > Sent: 01 June 2005 14:43
> > > To: Tony.Linde at leicester.ac.uk
> > > Cc: voql at ivoa.net
> > > Subject: Re: Form of UCD-based queries
> > > 
> > > 
> > > Also in sql99, double quotes are used for non-simple names.
> > > 
> > > I found, however, that "double colons" is already used in 
> > > SQL99 to describe the static method calling.
> > > 
> > > For an example,  ucd::"pos.eq;src"  means the execution of a 
> > > static method "pos.eq;src" of data class ucd.
> > > 
> > > To avoid this confusion, why don't we use just a function 
> > > calling like ucd('pos.eq;src') ?
> > > 
> > > At the moment, we don't define what value should be returned 
> > > by this function, This will be defined in the next version of 
> > > ADQL spec.
> > > 
> > > ---
> > > Yuji SHIRASAKI
> > > 
> > > From: "Tony Linde" <Tony.Linde at leicester.ac.uk>
> > > Subject: RE: Form of UCD-based queries
> > > Date: Wed, 1 Jun 2005 11:00:26 +0100
> > > 
> > > > > In the SQL92 specification, double quotes are used for non-simple 
> > > > > names.
> > > > 
> > > > If it is the same in sql99, I'll buy it (I don't _like_ it: double 
> > > > quotes indicate a string constant to me, same as single 
> > > quotes, but if 
> > > > it is the standard then we ought to adopt it).
> > > > 
> > > > So, Yuji, an example of your proposal for UCD naming would then be 
> > > > ucd::"pos.eq;src" - yes?
> > > > 
> > > > (BTW - why did the group settle on [] in the first place? And will 
> > > > there be ructions if we change now? Still, that's what the 
> > > RFC period 
> > > > is about, I
> > > > guess.)
> > > > 
> > > > T.
> > > > 
> > > > > -----Original Message-----
> > > > > From: Yuji SHIRASAKI [mailto:yuji.shirasaki at nao.ac.jp]
> > > > > Sent: 01 June 2005 09:31
> > > > > To: Tony.Linde at leicester.ac.uk
> > > > > Cc: voql at ivoa.net
> > > > > Subject: Re: Form of UCD-based queries
> > > > > 
> > > > > 
> > > > > Hi, Tony
> > > > > 
> > > > > From: "Tony Linde" <Tony.Linde at leicester.ac.uk>
> > > > > Subject: RE: Form of UCD-based queries
> > > > > Date: Wed, 1 Jun 2005 08:23:19 +0100
> > > > > 
> > > > > > Interesting. Wonder what MS will do - they use [] for
> > > > > non-simple names
> > > > > > I seem to recall. Is there anything in sql-99 which allows for 
> > > > > > handling non-simple names?
> > > > > 
> > > > > In the SQL92 specification, double quotes are used for non-simple 
> > > > > names.
> > > > > 
> > > > > I found it in the following URL:
> > > > > 
> > > > >    http://incubator.apache.org/derby/docs/ref/crefsqlj1003454.html
> > > > > 
> > > > > It looks like ([]) is only used on the SQL Server as an optional 
> > > > > functionality, and in a default setting (") is used.
> > > > > 
> > > > > MySQL uses back ticks (`) as a default, but when it 
> > > running in ANSI 
> > > > > double quotes (") will also work.
> > > > > 
> > > > >    http://www.ispirer.com/doc/sqlways38/Output/SQLWays-1-034.html
> > > > > 
> > > > > So, I support to use (") for non-simple names based on the
> > > > > SQL92 specification.
> > > > > 
> > > > > Yuji SHIRASAKI
> > > > > 
> > > > > > I guess it isn't an issue in the parser since [ where you are 
> > > > > > expecting a name will indicate the start of a non-simple
> > > > > name while [
> > > > > > after you've got the whole name will indicate the start of
> > > > > an array. 
> > > > > > Parsing is all context-based anyway.
> > > > > > 
> > > > > > I still like the [ but am not overly bothered if someone
> > > > > can suggest a
> > > > > > workable alternative.
> > > > > > 
> > > > > > T.
> > > > > > 
> > > > > > > -----Original Message-----
> > > > > > > From: owner-voql at eso.org [mailto:owner-voql at eso.org] 
> > > On Behalf 
> > > > > > > Of Yuji SHIRASAKI
> > > > > > > Sent: 01 June 2005 06:27
> > > > > > > To: voql at ivoa.net
> > > > > > > Subject: Re: Form of UCD-based queries
> > > > > > > 
> > > > > > > 
> > > > > > > BTW, I noticed that "[]" is used to express an array 
> > > data type 
> > > > > > > in SQL99.
> > > > > > > 
> > > > > > >    e.g.   select column_name[0], column_name[1], ...
> > > > > > > 
> > > > > > > If we have a plan to incorporate the SQL99 syntax in the
> > > > > future, it
> > > > > > > might be better to find another way to express 
> > > non-simple names.
> > > > > > > 
> > > > > > > ---
> > > > > > > Yuji SHIRASAKI, Research Fellow             
> > > +81-422-34-3579 (tel)
> > > > > > > National Astronomical Observatory of Japan  
> > > +81-422-34-3840 (fax)
> > > > > > > Osawa, Mitaka, Tokyo, Japan                 
> > > > > yuji.shirasaki at nao.ac.jp
> > > > > > > 
> > > > > > > 
> > > > > > > From: Yuji SHIRASAKI <yuji.shirasaki at nao.ac.jp>
> > > > > > > Subject: Re: Form of UCD-based queries
> > > > > > > Date: Wed, 01 Jun 2005 09:28:12 +0900 (JST)
> > > > > > > Message-ID: <20050601.092812.43003048.Yuji 
> > > SHIRASAKI at nao.ac.jp>
> > > > > > > 
> > > > > > > > 
> > > > > > > > From: "Tony Linde" <Tony.Linde at leicester.ac.uk>
> > > > > > > > Subject: RE: Form of UCD-based queries
> > > > > > > > Date: Tue, 31 May 2005 17:06:00 +0100
> > > > > > > > Message-ID: <200505311606.BAA01951 at mail-hub.mtk.nao.ac.jp>
> > > > > > > > 
> > > > > > > > > > Is it necessary to use [] ?
> > > > > > > > > > I think it is possible to allow arbitrary string
> > > > > after "ucd::" 
> > > > > > > > > > keyword.
> > > > > > > > > 
> > > > > > > > > Not sure if it is necessary but since we've got the [] to
> > > > > > > allow the
> > > > > > > > > handling of non-simple names, it seems to fit. Does it
> > > > > > > cause a problem?
> > > > > > > > 
> > > > > > > > It is possible for a SQL parser to recognise the
> > > > > expression such
> > > > > > > > as "[ucd::pos.eq;src]" as a column name 
> > > "ucd::pos.eq;src", so
> > > > > > > I suggeset
> > > > > > > > to use an expression like "ucd::[pos.eq;src]", 
> > > where "ucd::" 
> > > > > > > > is out side of the bracket.
> > > > > > > > 
> > > > > > > > ---
> > > > > > > > Yuji SHIRASAKI, Research Fellow             
> > > > > +81-422-34-3579 (tel)
> > > > > > > > National Astronomical Observatory of Japan
> > > > > +81-422-34-3840 (fax)
> > > > > > > > Osawa, Mitaka, Tokyo, Japan                 
> > > > > yuji.shirasaki at nao.ac.jp
> > > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > 
> > > > > > 
> > > > > 
> > > > 
> > > > 
> > > 
> 



More information about the voql mailing list