Class: request_set

minerva-requests~request_set(user_token, model_idopt, reasoner_popt, group_idsopt) → {request_set}

new request_set(user_token, model_idopt, reasoner_popt, group_idsopt) → {request_set}

Constructor for a Minerva request item set. Handle sets of requests and serialize for Minerva call. Request sets are essentially serial request queues, that reference eachother using the request_variables contained in invididual requests. As the request_set operations almost always produce request_sets (with senisible defaults and fail modes), they can easily be chained together. If a model_id is given, it will be applied to any request that does not have one. If reasoner_p is set to true, the request will make the request for the use of the reaonser on the server; otherwise, no effect.
Parameters:
Name Type Attributes Description
user_token String string
model_id String <optional>
string
reasoner_p Boolean <optional>
bool
group_ids Array <optional>
(optional) list of string for group we want to apply to req
Source:
Returns:
request set object
Type
request_set

Methods

(static) anchor.external_client_id(cidopt) → {String|null}

Getter/setter for the request set client id, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
cid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_fact_relation_id(uidopt) → {String|null}

Getter/setter for the request set fact relation id, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
uid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_fact_source_id(uidopt) → {String|null}

Getter/setter for the request set fact source id, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
uid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_fact_target_id(uidopt) → {String|null}

Getter/setter for the request set fact target id, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
uid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_individual_id(uidopt) → {String|null}

Getter/setter for the request set individual id, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
uid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_model_id(midopt) → {String|null}

Getter/setter for the request set model id, to override, add, or query after request set initialization. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316). Model IDs are typically intended applied to the individual requests, rather than to the packet.
Parameters:
Name Type Attributes Description
mid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_return_url(uidopt) → {String|null}

Getter/setter for the request set return url, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
uid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.external_user_id(uidopt) → {String|null}

