Class: ShEx::Algebra::ShapeResult
- Inherits:
-
Object
- Object
- ShEx::Algebra::ShapeResult
- Defined in:
- lib/shex/algebra/schema.rb
Overview
A shape result
Instance Attribute Summary collapse
-
#expression ⇒ ShEx::Algebra::Operator
The annotated Operator indicating processing results.
-
#result ⇒ Boolean
Does the node conform to the shape.
-
#shape ⇒ RDF::Resource
readonly
The label of the shape within the schema, or a URI indicating a start shape.
Instance Method Summary collapse
-
#initialize(shape) ⇒ ShapeResult
constructor
Holds the result of processing a shape.
-
#reason ⇒ String
The SXP of #expression.
-
#to_sxp_bin ⇒ Array
Returns the binary S-Expression (SXP) representation of this result.
Constructor Details
#initialize(shape) ⇒ ShapeResult
Holds the result of processing a shape
248 249 250 |
# File 'lib/shex/algebra/schema.rb', line 248 def initialize(shape) @shape = shape end |
Instance Attribute Details
#expression ⇒ ShEx::Algebra::Operator
The annotated Operator indicating processing results
243 244 245 |
# File 'lib/shex/algebra/schema.rb', line 243 def expression @expression end |
#result ⇒ Boolean
Does the node conform to the shape
239 240 241 |
# File 'lib/shex/algebra/schema.rb', line 239 def result @result end |
#shape ⇒ RDF::Resource (readonly)
The label of the shape within the schema, or a URI indicating a start shape
235 236 237 |
# File 'lib/shex/algebra/schema.rb', line 235 def shape @shape end |
Instance Method Details
#reason ⇒ String
The SXP of #expression
254 255 256 |
# File 'lib/shex/algebra/schema.rb', line 254 def reason SXP::Generator.string(expression.to_sxp_bin) end |
#to_sxp_bin ⇒ Array
Returns the binary S-Expression (SXP) representation of this result.
263 264 265 |
# File 'lib/shex/algebra/schema.rb', line 263 def to_sxp_bin [:ShapeResult, shape, result, expression].map(&:to_sxp_bin) end |