Client to the datastore-backend.
gem install graph-client
# connect to local
client = Graph::Client.new('http://graph-backend.dev')
client.uuids_by_role(token, role)
client.add_role(uuid, token, 'developer')
client.remove_role(uuid, token, 'developer')
client.related?(uuid1, uuid2, token, 'develops')
Returns a Hash with the meta data or nil if the relationship does not exist.
client.relationship_metadata(uuid1, uuid2, token, 'develops')
Returns normal information on the relationship. The same data you get when adding a relationship.
client.change_relationship(uuid1, uuid2, token, 'develops', {location: "Berlin"})
options = {direction: 'both'}
client.add_relationship(uuid1, uuid2, token, 'develops', options)
Available options:
- direction: Direction of the relationship. Possible values:
outgoing
(default),incoming
andboth
- meta: Meta information to this relationship. Must be a shallow, one level deep hash (works:
{location: 'Rome'}
does not work:{location: {city: 'Rome'}}
).
client.query(token, [player_uuid], "MATCH node0-[:friends]->()-[:friends]->fof RETURN fof.uuid")
client.remove_relationship(uuid1, uuid2, token, 'develops')
client.list_related_entities(uuid, token, 'develops', options) # => [uuid1, uuid2]
Available options:
- direction: Direction of the relationships. Possible values:
outgoing
(default),incoming
andboth
client.delete_entity(uuid, token)