Getter/setter for the request set user id, to override, add, or query. Never for Noctua/Barista internal use--only intended for creating packets for external use (e.g. geneontology/noctua#316).
Parameters:
Name Type Attributes Description
uid String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.intention(intentopt) → {String|null}

Getter/setter for the request set intention, to override, add, or query after request set initialization.
Parameters:
Name Type Attributes Description
intent String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

(static) anchor.token(tokopt) → {String|null}

Getter/setter for the request set token, to override, add, or query after request set initialization.
Parameters:
Name Type Attributes Description
tok String | undef <optional>
string
Source:
Returns:
string or null
Type
String | null

add(req, intentionopt) → {request_set}

Add a request to the queue. This is the most "primitive" method of adding things to the request queue and should only be used when other methods (look at the API) are not available.
Parameters:
Name Type Attributes Description
req request
intention intention <optional>
'action' or 'query' ('action' default)
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_annotation_to_fact(key, value, value_typeopt, triple, model_idopt) → {request_set}

Adds unique key/value set to a fact.
Parameters:
Name Type Attributes Description
key String string
value String string
value_type String | null <optional>
string
triple String list of three strings: [SUBJECT_ID, OBJECT_ID, PREDICATE_ID]
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_annotation_to_individual(key, value, value_typeopt, individual_id, model_idopt) → {request_set}

Adds unique key/value set to an individual.
Parameters:
Name Type Attributes Description
key String string
value String string
value_type String | null <optional>
string
individual_id String string
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_annotation_to_model(key, value, value_typeopt, model_idopt) → {request_set}

Adds unique key/value set to model.
Parameters:
Name Type Attributes Description
key String string
value String string
value_type String | null <optional>
string
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_evidence(evidence_id, source_ids, with_strs, target_identifier, model_idopt) → {request_set}

Adds "anonymous" (current GO-style) evidence individual that is referenced in the individual's or fact's annotations to the batch.
Parameters:
Name Type Attributes Description
evidence_id String string
source_ids String string or list of strings (i.e. PMIDs)
with_strs String string or list of strings (i.e. "foo"); use null if evidence code does not support "with"
target_identifier String string (individual_id) or list of 3 strings (fact)
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_evidence_to_last_fact(evidence_id, source_ids, with_strs, model_idopt) → {request_set}

Adds "anonymous" evidence individual that is referenced in the fact's annotations, as well as a fact of it's own to the batch. *[WARNING: Should only be used once, probably not at all!]*
Parameters:
Name Type Attributes Description
evidence_id String string
source_ids String null, string, or list of strings (PMIDs, etc.)
with_strs String string or list of strings (i.e. "foo"); use null if evidence code does not support "with"
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_evidence_to_last_individual(evidence_id, source_ids, with_strs, model_idopt) → {request_set}

Adds "anonymous" evidence individual that is referenced in the individual's annotations, as well as a fact of it's own to the batch. *[WARNING: Should only be used once, probably not at all!]*
Parameters:
Name Type Attributes Description
evidence_id String string
source_ids String null, string, or list of strings (PMIDs, etc.)
with_strs String string or list of strings (i.e. "foo"); use null if evidence code does not support "with"
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_fact(triple, model_idopt) → {request_set}

Requests necessary to add an edge between two instances in a model. Expect: "success" and "merge".
Parameters:
Name Type Attributes Description
triple Array list of three strings: [SUBJECT_ID, OBJECT_ID, PREDICATE_ID]
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_individual(class_expropt, individual_idopt, model_idopt) → {String}

Requests necessary to add an instance of with type class to the model. Expect: "success" and "merge".
Parameters:
Name Type Attributes Description
class_expr class_expression <optional>
anything that can be taken by constructor; technically optional, but c'mon buddy
individual_id String <optional>
if none given, generate random one (preferred in most use cases); if one given, it's assumed to be a known "forced" one (see {individual})
model_id String <optional>
string
Source:
Returns:
id of individual added, as string
Type
String

add_model(argument_hash) → {request_set}

Essentially a wrapper for the "generate" class of model methods. The possible seeding arguments fir the argument hash are: class-id - *[optional]* string; an initial class to build around taxon-id - *[optional]* string; the background species
Parameters:
Name Type Description
argument_hash Object string (see above for properties)
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

add_type_to_individual(class_expr, individual_id, model_idopt) → {request_set}

Add the identified type to the individual. Multiple calls are logicially treated as an "intersection", but not processed and displayed as such.
Parameters:
Name Type Attributes Description
class_expr class_expression anything that can be taken by constructor
individual_id String string
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

callable() → {Object}

Serialize a request set and the component requests.
Source:
Returns:
serialization of all queued requests
Type
Object

export_all() → {request_set}

Flush all models from the graph store to disk. This method was created to allow development in spite of a copy-paste mistake in upstream code. This will eventually ve deprecated in favor of "store_all".
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

get_meta() → {request_set}

Essentially, get the list of relations.
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

get_model(model_id) → {request_set}

The the state of a model. This *[CANNOT]* be used with any other request.
Parameters:
Name Type Description
model_id String string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

get_undo_redo(model_idopt) → {request_set}

Get the current undo/redo information for a model. This *[CANNOT]* be used with any other request.
Parameters:
Name Type Attributes Description
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

last_individual_id(number_to_skipopt) → {String|null}

Return the ID of the last individual identified in a call (implicitly or explicitly).
Parameters:
Name Type Attributes Description
number_to_skip Number <optional>
number of matches to skip (default: 0)
Source:
See:
  • request_set#last_fact_triple
Returns:
string or null
Type
String | null

last_triple_fact(number_to_skipopt) → {Array|null}

In our model, facts are anonymous (do not have an ID) and need to be referred to by their unique triple: subject id, object id, and predicate (edge type) id. This methods return a list of the three string or null.
Parameters:
Name Type Attributes Description
number_to_skip Number <optional>
number of matches to skip (default: 0)
Source:
See:
  • request_set#last_individual_id
Returns:
list of three strings or null
Type
Array | null

redo_last_model_batch(model_idopt) → {request_set}

Redo the last batch of operations performed on the model.
Parameters:
Name Type Attributes Description
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_annotation_from_fact(key, value, value_typeopt, triple, model_idopt) → {request_set}

Removes unique key/value set from a fact.
Parameters:
Name Type Attributes Description
key String string
value String string
value_type String | null <optional>
string
triple String list of three strings: [SUBJECT_ID, OBJECT_ID, PREDICATE_ID]
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_annotation_from_individual(key, value, value_typeopt, individual_id, model_idopt) → {request_set}

Removes unique key/value set from an individual.
Parameters:
Name Type Attributes Description
key String string
value String string
value_type String | null <optional>
string
individual_id String string
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_annotation_from_model(key, value, value_typeopt, model_idopt) → {request_set}

Adds unique key/value set to model.
Parameters:
Name Type Attributes Description
key String string
value String string
value_type String | null <optional>
string
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_evidence(evidence_individual_id, model_idopt) → {request_set}

Remove an evidence annotation from an individual or edge. Do not need to worry about the "floating" evidence instance made by evidence creation--clean-up will be taken care of by Minerva.
Parameters:
Name Type Attributes Description
evidence_individual_id String string
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_fact(triple, model_idopt) → {request_set}

Requests necessary to remove an edge between two instances in a model. Expect: "success" and "rebuild".
Parameters:
Name Type Attributes Description
triple Array list of three strings: [SUBJECT_ID, OBJECT_ID, PREDICATE_ID]
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_individual(individual_id, model_idopt) → {request_set}

Requests necessary to remove an individual. Expect: "success" and "rebuild".
Parameters:
Name Type Attributes Description
individual_id String string
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

remove_type_from_individual(class_expr, individual_id, model_idopt) → {request_set}

Remove the identified type from the individual.
Parameters:
Name Type Attributes Description
class_expr class_expression anything that can be taken by constructor
individual_id String string
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

store_all() → {request_set}

Flush all models from the graph store to disk. May not work until upstream problem referenced in "export_all" is corrected.
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

store_model(model_idopt) → {request_set}

Store the model to the model store (file on disk as of this writing, but may change soon). I'm not long sure what this exactly does...?
Parameters:
Name Type Attributes Description
model_id String <optional>
string
Deprecated:
  • Yes
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

structure() → {Object}

Create the JSON object that will be passed to the Minerva server.
Source:
Returns:
final object of all queued requests
Type
Object

undo_last_model_batch(model_idopt) → {request_set}

Undo the last batch of operations performed on the model.
Parameters:
Name Type Attributes Description
model_id String <optional>
string
Source:
Returns:
Type
request_set

update_annotations(entity, key, values, val_typeopt, model_idopt) → {request_set}

The purpose here is to update the set of annotations within an entity with a new set of annotations. This process will happen by key and key only (different value-types will be considered the same). Since this takes the entire entity as an argument, it will auto-detect what it is and add the correct ops. I suspect that this will be the Swiss army hammer as it can be used to update, add, and remove annotations in the request set. We are going to ignore the possibility of races.
Parameters:
Name Type Attributes Description
entity Object the enity from {module:bbop-graph-noctua} that you want to probe for annotation information to create the update
key String the key to update
values String string or list of strings
val_type String <optional>
value-type to use, as string; defaults to nothing (an implied string, i.e. "xsd:string"), although not explicitly sent
model_id String <optional>
string
Source:
Returns:
current request set, modified; suitable for chaining
Type
request_set

use_groups(group_listopt) → {Boolean}

Getter/setter to add (or not) a request to use an optional group set. *null* and an empty array resets it to nothing.
Parameters:
Name Type Attributes Description
group_list Array <optional>
optional
Source:
Returns:
bool
Type
Boolean

use_reasoner(boolopt) → {Boolean}

Getter/setter to add (or not) a request to use an optional reasoner.
Parameters:
Name Type Attributes Description
bool Boolean <optional>
optional
Source:
Returns:
bool
Type
Boolean