Class: Ldpath::TapSelector
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#tap ⇒ Object
readonly
Returns the value of attribute tap.
Instance Method Summary collapse
- #evaluate(program, uris, context) ⇒ Object
- #evaluate_one(uri, context) ⇒ Object
-
#initialize(identifier, tap) ⇒ TapSelector
constructor
A new instance of TapSelector.
Methods inherited from Selector
Constructor Details
#initialize(identifier, tap) ⇒ TapSelector
Returns a new instance of TapSelector.
141 142 143 144 |
# File 'lib/ldpath/selectors.rb', line 141 def initialize(identifier, tap) @identifier = identifier @tap = tap end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
140 141 142 |
# File 'lib/ldpath/selectors.rb', line 140 def identifier @identifier end |
#tap ⇒ Object (readonly)
Returns the value of attribute tap.
140 141 142 |
# File 'lib/ldpath/selectors.rb', line 140 def tap @tap end |
Instance Method Details
#evaluate(program, uris, context) ⇒ Object
146 147 148 149 150 151 152 153 |
# File 'lib/ldpath/selectors.rb', line 146 def evaluate(program, uris, context) program.[identifier] = tap.evaluate(program, uris, context).map { |x| RDF::Literal.new(x.to_s).canonicalize.object } Array(uris).map do |uri| loading program, uri, context evaluate_one uri, context end.flatten.compact end |
#evaluate_one(uri, context) ⇒ Object
155 156 157 |
# File 'lib/ldpath/selectors.rb', line 155 def evaluate_one(uri, context) uri end |