Class: ShEx::Algebra::External

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

Constant Summary collapse

NAME =
:external

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 ShapeRef and the Schema’s shapes maps reference to a shape expression se2 and satisfies(n, se2, G, m).

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/shex/algebra/external.rb', line 9

def satisfies?(n)
  extern_shape = nil

  # Find the label for this external
  label = schema.shapes.key(self)
  not_satisfied("Can't find label for this extern") unless label

  schema.external_schemas.each do |schema|
    extern_shape ||= schema.shapes[label]
  end

  not_satisfied("External not configured for this shape") unless extern_shape
  extern_shape.satisfies?(n)
end