Sha256: 9212c7fb6e9b4c6c789d13ee0da272281219605e69da67c44d71eaffb0ab5757

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

module ShEx::Algebra
  ##
  class External < Operator
    include Satisfiable
    NAME = :external

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shex-0.1.0 lib/shex/algebra/external.rb