The Saada query engine returns result set containing selected OIDs and values of all keywords constrained by the query.
Syntax elements
- SaadaQL keywords are case sensitive.
- Logical blocs are delimited with
{} . - Multi line queries are supported.
- Strings delimitors are double quotes ("").
Query Structure
The SQL "select from" is replaced with an OQL flavour "Select From In" which specifies collections and classes where data are queried. The SQL where statement is replaced with 5 clauses having each one its own significance. Where clauses are implicitely ANDed. The global structure of a SaadaQL query is figured below.
Select [type] From [Classes] In [Collections]
WherePosition {...}
WhereAttributeClass {...}
WhereAttributeSaada {...}
WhereRelation {...}
WhereUCD/Utype {...}
|
The "Select [type] From [Classes] In [Collections]" clause.
- [type] : unique key giving the category of searched data. type can be : ENTRY, TABLE, SPECTRUM, IMAGE, MISC or FLATFILE.
- [Classes] : List of classes of searched data. Can be a unique token, a wild card (*) or a comma separated list. Class can only be specified if the query cover one collection
- [Collections] : List of collections where data will be searched. Can be a unique token, a wild card (*) or a comma separated list.
Select ENTRY From * In * |
queries entries of the whole database. |
Select IMAGE From * In HST |
queries all images in the collection HST. |
Select IMAGE From * In HST,NGST |
queries all images in both collections HST and NGST. |
Select IMAGE From class1 In HST |
queries all images in the class class1 of the collection HST. |
Select IMAGE From class1,class2 In HST |
queries all images in both classes class1 and class2 of the collection HST. |
Select IMAGE From class1,class2 In HST,NGST |
returns an error because classes can be specified on multiple collections. |
[type] |
[collection] |
[class] |
- |
SPECTRUM
IMAGE
TABLE
ENTRY
MISC
|
collection1 |
* or class1, class2... or class1
|
Only one collection can be queried if classes are specified |
SPECTRUM
IMAGE
TABLE
ENTRY
MISC
|
* or coll1 or coll1,coll2... |
* |
Some or any collections can be queried if no classes are specified |
FLATFILE |
* or coll1 or coll1,coll2... |
* |
There is no class for flatfiles |
The WherePosition clause
The WhereAttributeSaada clause
The WhereAttributeClass clause
The WhereRelation clause
The WhereUCD clause
A complex Example last update 2009-12-17
|