Registry query language
Thomas McGlynn
tam at lheapop.gsfc.nasa.gov
Tue Sep 23 10:58:59 PDT 2003
Elizabeth Auden wrote:
>>What form should the registry query language take?
>>1. an xml form of SQL (as for ADQL in the SkyNode document)
>>2. Xquery
>
>
> My choice would be XQuery - I think it has more recent W3C standards than
> any of the SQL implementations, and XQuery also has the benefit of
> internet support and documentations from many projects on the web, not
> just VOs.
>
> cheers,
> Elizabeth
>
>
This is one of the many cases where I'm not sure I know enough
to make an intelligent choice. I can understand how to write
SQL (or some XML-parsed version of it) to do the kinds of queries
that I might want for a registry, but I don't have the sense
of what these might look like in XQquery. Here are a couple
of example queries in pseudo-SQL. Could someone suggest
what they might look like in Xquery?
Tom
In these pseudo-SQL I'm assuming there is a single 'registry'
table that includes both DataCollection entries and
service entries and that the linking fields discussed in the telecon
today between data collections and services exists (and is
saved as a concatentation of the collection id strings)
A very simplified version of what the DIS service does..
select service_name, short_name, curator, instrument from registry where
type='Catalog' and service_type='Cone'
A query for services that can access any existing database of X-ray information
where the collection has resolution > 1' and the service has an SIA interface
select services.service_name from registry services, registry collections
where collection.spectral_regime = 'X-ray' and
collection.spatial_resolution < 1/60. and
collection.service_type = 'DataCollection' and
registry.linked_resources like '% '+databases.id+' %'
registry.service_type like 'SIA/%'
Find the data collections that are not linked to any services.
select collections.service_name from registry collections
where not exists
(select services.service_name from registry services
where services.linked_resources like '% '+databases.id +' %')
(In practice I'd implement the linked resources as a join table, rather
than concatentating them in a single element of the registry table,
but I hope this gives the sense of what I'm asking for.)
More information about the registry
mailing list