Module: ShEx::Algebra
- Defined in:
- lib/shex/algebra.rb,
lib/shex/algebra/or.rb,
lib/shex/algebra/and.rb,
lib/shex/algebra/not.rb,
lib/shex/algebra/stem.rb,
lib/shex/algebra/shape.rb,
lib/shex/algebra/start.rb,
lib/shex/algebra/value.rb,
lib/shex/algebra/one_of.rb,
lib/shex/algebra/schema.rb,
lib/shex/algebra/semact.rb,
lib/shex/algebra/each_of.rb,
lib/shex/algebra/external.rb,
lib/shex/algebra/operator.rb,
lib/shex/algebra/inclusion.rb,
lib/shex/algebra/shape_ref.rb,
lib/shex/algebra/annotation.rb,
lib/shex/algebra/stem_range.rb,
lib/shex/algebra/satisfiable.rb,
lib/shex/algebra/node_constraint.rb,
lib/shex/algebra/triple_constraint.rb,
lib/shex/algebra/triple_expression.rb
Overview
Based on the SPARQL Algebra, operators for executing a patch
Defined Under Namespace
Modules: ReferencedStatement, Satisfiable, TripleExpression Classes: And, Annotation, EachOf, External, Inclusion, NodeConstraint, Not, OneOf, Operator, Or, Schema, SemAct, Shape, ShapeRef, Start, Stem, StemRange, TripleConstraint, Value
Class Method Summary collapse
-
.from_shexj(operator, options = {}) ⇒ Operator
Creates an operator instance from a parsed ShExJ representation.
Class Method Details
.from_shexj(operator, options = {}) ⇒ Operator
Creates an operator instance from a parsed ShExJ representation
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/shex/algebra.rb', line 48 def self.from_shexj(operator, = {}) raise ArgumentError unless operator.is_a?(Hash) klass = case operator['type'] when 'Annotation' then Annotation when 'EachOf' then EachOf when 'Inclusion' then Inclusion when 'NodeConstraint' then NodeConstraint when 'OneOf' then OneOf when 'Schema' then Schema when 'SemAct' then SemAct when 'Shape' then Shape when 'ShapeAnd' then And when 'ShapeNot' then Not when 'ShapeOr' then Or when 'ShapeRef' then ShapeRef when 'Stem' then Stem when 'StemRange' then StemRange when 'TripleConstraint' then TripleConstraint when 'Wildcard' then StemRange else raise ArgumentError, "unknown type #{operator['type']}" end klass.from_shexj(operator, ) end |