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
255 256 257 |
# File 'lib/shex/algebra/schema.rb', line 255 def initialize(shape) @shape = shape end |
Instance Attribute Details
#expression ⇒ ShEx::Algebra::Operator
The annotated Operator indicating processing results
250 251 252 |
# File 'lib/shex/algebra/schema.rb', line 250 def expression @expression end |
#result ⇒ Boolean
Does the node conform to the shape
246 247 248 |
# File 'lib/shex/algebra/schema.rb', line 246 def result @result end |
#shape ⇒ RDF::Resource (readonly)
The label of the shape within the schema, or a URI indicating a start shape
242 243 244 |
# File 'lib/shex/algebra/schema.rb', line 242 def shape @shape end |
Instance Method Details
#reason ⇒ String
The SXP of #expression
261 262 263 |
# File 'lib/shex/algebra/schema.rb', line 261 def reason SXP::Generator.string(expression.to_sxp_bin) end |
#to_sxp_bin ⇒ Array
Returns the binary S-Expression (SXP) representation of this result.
270 271 272 |
# File 'lib/shex/algebra/schema.rb', line 270 def to_sxp_bin [:ShapeResult, shape, result, expression].map(&:to_sxp_bin) end |