Class: Ldpath::LoosePropertySelector
- Defined in:
- lib/ldpath/selectors.rb
Instance Attribute Summary collapse
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
- #evaluate_one(uri, context) ⇒ Object
-
#initialize(property) ⇒ LoosePropertySelector
constructor
A new instance of LoosePropertySelector.
Methods inherited from Selector
Constructor Details
#initialize(property) ⇒ LoosePropertySelector
58 59 60 |
# File 'lib/ldpath/selectors.rb', line 58 def initialize(property) @property = property end |
Instance Attribute Details
#property ⇒ Object (readonly)
Returns the value of attribute property.
57 58 59 |
# File 'lib/ldpath/selectors.rb', line 57 def property @property end |
Instance Method Details
#evaluate_one(uri, context) ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/ldpath/selectors.rb', line 62 def evaluate_one(uri, context) return PropertySelector.new(property).evaluate_one(uri_context) unless defined? RDF::Reasoner context.query([uri, nil, nil]).select do |result| result.predicate.entail(:subPropertyOf).include? property end.map(&:object) end |