Skip to content

Commit

Permalink
trying to minimally reflect manager changes necesssary for new minerv…
Browse files Browse the repository at this point in the history
…a API--fixing models and meta in the old style (not using request_sets); geneontology/amigo#108
  • Loading branch information
kltm committed Apr 24, 2015
1 parent a799839 commit d680631
Showing 1 changed file with 39 additions and 119 deletions.
158 changes: 39 additions & 119 deletions lib/bbopx/minerva/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ bbopx.minerva.manager = function(barista_location, namespace, user_token,
};

/*
* Method: get_models_meta
* Method: get_meta
*
* Trigger meta <bbopx.barista.response> with a list of all model
* meta-information.
Expand All @@ -266,11 +266,11 @@ bbopx.minerva.manager = function(barista_location, namespace, user_token,
* Returns:
* n/a
*/
anchor.get_models_meta = function(){
anchor.get_meta = function(){

//
var reqs = new bbopx.minerva.request_set(anchor.user_token());
var req = new bbopx.minerva.request('model', 'all-model-meta');
var req = new bbopx.minerva.request('meta', 'get');
reqs.add(req);

var args = reqs.callable();
Expand Down Expand Up @@ -652,6 +652,39 @@ bbopx.minerva.manager = function(barista_location, namespace, user_token,
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: add_model
*
* Trigger a rebuild response <bbopx.barista.response> on
* attempting to create a new model...from nothing. Or something!
*
* Intent: "action".
* Expect: "success" and "rebuild".
*
* Arguments:
* taxon_id - *[DEPRECATED]* *[optional]* string (full ncbi)
* class_id - *[DEPRECATED]* *[optional]* string
*
* Returns:
* n/a
*/
anchor.add_model = function(taxon_id, class_id){

//
var reqs = new bbopx.minerva.request_set(anchor.user_token());
var req = new bbopx.minerva.request('model', 'add');

// These are pretty much deprecated.
if( taxon_id ){ req.special('taxon-id', taxon_id); }
if( class_id ){ req.special('class-id', class_id); }

reqs.add(req);

var args = reqs.callable();
anchor.apply_callbacks('prerun', [anchor]);
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: export_model
*
Expand Down Expand Up @@ -955,125 +988,12 @@ bbopx.minerva.manager = function(barista_location, namespace, user_token,
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: generate_model_by_class_and_db
*
* Trigger a rebuild response <bbopx.barista.response> on
* attempting to create a new model by providing a starting class
* and a database identifier (see GAF extensions).
*
* Intent: "action".
* Expect: "success" and "rebuild".
*
* Arguments:
* class_id - string
* db_id - string (hope you guess right--as GAF extension)
*
* Returns:
* n/a
*/
anchor.generate_model_by_class_and_db = function(class_id, db_id){

//
var reqs = new bbopx.minerva.request_set(anchor.user_token());
var req = new bbopx.minerva.request('model', 'generate');
req.special('db', db_id);
req.special('subject', class_id);
reqs.add(req);

var args = reqs.callable();
anchor.apply_callbacks('prerun', [anchor]);
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: generate_model_by_db
*
* Trigger a rebuild response <bbopx.barista.response> on
* attempting to create a new model by providing a database
* identifier (see GAF extensions).
*
* Intent: "action".
* Expect: "success" and "rebuild".
*
* Arguments:
* db_id - string (hope you guess right--as GAF extension)
*
* Returns:
* n/a
*/
anchor.generate_model_by_db = function(db_id){

//
var reqs = new bbopx.minerva.request_set(anchor.user_token());
var req = new bbopx.minerva.request('model', 'generate-blank');
req.special('db', db_id);
reqs.add(req);

var args = reqs.callable();
anchor.apply_callbacks('prerun', [anchor]);
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: generate_model_by_taxon
*
* Trigger a rebuild response <bbopx.barista.response> on
* attempting to create a new model by providing a database
* identifier (see GAF extensions).
*
* Intent: "action".
* Expect: "success" and "rebuild".
*
* Arguments:
* taxon_id - string (full ncbi)
*
* Returns:
* n/a
*/
anchor.generate_model_by_taxon = function(taxon_id){

//
var reqs = new bbopx.minerva.request_set(anchor.user_token());
var req = new bbopx.minerva.request('model', 'generate-blank');
req.special('taxonId', taxon_id);
reqs.add(req);

var args = reqs.callable();
anchor.apply_callbacks('prerun', [anchor]);
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: generate_model
*
* Trigger a rebuild response <bbopx.barista.response> on
* attempting to create a new model...from nothing.
*
* Intent: "action".
* Expect: "success" and "rebuild".
*
* Arguments:
* n/a
*
* Returns:
* n/a
*/
anchor.generate_model = function(){

//
var reqs = new bbopx.minerva.request_set(anchor.user_token());
var req = new bbopx.minerva.request('model', 'generate-blank');
reqs.add(req);

var args = reqs.callable();
anchor.apply_callbacks('prerun', [anchor]);
jqm.action(anchor._url, args, 'GET');
};

/*
* Method: capella_bootstrap_model
*
* DEPRECATED: This is currently very very old code and is mostly
* here as a bookmark on where to restart.
*
* Trigger a rebuild response <bbopx.barista.response> on
* attempting to create a new model with information provided by
* Capella.
Expand Down

0 comments on commit d680631

Please sign in to comment.