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
Returns a new instance of LoosePropertySelector.
91 92 93 |
# File 'lib/ldpath/selectors.rb', line 91 def initialize(property) @property = property end |
Instance Attribute Details
#property ⇒ Object (readonly)
Returns the value of attribute property.
90 91 92 |
# File 'lib/ldpath/selectors.rb', line 90 def property @property end |
Instance Method Details
#evaluate_one(uri, context) ⇒ Object
95 96 97 98 99 100 101 |
# File 'lib/ldpath/selectors.rb', line 95 def evaluate_one(uri, context) return PropertySelector.new(property).evaluate_one(uri_context) unless defined? RDF::Reasoner context.query([uri, nil, nil]).lazy.select do |result| result.predicate.entail(:subPropertyOf).include? property end.map(&:object) end |