Class: ShEx::Algebra::Stem

Inherits:
Operator::Unary show all
Defined in:
lib/shex/algebra/stem.rb

Constant Summary collapse

NAME =
:stem

Constants inherited from Operator::Unary

Operator::Unary::ARITY

Constants inherited from Operator

Operator::ARITY

Instance Attribute Summary

Attributes inherited from Operator

#operands, #options, #schema

Instance Method Summary collapse

Methods inherited from Operator::Unary

#initialize

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 a Stem with stem st and nodeIn(n, st).

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
# File 'lib/shex/algebra/stem.rb', line 10

def match?(value)
  if value.start_with?(operands.first)
    status "matched #{value}"
    true
  else
    status "not matched #{value}"
    false
  end
end