saada logo

 
  SAADA OVERVIEW
Home  
News  
Tutos and Links  
Download  
  Tutorial
Getting started  
Doing More  
SaadaQL  
The Web Interface  
VO Publishing  
Tips & Troubelshooting  
  COMMUNITY
Mailing List  
Saada Sites  
How to Contact us ?  
  DEVELOPER CORNER
Contributors  
Next Step  
Old Releases  
Inside Saada  
Using UWS  

 

SourceForge.net Logo


HOME ART > DEVELOPER CORNER > Old Releases > Saada 1.4.2 > TUTORIAL > Using your SaadaDB > SaadaQL
A complex Example

WhereUCD




 The example below shows an example of a full featured SaadaQL query.

Select ENTRY  From CatalogueEntry  In CATALOGUE
WherePosition {
   isInCircle("M33",1, J2000, FK5)
}
WhereAttributeSaada { "XCAT_OBSERVER  = 'Isaac Newton' and namesaada = 'NGC598'  "}
WhereAttributeClass { "_obs_id > 123000"}
WhereUCD { [phot.flux] < 1e-14 [erg/s/cm2] }
WhereRelation {
   matchPattern {
       "CatSrcToArchSrc"
     , AssObjClass( "Arch_8034AEntry")
     , AssObjAttClass("_bj < 20 ")
     , Qualifier("epic_cat_dist", "<", 1=)
   }
   matchPattern {
       "CatSrcToArchSrc"
     , Cardinality(">", 1)
     , AssUCD( [src.class] = 'QSO  [none])
     , AssObjAttSaada(namesaada like '%q%")
  }
}

 Code explanation :

  • Select : The query will return table entries selected from dat of the class CatalogueEntry of the collection CATALOGUE
  • WherePosition Entries will be search a 1 mnute radius cone around the M33 position.
  • WhereAttributeSaada Only object named ’NGC598’ and observed by ’Isaac Newton’ will be selected. Notice that namesaada is native Saada collection attribute, wheras XCAT_OBSERVER is a collection attribute added at database creation time (see)
  • WhereAttributeClass statement can be used because the query concerns one unique class. Look at the attribute name format (begins with’_’, lowercase,....)
  • WhereUCD allows to state selection criteria withut knowing the column names (see). The list of available UCDs and units is given by the applet.
  • WhereRelation contains 2 correlation patterns. Both patterns will ANDed. Both pattern concern the same relation CatSrcToArchSrc
    • First pattern : The selected sources must have at least one counterpart of class Arch_8034AEntry with _bj less than 20 and located at less than 1 arcsec.
    • Second pattern :The selected sources must have more than one counterpart with a Saada name (collection native attribute) containing the ’q’ letter and having at leat one attribute with src.class as UCD and QSO as value.
last update 2007-03-03