MT Objectviewer May 6 20 04 1 Python-scripted AW object- viewer and SQL-query builder MJ Tempelaar http://www. astro -wise.org
MT Objectviewer May 6 2004 1
Python-scripted AW object-viewer and
SQL-query builder
MJ Tempelaar
http://www.astro-wise.org
MT Objectviewer May 6 2004 2
OverviewWeb interface to visualize and access the AW Oracle database :
– Shows structure of object-tables– Shows and navigates links between object-tables to visualize the database model– Builds and executes Oracle-SQL-queries– Binds SQL-queries to object-tables– Allows users to modify script-built queries– Output formats a.o. : XML for VOtables, Ggobi
Prototype Python-scripted http-server and Web interface to visualize and access AW Oracle database via ODBC
• Takes meta-information from Oracle data-dictionaries to show structure• Takes object-table-data from ODBC connection to view SQL results.
MT Objectviewer May 6 2004 3
Prototype Python-scripted http-server and Web interface to visualize and access
AW Oracle database via ODBC
• Takes meta-information from Oracle data-dictionaries to show structure
• Takes object-table-data from ODBC connection to view SQL results.
MT Objectviewer May 6 2004 4
diagram
A W d at ad i c t i o n ar y
O r ac l e 9A W d at ab as e
Q u e r yfo r m atan d E xe c u t i o n
S Q L Q u e rie s :dict io n a ry ,
o bje ct - ta ble s
H TM L o u tpu tda ta ta ble
H TM L -in pu tfo rm
H TTP - s e r ve r
X M L da tao u tpu t -o pt io n
O D B C
A W o b je c tt ab l e s
H TM L o u tpu ta t tribu te ta ble
S Q L Q u e rie sfo r in pu t - s e le ct
P yt h o n - p r o g r am
MT Objectviewer May 6 2004 5
Opening screen:
Access datadictionary to show Tables
MT Objectviewer May 6 2004 6
Show selection from all object-tables
Activate link to view attributes
MT Objectviewer May 6 2004 7
Inspectattributes in object-
table
[Data-dictionary Table-Screen dump ]
MT Objectviewer May 6 2004 8
navigate links between tables
[Data-dictionary Table-Screen dump ]
[Data-dictionary Table-Screen dump ]
MT Objectviewer May 6 2004 9
Build and execute Oracle-SQL-queries I
Types of Queries:- Generic queries on single or linked object-tables for any attribute(s)- Specific queries: e.g. position with cone search option- Queries start from main-tables
Queries may be dynamically be composed :
•By consecutive queries (invisible to user) •By user-selected links in the results of the previous query
Queries-forms may be dynamically be composed :
• By queries filling select-lists and finding limits
-
MT Objectviewer May 6 2004 10
Generic query on main table: select conditions, export-format ; bitmap-links-option to fits-files
download into users program
MT Objectviewer May 6 2004 11
Generic query on Main-table + one level of linked tables (“instant drill-down”)
MT Objectviewer May 6 2004 12
Fields may contain table-specific data obtained from querying the table directly before writing the form , here Filter, chip, Date-obs
[Data-Table-Screen dump ]
MT Objectviewer May 6 2004 13
Navigate to next query by activating a link
[Data-dictionary Table-Screen dump ]
MT Objectviewer May 6 2004 14
Build and execute Oracle-SQL-queries II
User-interaction and control:- set selective conditions (input field,
link)- select fields to be shown in results- modify previously generated query- select to download fits-files, bitmap-
images- select output-format: ao VOTable
Database-Specific matters:-SQL is Oracle9-SQL
MT Objectviewer May 6 2004 15
SQL-Query may contain specific Oracle-constructs
[Data-Table-Screen dump ]
Modify SQL-queries and test on-the-fly, or download to edit off-line
MT Objectviewer May 6 2004 16
generate XML output, egVOtable- output for external
applications
[Data-Table-Screen dup ]
MT Objectviewer May 6 2004 17
Applications for an ODBC-based AW database viewer and SQL-querying-
device:
Suitable for: Data analysis (sourcelists, catalogs, -frames)Not yet for: Operations on pipeline-objects
Features for further development:- Forms to work on combining data-sets - Incorporating a list of specific queries- Adaptations for interoperability - Aliasing Oracle SQL queries as generic ADQL- add SOAP service