Class: Graphcommons::Signal
Overview
Changes to the nodes and edges of a graph are carried out by a series of commands called signals in the request body. With these signals you can add, update or delete nodes, edges, node types and edge types.
Mind that :id
parameter is required in all calls.
Class Method Summary collapse
-
.edge_create(id, options) ⇒ Object
This signal type is used for creating edges.
-
.edge_delete(id, options) ⇒ Object
This signal type is used for deleting edges.
-
.edge_update(id, options) ⇒ Object
This signal type is used for updating an edge.
- .edgetype_delete(id, options) ⇒ Object
- .edgetype_update(id, options) ⇒ Object
-
.node_create(id, options) ⇒ Object
This signal type is used for creating nodes.
-
.node_delete(id, options) ⇒ Object
This signal type is used for deleting nodes.
-
.node_update(id, options) ⇒ Object
This signal type is used for updating a node.
- .nodetype_delete(id, options) ⇒ Object
- .nodetype_update(id, options) ⇒ Object
Methods inherited from API
check_key, delete, get, post, put, set_key
Class Method Details
.edge_create(id, options) ⇒ Object
This signal type is used for creating edges. Source and target nodes for the edge will be created if they don’t already exist. Only one instance of edgetype is allowed between the same nodes. However, there could be multiple edges between the same node pair, as long as the their edge types are different.
Upon saving this signal a new edge id is created. The type of the edge is matched with a predefined edge type from the hub/graph. If the edge type does not already exist, a new edge type is created.
Required options: :from_type
, :from_name
, :to_type
, :to_name
, :name
307 308 309 310 |
# File 'lib/graphcommons.rb', line 307 def self.edge_create id, [:action] = :edge_create self._signal id, end |
.edge_delete(id, options) ⇒ Object
This signal type is used for deleting edges.
343 344 345 346 |
# File 'lib/graphcommons.rb', line 343 def self.edge_delete id, [:action] = :edge_delete self._signal id, end |
.edge_update(id, options) ⇒ Object
This signal type is used for updating an edge. All fields except for id will be updated in the node.
Required options: :from
, :to
327 328 329 330 |
# File 'lib/graphcommons.rb', line 327 def self.edge_update id, [:action] = :edge_update self._signal id, end |
.edgetype_delete(id, options) ⇒ Object
367 368 369 370 |
# File 'lib/graphcommons.rb', line 367 def self.edgetype_delete id, [:action] = :edgetype_delete self._signal id, end |
.edgetype_update(id, options) ⇒ Object
355 356 357 358 |
# File 'lib/graphcommons.rb', line 355 def self.edgetype_update id, [:action] = :edgetype_update self._signal id, end |
.node_create(id, options) ⇒ Object
This signal type is used for creating nodes. All signals of this type must define a type and name key. type - name pairs must be unique.
Upon saving this signal, a new node id is created. The type of the node is matched with a predefined node type from the hub/graph. If the node type does not already exist, a node type is created.
Required options: :name
, :type
289 290 291 292 |
# File 'lib/graphcommons.rb', line 289 def self.node_create id, [:action] = :node_create self._signal id, end |
.node_delete(id, options) ⇒ Object
This signal type is used for deleting nodes.
335 336 337 338 |
# File 'lib/graphcommons.rb', line 335 def self.node_delete id, [:action] = :node_delete self._signal id, end |
.node_update(id, options) ⇒ Object
This signal type is used for updating a node. All fields except for id will be updated in the node.
316 317 318 319 |
# File 'lib/graphcommons.rb', line 316 def self.node_update id, [:action] = :node_update self._signal id, end |
.nodetype_delete(id, options) ⇒ Object
361 362 363 364 |
# File 'lib/graphcommons.rb', line 361 def self.nodetype_delete id, [:action] = :nodetype_delete self._signal id, end |
.nodetype_update(id, options) ⇒ Object
349 350 351 352 |
# File 'lib/graphcommons.rb', line 349 def self.nodetype_update id, [:action] = :nodetype_update self._signal id, end |