SRQL - Simple Registry Query Language
As XPath is too techie, and Adql unforgiving and still evolving, I'd like to suggest a user-facing query language called SRQL. It's a forgiving, google-ish little language, where the user can rarely input a syntactically incorrect query.
I've implemented a standalone java library that converts SRQL to XQuery. It'd be straightforward to extend this to target other query languages. -
srql.tgz: zip of sources, tests, docs and executable jarfile.
SRQL is used as the query language in
VOExplorer, a resource browser for the vo.
All text matching is case insensitive. So if you enter 'John', it will match resources containing 'John','john','JOhN', etc.
All matching is done by substring. So if you enter 'sol' it will match resources containing 'sol','solar', 'insole', etc.
| SRQL query |
Searches For |
galaxy |
resources containing galaxy in any of title, shortName, identifier, content/description and content/subject fields |
radio galaxy |
resources containing radio or galaxy in any of title, ... fields |
radio or galaxy |
resources containing radio or galaxy in any of title, ... fields |
radio and galaxy |
resources containing radio and galaxy in any of title, ... fields |
"radio galaxy" |
resources containing the phrase "radio galaxy" in any of title, ...fields |
not "radio galaxy" |
resources that do not contain the phrase "radio galaxy" in any of title, ... fields |
not (radio galaxy) |
resources that do not contain radio or galaxy in any of title, ... fields |
pulsar and not (radio galaxy) |
resources that contain pulsar that do not contain radio or galaxy in any of title, ... fields |
| specifying the target of a query |
name = first |
resources that contain first in just the title or shortname fields |
| =name = (first wfcam) |
resources that contain first or wfcam in just the title or shortname fields |
shortname = _expr |
resources that match expr in just the shortname field |
title = _expr |
resources that match expr in just the title field |
title = first or shortname = wfcam |
resources that contain first in just the title field, or that contain wfcam in just the shortname field |
subject = _expr |
resources that match expr in just the content/subject field |
description = _expr |
resources that match expr in just the content/description field |
id = _expr |
resources that match expr in just the identifier field |
any = _expr |
resources that match expr in any field |
default =_expr |
resources that match expr in just the shortname fields |
curation = _expr |
resources that match expr anywhere in the curation fields (creator, publisher, contributor, etc) |
type = _expr |
resources that match expr in just the xsi:type or content/type fields |
waveband = _expr |
resources that match expr in just the coverage/spectral/waveband field |
level = _expr |
resources that match expr in just the _content/contentLevel field |
col = _expr |
resources that match expr in a column name |
ucd = _expr |
resources that match expr in a column ucd |
| Inline XPath query - denoted by backquotes (Optional, assumes XQuery backend). Could implement pass-thru sql in same way |
type = cone and `cs:capability/cs:maxSR > 90` |
resources that are of type cone where the xpath cs:capability/cs:maxSR > 90 evaluates to true (i.e. catalog services where the maximum search radius is larger than 90 degrees) |
targetted and untargetted expressions can be mixed in the same query.
Examples.
abell and ucd=pos_eq_ra_main and waveband=(not uv)
Performance
Using a more targetted search like
name = first will be faster than just
first, while
any = first takes much longer.
--
NoelWinstanley - 09 Mar 2007
- srql.tgz: zip of sources, tests, docs and jarfile.