Class: ShEx::Algebra::Value
- Inherits:
-
Operator::Unary
- Object
- Operator
- Operator::Unary
- ShEx::Algebra::Value
- Defined in:
- lib/shex/algebra/value.rb
Constant Summary collapse
- NAME =
:value
Constants inherited from Operator::Unary
Constants inherited from Operator
Instance Attribute Summary
Attributes inherited from Operator
Instance Method Summary collapse
-
#match?(value) ⇒ Boolean
For a node n and constraint value v, nodeSatisfies(n, v) if n matches some valueSetValue vsv in v.
Methods inherited from Operator::Unary
Methods inherited from Operator
#closed?, #each_descendant, #eql?, #first_ancestor, #initialize, #inspect, #not_matched, #not_satisfied, #operand, #parent, #parent=, #satisfiable?, #semact?, #semantic_actions, #status, #structure_error, #to_sxp, #to_sxp_bin, #triple_expression?, #validate!
Constructor Details
This class inherits a constructor from ShEx::Algebra::Operator::Unary
Instance Method Details
#match?(value) ⇒ Boolean
For a node n and constraint value v, nodeSatisfies(n, v) if n matches some valueSetValue vsv in v. A term matches a valueSetValue if:
-
vsv is an objectValue and n = vsv.
-
vsv is a Stem with stem st and nodeIn(n, st).
-
vsv is a StemRange with stem st and exclusions excls and nodeIn(n, st) and there is no x in excls such that nodeIn(n, excl).
-
vsv is a Wildcard with exclusions excls and there is no x in excls such that nodeIn(n, excl).
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shex/algebra/value.rb', line 13 def match?(value) status "" if case expr = operands.first when RDF::Value then value.eql?(expr) when Stem, StemRange then expr.match?(value) else false end status "matched #{value}" true else status "not matched #{value}" false end end |