Skip to content

ResourceRelationshipDatastore.nucleus

Sebastien Filion edited this page Jun 14, 2018 · 2 revisions

NucleusResourceRelationshipDatastore

Kind: global class

new NucleusResourceRelationshipDatastore($datastore)

Creates a resource relationship datastore. The constructor returns a Proxy that interfaces the class and a Promise that resolves once the server is connected.

Param Type
$datastore NucleusDatastore

nucleusResourceRelationshipDatastore.createRelationshipBetweenSubjectAndObject(subject, predicate, object) ⇒ Promise.<void>

Creates a relationship between the subject and the object.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
subject String
predicate String
object String

nucleusResourceRelationshipDatastore.removeRelationshipBetweenSubjectAndObject(subject, predicate, object) ⇒ Promise

Removes a relationship between a subject and an object.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
subject String | Node
predicate String | Node
object String | Node

nucleusResourceRelationshipDatastore.removeAllRelationshipsToVector(vector) ⇒ Promise

Removes all relationship to the vector.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
vector String | Node

nucleusResourceRelationshipDatastore.retrieveAllRelationshipsForSubject(subject) ⇒ Promise.<{predicate: String, object: Node}>

Retrieves all the relationship for a given subject node.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
subject String | Node | Array.<String> | Array.<Node>

nucleusResourceRelationshipDatastore.retrieveAllNodesByTypeForAnchorNode(nodeType, anchorNode) ⇒ Promise.<Array.<Node>>

Retrieves all nodes by type for an anchor node given its ID.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
nodeType String
anchorNode String | Node

nucleusResourceRelationshipDatastore.retrieveObjectOfRelationshipWithSubject(subject, predicate) ⇒ Promise.<Array>

Retrieves the object of a subject's relationship.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
subject String
predicate String

nucleusResourceRelationshipDatastore.retrieveSubjectOfRelationshipWithObject(object, predicate) ⇒ Promise.<Array>

Retrieves the subject of an object's relationship.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
object String
predicate String

nucleusResourceRelationshipDatastore.parseNode(node) ⇒ Object

Parses a string node to an object node.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
node String

nucleusResourceRelationshipDatastore.validateVectorFormat(vector) ⇒ Boolean

Validates that a vector is a resource type and a resource ID.

Kind: instance method of NucleusResourceRelationshipDatastore

Param Type
vector String
Clone this wiki locally