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.
210 211 212 |
# File 'lib/graphcommons.rb', line 210 def self.delete_graph id self.delete :graphs, :id => id end |
.get_graph(id) ⇒ Object
Get graph by :id.
173 174 175 |
# File 'lib/graphcommons.rb', line 173 def self.get_graph id self.get :graphs, :id => id end |
.get_graph_edges(id, options) ⇒ Object
Get edges inside graph with :id.
187 188 189 190 |
# File 'lib/graphcommons.rb', line 187 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.
195 196 197 198 |
# File 'lib/graphcommons.rb', line 195 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.
180 181 182 |
# File 'lib/graphcommons.rb', line 180 def self.get_graph_types id self.get "graphs/types", :id => id end |
.get_hub(id) ⇒ Object
Get hub by :id.
224 225 226 |
# File 'lib/graphcommons.rb', line 224 def self.get_hub id self.get :hubs, :id => id end |
.get_hub_graphs(id, options) ⇒ Object
Search for graphs inside hub with :id.
246 247 248 249 |
# File 'lib/graphcommons.rb', line 246 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.
254 255 256 257 |
# File 'lib/graphcommons.rb', line 254 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.
238 239 240 241 |
# File 'lib/graphcommons.rb', line 238 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.
231 232 233 |
# File 'lib/graphcommons.rb', line 231 def self.get_hub_types id self.get "hubs/types", :id => id end |
.get_node(id) ⇒ Object
Get node by :id.
217 218 219 |
# File 'lib/graphcommons.rb', line 217 def self.get_node id self.get :nodes, :id => id end |
.new_graph(options) ⇒ Object
Create new graph. Required options: :name
166 167 168 |
# File 'lib/graphcommons.rb', line 166 def self.new_graph self.post :graphs, end |
.status ⇒ Object
Get API status. graphcommons.github.io/api-v1/#get-status
158 159 160 |
# File 'lib/graphcommons.rb', line 158 def self.status self.get :status end |
.update_graph(id, options) ⇒ Object
Modify attributes of graph with :id.
203 204 205 |
# File 'lib/graphcommons.rb', line 203 def self.update_graph id, self.put :graphs, :id => id, :graph=> end |