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.
102 103 104 105 106 |
# File 'lib/ldpath/selectors.rb', line 102 def initialize(property) @property = property super end |
Instance Attribute Details
#property ⇒ Object (readonly)
Returns the value of attribute property.
100 101 102 |
# File 'lib/ldpath/selectors.rb', line 100 def property @property end |
Instance Method Details
#evaluate_one(uri, context) ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/ldpath/selectors.rb', line 108 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 |