Class: RoadForest::Augment::Process
- Inherits:
-
Object
- Object
- RoadForest::Augment::Process
- Defined in:
- lib/roadforest/augment/augmentation.rb
Instance Attribute Summary collapse
-
#base_graph ⇒ Object
Returns the value of attribute base_graph.
-
#subjects ⇒ Object
Returns the value of attribute subjects.
Instance Method Summary collapse
-
#initialize(base_graph) ⇒ Process
constructor
A new instance of Process.
- #object_resources(router) ⇒ Object
- #objects ⇒ Object
- #subject_resources(router) ⇒ Object
- #target_graph ⇒ Object
Constructor Details
#initialize(base_graph) ⇒ Process
Returns a new instance of Process.
79 80 81 |
# File 'lib/roadforest/augment/augmentation.rb', line 79 def initialize(base_graph) @base_graph = base_graph end |
Instance Attribute Details
#base_graph ⇒ Object
Returns the value of attribute base_graph.
77 78 79 |
# File 'lib/roadforest/augment/augmentation.rb', line 77 def base_graph @base_graph end |
#subjects ⇒ Object
Returns the value of attribute subjects.
77 78 79 |
# File 'lib/roadforest/augment/augmentation.rb', line 77 def subjects @subjects end |
Instance Method Details
#object_resources(router) ⇒ Object
108 109 110 111 112 |
# File 'lib/roadforest/augment/augmentation.rb', line 108 def object_resources(router) objects.map do |uri| LazyResource.new(uri, router) end end |
#objects ⇒ Object
98 99 100 |
# File 'lib/roadforest/augment/augmentation.rb', line 98 def objects @objects ||= base_graph.objects.select{|obj| ::RDF::URI === obj} end |
#subject_resources(router) ⇒ Object
102 103 104 105 106 |
# File 'lib/roadforest/augment/augmentation.rb', line 102 def subject_resources(router) subjects.map do |uri| LazyResource.new(uri, router) end end |
#target_graph ⇒ Object
83 84 85 86 87 88 89 90 91 92 |
# File 'lib/roadforest/augment/augmentation.rb', line 83 def target_graph @target_graph ||= begin ::RDF::Repository.new.tap do |graph| base_graph.each_statement do |stmt| graph << stmt end end end end |