Class: request

minerva-requests~request(entity, operation) → {request}

new request(entity, operation) → {request}

Contructor for a Minerva request item. See table for operation/entity combinations: https://github.com/berkeleybop/bbopx-js/wiki/MinervaRequestAPI . Handle requests to Minerva in a somewhat structured way.
Parameters:
Name Type Description
entity String string, see table
operation String string, see table
Source:
Returns:
request object
Type
request

Methods

add_annotation(key, vals, val_typeopt) → {Number}

Add an annotation pair (or series of pairs) to the request. All annotations should be converted into strings for upstream consumption. You may also add the optional value-type argument.
Parameters:
Name Type Attributes Description
key String string
vals 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
Source:
Returns:
number of annotations
Type
Number

add_set_class_expression(type, class_expr_list) → {Number}

Intersections and unions.
Parameters:
Name Type Description
type String 'intersection' or 'union'
class_expr_list Array a list of anything that can be taken by constructor
Source:
Returns:
number of expressions
Type
Number

add_svf_expression(class_expr, property_id) → {Number}

Function: add_svf_expression Special use. A short form for "addition" requests that can overload the literal (on the server side) with Manchester syntax.
Parameters:
Name Type Description
class_expr class_expression | String anything that can be taken by constructor
property_id String string (id or...something more complicated?)
Source:
Returns:
number of expressions
Type
Number

annotations() → {Array}

Return list of annotations in request.
Source:
Returns:
(actual) list of request "values" pairs (or triples)
Type
Array

class_expression(class_expr, property_id) → {Number}

General use for whatever.
Parameters:
Name Type Description
class_expr class_expression | String anything that can be taken by constructor
property_id String string
Source:
Returns:
number of expressions
Type
Number

entity() → {String|null}

The specified entity string.
Source:
Returns:
string or null
Type
String | null

expressions() → {Array}

Return list of expressions in request.
Source:
Returns:
(actual) list of request "expressions".
Type
Array

fact(sub, obj, pred)

Add a fact to the request. The same as adding subject, object, and predicate all separately.
Parameters:
Name Type Description
sub String string
obj String string
pred String string
Source:
Returns:
n/a

individual(ind_idopt, force_id_popt) → {String}

Get/set the individual/instance in this request. If not set explicitly, will fall back to a default value.
Parameters:
Name Type Attributes Description
ind_id String <optional>
individual id we're going to refer to
force_id_p Boolean <optional>
when an ID is supplied, in the case that the request is being used to create a *new individual* and the ID for it is already known, use ind_id as the IRI; defaults to not true
Source:
Returns:
string
Type
String

model(modelopt) → {String|null}

Get/set the topic model of this request. If a model is not set, like during requests in a set to a not-yet-created model, Minerva will often add this itself if it can after the fact.
Parameters:
Name Type Attributes Description
model String <optional>
a string id
Source:
Returns:
string or null
Type
String | null

object(objopt) → {String|null}

Get/set the object of this request. This will be used in fact/edge requests, but not much else.
Parameters:
Name Type Attributes Description
obj String <optional>
a string
Source:
Returns:
string or null
Type
String | null

objectify() → {Object}

Should only be used in the context of making a request set. Return a higher-level representation/"serialization" of the complete object.
Source:
Returns:
simple object
Type
Object

predicate(predopt) → {String|null}

Get/set the predicate of this request. This will be used in fact/edge requests, but not much else.
Parameters:
Name Type Attributes Description
pred String <optional>
a string
Source:
Returns:
string or null
Type
String | null

special(name, val) → {String}

Add a "special" variable to the request. For a subset of requests, this may be required. See table: https://github.com/berkeleybop/bbopx-js/wiki/MinervaRequestAPI .
Parameters:
Name Type Description
name String string
val String string
Source:
Returns:
added value
Type
String

subject(subopt) → {String|null}

Get/set the subject of this request.
Parameters:
Name Type Attributes Description
sub String <optional>
string
Source:
Returns:
string or null
Type
String | null