Module: RoadForest::Graph::Helpers::Focus

Included in:
Payloads, Interface::RDF
Defined in:
lib/roadforest/interface/rdf.rb

Instance Method Summary collapse

Instance Method Details

#start_focus(graph = nil, resource_url = nil) {|focus| ... } ⇒ Object

Yields:

  • (focus)


9
10
11
12
13
14
15
16
17
# File 'lib/roadforest/interface/rdf.rb', line 9

def start_focus(graph = nil, resource_url=nil)
  graph ||= ::RDF::Graph.new
  access = RoadForest::Graph::WriteManager.new
  access.source_graph = graph
  focus = RoadForest::Graph::GraphFocus.new(access, resource_url || my_url)

  yield focus if block_given?
  return graph
end