Skip to content
Snippets Groups Projects
Commit 54b605d4 authored by Robert Butora's avatar Robert Butora
Browse files

vlkb-obscore: adds columns obs_title, bib_reference, data_rights

parent 18424dd6
No related branches found
No related tags found
No related merge requests found
......@@ -84,8 +84,11 @@ void SqlSchema::reset(void)
{dataproduct_type, "dataproduct_type VARCHAR"},
{calib_level, "calib_level INTEGER NOT NULL"},
{obs_collection, "obs_collection VARCHAR NOT NULL"},
{obs_title, "obs_title VARCHAR"},
{obs_id, "obs_id VARCHAR NOT NULL"},
{obs_publisher_id, "obs_publisher_did VARCHAR PRIMARY KEY"},
{bib_reference, "bib_reference VARCHAR"},
{data_rights, "data_rights VARCHAR"},
{access_url, "access_url TEXT"},
{access_format, "access_format VARCHAR"},
{access_estsize, "access_estsize BIGINT"},
......
......@@ -34,7 +34,8 @@ class SqlSchema
enum verticesgalColId {vgheader_id, p1lon, p1lat, p2lon, p2lat, p3lon, p3lat, p4lon, p4lat};
enum verticesicrsColId {viheader_id, p1ra, p1dec, p2ra, p2dec, p3ra, p3dec, p4ra, p4dec};
enum obscoreColId {dataproduct_type, calib_level,
obs_collection, obs_id, obs_publisher_id,
obs_collection, obs_title, obs_id, obs_publisher_id,
bib_reference, data_rights,
access_url, access_format, access_estsize, target_name,
s_ra, s_dec, s_fov, s_region, s_region_galactic, s_xel1, s_xel2, s_resolution,
t_min, t_max, t_exptime, t_resolution, t_xel,
......
......@@ -238,6 +238,8 @@ void SqlSchema_INSERT::appendRow(
const string& obs_id,
const string& obs_publisher_did,
const string& obs_title,
const string& bib_reference,
const string& dataproduct_type,
const string& o_ucd,
......@@ -262,13 +264,16 @@ void SqlSchema_INSERT::appendRow(
// optional
obscoreRow[SqlSchema::obscoreColId::obs_title] = to_sqlstring(obs_title);
obscoreRow[SqlSchema::obscoreColId::bib_reference] = to_sqlstring(bib_reference);
obscoreRow[SqlSchema::obscoreColId::data_rights] = to_sqlstring(auth_policy);
obscoreRow[SqlSchema::obscoreColId::dataproduct_type] = to_sqlstring(dataproduct_type);
obscoreRow[SqlSchema::obscoreColId::o_ucd] = to_sqlstring(o_ucd);
obscoreRow[SqlSchema::obscoreColId::access_url] = to_sqlstring(access_url);
obscoreRow[SqlSchema::obscoreColId::access_format] = to_sqlstring(access_format);
obscoreRow[SqlSchema::obscoreColId::access_estsize] = to_string(access_estsize);
obscoreRow[SqlSchema::obscoreColId::o_ucd] = to_sqlstring(o_ucd);
obscoreRow[SqlSchema::obscoreColId::dataproduct_type] = to_sqlstring(dataproduct_type);
obscoreRow[facility_name] = to_sql_value(hdu.key_values, "TELESCOP");
obscoreRow[instrument_name] = to_sql_value(hdu.key_values, "INSTRUME");
obscoreRow[target_name] = to_sql_value(hdu.key_values, "OBJECT");
......
......@@ -23,6 +23,8 @@ class SqlSchema_INSERT : public SqlSchema
const std::string& obs_id,
const std::string& obs_publisher_did,
// optional
const std::string& obs_title,
const std::string& bib_reference,
const std::string& dataproduct_type,
const std::string& o_ucd,
......
......@@ -307,6 +307,8 @@ void database::dbAddSurvey(int sid, const string groups,
const string obs_id = rel_pathname.substr(0, rel_pathname.find_last_of("."));
const string obs_publisher_did = obscore_publisher + "?" + rel_pathname;
// optional
const string obs_title{surv.survSpecies + " | " + surv.survTransition};
// 4. set optional values which are available (in header or in metadata)
try
......@@ -320,6 +322,8 @@ void database::dbAddSurvey(int sid, const string groups,
obs_collection,
obs_id,
obs_publisher_did,
obs_title,
surv.survDescription,
surv.dataproductType,
surv.oUcd,
access_url, access_format, access_estsize,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment