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

vlkb-obscore: inserts only survName -> obs_collection, species&trans -> obs_title

parent 31ba7b0e
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,8 @@ SqlSchema_DELETE::SqlSchema_DELETE(void) ...@@ -14,7 +14,8 @@ SqlSchema_DELETE::SqlSchema_DELETE(void)
vector<string> SqlSchema_DELETE::getCommand(int sid, const Survey& surv) vector<string> SqlSchema_DELETE::getCommand(int sid, const Survey& surv)
{ {
string sidStr = to_string(sid); string sidStr = to_string(sid);
string obsCollStr = surv.getObsCollection();// FIXME + to_sqlstring(surv.getObsCollection()); and remove apostrophes below... string obsCollStr = surv.getObsCollection();
string obsTitleStr = surv.getObsTitle();
vector<string> vDELETE{ vector<string> vDELETE{
/* {"DELETE FROM cubeboundsgalactic WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"}, /* {"DELETE FROM cubeboundsgalactic WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"},
...@@ -23,7 +24,7 @@ vector<string> SqlSchema_DELETE::getCommand(int sid, const Survey& surv) ...@@ -23,7 +24,7 @@ vector<string> SqlSchema_DELETE::getCommand(int sid, const Survey& surv)
{"DELETE FROM verticesicrs WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"}, {"DELETE FROM verticesicrs WHERE header_id IN (SELECT header_id FROM headers WHERE survey_id = " + sidStr + ")"},
{"DELETE FROM headers WHERE survey_id = " + sidStr}, {"DELETE FROM headers WHERE survey_id = " + sidStr},
*/ */
{"DELETE FROM obscore WHERE obs_collection LIKE \'" + obsCollStr + "\'"}, {"DELETE FROM obscore WHERE obs_collection = \'" + obsCollStr + "\' AND obs_title = \'" + obsTitleStr + "\'"},
}; };
return vDELETE; return vDELETE;
} }
......
...@@ -122,11 +122,13 @@ string Survey::getStorageFilter(void) ...@@ -122,11 +122,13 @@ string Survey::getStorageFilter(void)
string Survey::getObsCollection(void) const string Survey::getObsCollection(void) const
{ {
return survName +" "+ survSpecies +" "+ survTransition; return survName;
} }
string Survey::getObsTitle(void) const
{
return survSpecies + " | " + survTransition;
}
......
...@@ -34,6 +34,7 @@ class Survey ...@@ -34,6 +34,7 @@ class Survey
std::string getStorageFilter(void); std::string getStorageFilter(void);
std::string getObsCollection(void) const; std::string getObsCollection(void) const;
std::string getObsTitle(void) const;
// table fields // table fields
......
...@@ -315,7 +315,7 @@ void database::dbAddSurvey(int sid, const string groups, ...@@ -315,7 +315,7 @@ void database::dbAddSurvey(int sid, const string groups,
const string obs_publisher_did = obscore_publisher + "?" + rel_pathname; const string obs_publisher_did = obscore_publisher + "?" + rel_pathname;
// optional // optional
const string obs_title{surv.survSpecies + " | " + surv.survTransition}; const string obs_title{surv.getObsTitle()};
// 4. set optional values which are available (in header or in metadata) // 4. set optional values which are available (in header or in metadata)
try try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment