Class: Graphcommons::Endpoint
Overview
Wrapper for general methods in the API.
Class Method Summary collapse
-
.delete_graph(id) ⇒ Object
Delete graph with :id.
-
.get_graph(id) ⇒ Object
Get graph by :id.
-
.get_graph_edges(id, options) ⇒ Object
Get edges inside graph with :id.
-
.get_graph_paths(id, options) ⇒ Object
Query for paths inside graph with :id.
-
.get_graph_types(id) ⇒ Object
Get node and edge types inside graph with :id.
-
.get_hub(id) ⇒ Object
Get hub by :id.
-
.get_hub_graphs(id, options) ⇒ Object
Search for graphs inside hub with :id.
-
.get_hub_nodes(id, options) ⇒ Object
Search for nodes inside hub with :id.
-
.get_hub_paths(id, options) ⇒ Object
Query for paths inside hub with :id.
-
.get_hub_types(id) ⇒ Object
Get node and edge types in hub with :id.
-
.get_node(id) ⇒ Object
Get node by :id.
-
.new_graph(options) ⇒ Object
Create new graph.
-
.status ⇒ Object
Get API status.
-
.update_graph(id, options) ⇒ Object
Modify attributes of graph with :id.
Methods inherited from API
check_key, delete, get, post, put, set_key
Class Method Details
.delete_graph(id) ⇒ Object
Delete graph with :id.
220 221 222 |
# File 'lib/graphcommons.rb', line 220 def self.delete_graph id self.delete :graphs, :id => id end |
.get_graph(id) ⇒ Object
Get graph by :id.
182 183 184 |
# File 'lib/graphcommons.rb', line 182 def self.get_graph id self.get :graphs, :id => id end |
.get_graph_edges(id, options) ⇒ Object
Get edges inside graph with :id.
196 197 198 199 |
# File 'lib/graphcommons.rb', line 196 def self.get_graph_edges id, [:id] = id self.get "graphs/edges", end |
.get_graph_paths(id, options) ⇒ Object
Query for paths inside graph with :id.
graphcommons.github.io/api-v1/#get-graphs-id-paths graphcommons.github.io/api-v1/#paths-endpoint-details
205 206 207 208 |
# File 'lib/graphcommons.rb', line 205 def self.get_graph_paths id, [:id] = id self.get "graphs/paths", end |
.get_graph_types(id) ⇒ Object
Get node and edge types inside graph with :id.
189 190 191 |
# File 'lib/graphcommons.rb', line 189 def self.get_graph_types id self.get "graphs/types", :id => id end |
.get_hub(id) ⇒ Object
Get hub by :id.
234 235 236 |
# File 'lib/graphcommons.rb', line 234 def self.get_hub id self.get :hubs, :id => id end |
.get_hub_graphs(id, options) ⇒ Object
Search for graphs inside hub with :id.
257 258 259 260 |
# File 'lib/graphcommons.rb', line 257 def self.get_hub_graphs id, [:id] = id self.get "graphs/search", end |
.get_hub_nodes(id, options) ⇒ Object
Search for nodes inside hub with :id.
265 266 267 268 |
# File 'lib/graphcommons.rb', line 265 def self.get_hub_nodes id, [:id] = id self.get "nodes/search", end |
.get_hub_paths(id, options) ⇒ Object
Query for paths inside hub with :id.
graphcommons.github.io/api-v1/#get-hubs-id-paths graphcommons.github.io/api-v1/#paths-endpoint-details
249 250 251 252 |
# File 'lib/graphcommons.rb', line 249 def self.get_hub_paths id, [:id] = id self.get "hubs/paths", end |
.get_hub_types(id) ⇒ Object
Get node and edge types in hub with :id.
241 242 243 |
# File 'lib/graphcommons.rb', line 241 def self.get_hub_types id self.get "hubs/types", :id => id end |
.get_node(id) ⇒ Object
Get node by :id.
227 228 229 |
# File 'lib/graphcommons.rb', line 227 def self.get_node id self.get :nodes, :id => id end |
.new_graph(options) ⇒ Object
Create new graph. Required options: :name
175 176 177 |
# File 'lib/graphcommons.rb', line 175 def self.new_graph self.post :graphs, end |
.status ⇒ Object
Get API status. graphcommons.github.io/api-v1/#get-status
167 168 169 |
# File 'lib/graphcommons.rb', line 167 def self.status self.get :status end |
.update_graph(id, options) ⇒ Object
Modify attributes of graph with :id.
213 214 215 |
# File 'lib/graphcommons.rb', line 213 def self.update_graph id, self.put :graphs, :id => id, :graph=> end |