Module: LazyGraph

Defined in:
lib/lazy_graph.rb,
lib/lazy_graph/node.rb,
lib/lazy_graph/graph.rb,
lib/lazy_graph/server.rb,
lib/lazy_graph/builder.rb,
lib/lazy_graph/context.rb,
lib/lazy_graph/version.rb,
lib/lazy_graph/hash_utils.rb,
lib/lazy_graph/builder/dsl.rb,
lib/lazy_graph/path_parser.rb,
lib/lazy_graph/builder_group.rb,
lib/lazy_graph/missing_value.rb,
lib/lazy_graph/stack_pointer.rb,
lib/lazy_graph/node/array_node.rb,
lib/lazy_graph/node/object_node.rb,
lib/lazy_graph/node/symbol_hash.rb,
lib/lazy_graph/path_parser/path.rb,
lib/lazy_graph/node/derived_rules.rb,
lib/lazy_graph/node/node_properties.rb,
lib/lazy_graph/path_parser/path_part.rb,
lib/lazy_graph/path_parser/path_group.rb

Overview

LazyGraph supports a bespoke path structure for querying a LazyGraph. It has some overlap with

  • JSON path (but supports querying a subset of object properties), and

  • GraphQL (but it supports direct references to deeply nested properties without preserving structure)/

Example query paths and outputs

“employees” => [{…whole object…, object…]} “employees” => [{ “id”: “3”, “name”: “John Smith, { ”id“: ”4“, ”name“: ”Jane Smith}]} “employees => [{…whole object…, object…]}” “employees => [{…whole object…, object…]}”

Defined Under Namespace

Modules: HashUtils, NodeProperties, PathParser Classes: AbortError, ArrayNode, Builder, BuilderGroup, Context, Graph, MissingValue, Node, ObjectNode, Server, StackPointer

Constant Summary collapse

DIGIT_REGEXP =
/^-?\d+$/
SAFE_TOKEN_REGEXP =
/^[A-Za-z][A-Za-z0-9]*$/
PROPERTY_CLASSES =
Hash.new do |h, members|
  h[members] = LazyGraph.const_set("NodeProperties#{h.hash.abs}", NodeProperties.build(**members))
end
VALIDATION_CACHE =

Represents a lazy graph structure based on JSON schema

{}
METASCHEMA =
JSON.load_file(File.join(__dir__, 'lazy-graph.json'))
VERSION =
'0.1.3'
POINTER_POOL =

Module to provide lazy graph functionalities using stack pointers.

[]

Class Attribute Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



16
17
18
# File 'lib/lazy_graph.rb', line 16

def logger
  @logger
end