Skip to content

Commit

Permalink
Merge pull request #33 from gpdf/tickets/DM-22422
Browse files Browse the repository at this point in the history
[DM-22422] Curated schema and table metadata to be more user-friendly
  • Loading branch information
cbanek authored Dec 5, 2019
2 parents 825e80e + 7c34484 commit 31751ef
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 39 deletions.
12 changes: 6 additions & 6 deletions docker/tap-schema/0005_tap_schema_self11.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ delete from tap_schema.schemas11 where lower(schema_name) = 'tap_schema'


insert into tap_schema.schemas11 (schema_name,description,utype,schema_index) values
( 'tap_schema', 'a special schema to describe TAP-1.1 tablesets', NULL, 10)
( 'tap_schema', 'A TAP-standard-mandated schema to describe tablesets in a TAP 1.1 service', NULL, 100000)
;

insert into tap_schema.tables11 (schema_name,table_name,table_type,description,utype,table_index) values
( 'tap_schema', 'tap_schema.schemas', 'table', 'description of schemas in this tableset', NULL, 1),
( 'tap_schema', 'tap_schema.tables', 'table', 'description of tables in this tableset', NULL, 2),
( 'tap_schema', 'tap_schema.columns', 'table', 'description of columns in this tableset', NULL, 3),
( 'tap_schema', 'tap_schema.keys', 'table', 'description of foreign keys in this tableset', NULL, 4),
( 'tap_schema', 'tap_schema.key_columns', 'table', 'description of foreign key columns in this tableset', NULL, 5)
( 'tap_schema', 'tap_schema.schemas', 'table', 'description of schemas in this tableset', NULL, 100000),
( 'tap_schema', 'tap_schema.tables', 'table', 'description of tables in this tableset', NULL, 101000),
( 'tap_schema', 'tap_schema.columns', 'table', 'description of columns in this tableset', NULL, 102000),
( 'tap_schema', 'tap_schema.keys', 'table', 'description of foreign keys in this tableset', NULL, 103000),
( 'tap_schema', 'tap_schema.key_columns', 'table', 'description of foreign key columns in this tableset', NULL, 104000)
;

insert into tap_schema.columns11 (table_name,column_name,description,utype,ucd,unit,datatype,arraysize,xtype,principal,indexed,std, column_index) values
Expand Down
6 changes: 3 additions & 3 deletions docker/tap-schema/1000_table_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ CREATE TABLE tap_schema.obscore
);

INSERT INTO tap_schema.schemas11 (schema_name, description, utype, schema_index)
VALUES ('SYS', 'An Oracle system schema', NULL, 100);
VALUES ('SYS', 'An Oracle system schema', NULL, 130000);

INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, description, utype, table_index)
VALUES ('tap_schema', 'tap_schema.obscore', 'table', 'description of schemas in this tableset', NULL, 1);
VALUES ('tap_schema', 'tap_schema.obscore', 'table', '(experimental) basic ObsCore table', NULL, 105000);

INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, description, utype, table_index)
VALUES ('SYS', 'SYS.DUAL', 'table', 'Oracle system table.', NULL, 2);
VALUES ('SYS', 'SYS.DUAL', 'table', 'Oracle system table.', NULL, 130000);

INSERT
INTO tap_schema.columns11 (table_name,column_name,utype,ucd,unit,description,datatype,arraysize,xtype,principal,indexed,std,column_index,id)
Expand Down
4 changes: 2 additions & 2 deletions docker/tap-schema/1002_gaia_source.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ GRANT SELECT ON gaiadr2.* TO 'TAP_SCHEMA'@'%';

-- Insert the tap_schema metadata about this table and its columns.
INSERT INTO tap_schema.schemas11 (schema_name, description, utype, schema_index)
VALUES ('gaiadr2', 'Gaia DR2', NULL, 100);
VALUES ('gaiadr2', '(experimental) Gaia DR2', NULL, 110000);

INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, description, utype, table_index)
VALUES ('gaiadr2', 'gaiadr2.gaia_source', 'table', 'GAIA source table.', NULL, 1);
VALUES ('gaiadr2', 'gaiadr2.gaia_source', 'table', 'GAIA source table (column subset)', NULL, 110000);

