Class: ShEx::Algebra::NodeConstraint

Inherits:
Operator
  • Object
show all
Includes:
Satisfiable
Defined in:
lib/shex/algebra/node_constraint.rb

Constant Summary collapse

NAME =
:nodeConstraint

Constants inherited from Operator

Operator::ARITY

Instance Attribute Summary

Attributes inherited from Operator

#operands, #options, #schema

Instance Method Summary collapse

Methods included from Satisfiable

#not_satisfies?, #satisfiable?, #triple_expressions

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

Instance Method Details

#satisfies?(n) ⇒ Boolean

S is a NodeConstraint and satisfies2(n, se) as described below in Node Constraints. Note that testing if a node satisfies a node constraint does not require a graph or shapeMap.

Parameters:

  • n (RDF::Resource)

Returns:

  • (Boolean)

    ‘true` if satisfied, `false` if it does not apply

Raises:



12
13
14
15
16
17
18
19
# File 'lib/shex/algebra/node_constraint.rb', line 12

def satisfies?(n)
  status ""
  satisfies_node_kind?(n) &&
  satisfies_datatype?(n) &&
  satisfies_string_facet?(n) &&
  satisfies_numeric_facet?(n) &&
  satisfies_values?(n)
end