|
SaadaQL doesn’t return data but just OIDs of selected records. The content of the record must then be searched by the API.
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 {...}
The "Select [type] From [Classes] In [Collections]" clause.
- [type] : unique key giving the category of searched data. type can be : ENTRY, TABLE, SPECTRUM, IMAGE or PLOT.
- [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 ranged on ne collection
- [Collections] : List of collections where data will be searched. Can be a unique token, a wild card (*) or a comma separated list.
- Examples
-
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.
The WherePosition clause
The WhereAttributeSaada clause
The WhereAttributeClass clause
The WhereRelation clause
The WhereUCD clause
A complex Example last update 2007-03-03
|