INSERT
INTO tap_schema.columns11 (table_name, column_name, utype, ucd, unit, description, datatype, arraysize, size, principal, indexed, std, column_index, id) VALUES
Expand Down
4 changes: 2 additions & 2 deletions docker/tap-schema/1003_uws_tap_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ DELETE FROM tap_schema.schemas11 where schema_name like 'uws';

-- Insert the tap_schema metadata about this table and its columns.
INSERT INTO tap_schema.schemas11 (schema_name, description, utype, schema_index)
VALUES ('uws', 'UWS Metadata', NULL, 100);
VALUES ('uws', 'UWS Metadata', NULL, 120000);

INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, description, utype, table_index)
VALUES ('uws', 'uws.Job', 'table', 'Job history table.', NULL, 1);
VALUES ('uws', 'uws.Job', 'table', 'Job history table.', NULL, 120000);

INSERT
INTO tap_schema.columns11 (table_name, column_name, utype, ucd, unit, description, datatype, arraysize, size, principal, indexed, std, column_index, id) VALUES
Expand Down
16 changes: 8 additions & 8 deletions docker/tap-schema/1004_wise_tap_schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INSERT INTO tap_schema.schemas11 (schema_name, utype, description, schema_index) VALUES ('wise_00', null, 'ALLWISE, All-Sky, NeoWISE', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allsky_2band_p1bm_frm', 'table', null, 'WISE Post-Cryo Single Exposure (L1b) Image Inventory Table', 0);
INSERT INTO tap_schema.schemas11 (schema_name, utype, description, schema_index) VALUES ('wise_00', null, 'Public WISE mission data: AllWISE catalogs and images; All-Sky single-epoch images', 20000);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allsky_2band_p1bm_frm', 'table', null, 'WISE Post-Cryo Single Exposure (L1b) Image Inventory Table', 26000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_2band_p1bm_frm', 'band', 'int', null, null, 'WISE band number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_2band_p1bm_frm', 'naxis', 'int', null, null, 'number of data axes', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_2band_p1bm_frm', 'naxis1', 'int', null, null, 'number of pixels in x (data axis 1)', null, null, null, 0, 0, 0, null);
Expand Down Expand Up @@ -72,7 +72,7 @@ INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize,
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_2band_p1bm_frm', 'qp_fact', 'double', null, null, 'quality factor qp value for scan: photometric quality', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_2band_p1bm_frm', 'date_imgprep', 'char', 21, null, 'date and time of imgprep run, UTC', null, 'datetimeZ', null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_2band_p1bm_frm', 'cntr', 'long', null, null, 'unique entry counter (key) number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allsky_3band_p1bm_frm', 'table', null, 'WISE 3-Band Cryo Single Exposure (L1b) Image Inventory Table', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allsky_3band_p1bm_frm', 'table', null, 'WISE 3-Band Cryo Single Exposure (L1b) Image Inventory Table', 25000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_3band_p1bm_frm', 'band', 'int', null, null, 'WISE band number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_3band_p1bm_frm', 'naxis', 'int', null, null, 'number of data axes', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_3band_p1bm_frm', 'naxis1', 'int', null, null, 'number of pixels in x (data axis 1)', null, null, null, 0, 0, 0, null);
Expand Down Expand Up @@ -144,7 +144,7 @@ INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize,
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_3band_p1bm_frm', 'qs5_fact', 'double', null, null, 'quality factor qs5 value for scan: 5x5 scansynch quality', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_3band_p1bm_frm', 'qp_fact', 'double', null, null, 'quality factor qp value for scan: photometric quality', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_3band_p1bm_frm', 'cntr', 'long', null, null, 'unique entry counter (key) number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allsky_4band_p1bm_frm', 'table', null, 'WISE All-Sky Single Exposure (L1b) Image Inventory Table', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allsky_4band_p1bm_frm', 'table', null, 'WISE All-Sky Single Exposure (L1b) Image Inventory Table', 24000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_4band_p1bm_frm', 'band', 'int', null, null, 'WISE band number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_4band_p1bm_frm', 'naxis', 'int', null, null, 'number of data axes', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_4band_p1bm_frm', 'naxis1', 'int', null, null, 'number of pixels in x (data axis 1)', null, null, null, 0, 0, 0, null);
Expand Down Expand Up @@ -217,7 +217,7 @@ INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize,
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_4band_p1bm_frm', 'qp_fact', 'double', null, null, 'quality factor qp value for scan: photometric quality', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_4band_p1bm_frm', 'date_imgprep', 'char', 21, null, 'date and time of imgprep run, UTC', null, 'datetimeZ', null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allsky_4band_p1bm_frm', 'cntr', 'long', null, null, 'unique entry counter (key) number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3am_cdd', 'table', null, 'AllWISE Atlas Image Inventory Table', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3am_cdd', 'table', null, 'AllWISE Atlas Image Inventory Table', 22000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3am_cdd', 'coadd_id', 'char', 20, null, 'coadd ID', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3am_cdd', 'band', 'int', null, null, 'WISE band number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3am_cdd', 'naxis', 'int', null, null, 'number of data axes', null, null, null, 0, 0, 0, null);
Expand Down Expand Up @@ -280,7 +280,7 @@ INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize,
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3am_cdd', 'date_imgprep', 'char', 20, null, 'date and time of imgprep run, UTC', null, 'datetimeZ', null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3am_cdd', 'load_id', 'int', null, null, 'unique load ID number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3am_cdd', 'cntr', 'long', null, null, 'unique entry counter (key) number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3as_cdd', 'table', null, 'AllWISE Atlas Metadata Table', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3as_cdd', 'table', null, 'AllWISE Atlas Metadata Table', 23000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_cdd', 'coadd_id', 'char', 20, null, 'coadd ID', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_cdd', 'date_proc', 'char', 20, null, 'date and time of start of WSDC processing, UTC', null, 'datetimeZ', null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_cdd', 'elapsed_t', 'double', null, null, 'elapsed clock time', null, 'sec', null, 0, 0, 0, null);
Expand Down Expand Up @@ -621,7 +621,7 @@ INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize,
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_cdd', 'w4flxwtsdy', 'double', null, null, 'signal-to-noise ratio in FLXWTDY, Band 4', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_cdd', 'load_id', 'int', null, null, 'unique load ID number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_cdd', 'cntr', 'long', null, null, 'unique entry counter (key) number', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3as_mep', 'table', null, 'AllWISE Source Catalog', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3as_mep', 'table', null, 'AllWISE Multiepoch Photometry (MEP) Database', 21000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_mep', 'cntr_mf', 'long', null, null, 'Reference source cntr from Multiframe source_id_mf', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_mep', 'source_id_mf', 'char', 28, null, 'Source id from Multiframe (coadd id and source number)', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_mep', 'ra', 'double', null, null, 'right ascension (J2000)', null, 'deg', 'pos.eq.ra', 0, 0, 0, null);
Expand Down Expand Up @@ -670,7 +670,7 @@ INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize,
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_mep', 'z', 'double', null, null, 'unit sphere (x,y,z) position z value', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_mep', 'spt_ind', 'int', null, null, 'spatial (x,y,z) index key', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_mep', 'htm20', 'long', null, null, 'spatial (x,y,z) index key', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3as_psd', 'table', null, 'AllWISE Source Catalog', 0);
INSERT INTO tap_schema.tables11 (schema_name, table_name, table_type, utype, description, table_index) VALUES ('wise_00', 'wise_00.allwise_p3as_psd', 'table', null, 'AllWISE Source Catalog', 20000);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_psd', 'designation', 'char', 20, null, 'unique WISE source designation', null, null, null, 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_psd', 'ra', 'double', null, null, 'right ascension (J2000)', null, 'deg', 'pos.eq.ra', 0, 0, 0, null);
INSERT INTO tap_schema.columns11 (table_name, column_name, datatype, arraysize, xtype, description, utype, unit, ucd, indexed, principal, std, column_index) VALUES ('wise_00.allwise_p3as_psd', 'decl', 'double', null, null, 'declination (J2000)', null, 'deg', 'pos.eq.dec', 0, 0, 0, null);
Expand Down
Loading

0 comments on commit 31751ef

Please sign in to comment.