Module: LD::Patch

Defined in:
lib/ld/patch.rb,
lib/ld/patch/format.rb,
lib/ld/patch/parser.rb,
lib/ld/patch/algebra.rb,
lib/ld/patch/terminals.rb

Overview

LD::Patch is a Linked Data Patch extension for RDF.rb.

Author:

Defined Under Namespace

Modules: Algebra, Meta, Terminals, VERSION Classes: Error, Format, ParseError, Parser

Class Method Summary collapse

Class Method Details

.parse(input, **options) ⇒ SPARQL::Algebra::Operator

Parse the given LD Patch input string.

Examples:

query = LD::Patch.parse("Add { <http://example.org/s2> <http://example.org/p2> <http://example.org/o2> } .")

Parameters:

  • input (IO, StringIO, String, #to_s)
  • options (Hash{Symbol => Object})

Options Hash (**options):

  • :base_uri (#to_s) — default: nil

    the base URI to use when resolving relative URIs

  • :base_uri (#to_s) — default: nil

    the base URI to use when resolving relative URIs

  • :anon_base (#to_s) — default: "b0"

    Basis for generating anonymous Nodes

  • :resolve_iris (Boolean) — default: false

    Resolve prefix and relative IRIs, otherwise, when serializing the parsed SSE as S-Expressions, use the original prefixed and relative URIs along with base and prefix definitions.

  • :validate (Boolean) — default: false

    whether to validate the parsed statements and values

  • :errors (Array)

    array for placing errors found when parsing

  • :warnings (Array)

    array for placing warnings found when parsing

  • :progress (Boolean)

    Show progress of parser productions

  • :debug (Boolean)

    Detailed debug output

Returns:

  • (SPARQL::Algebra::Operator)

    The executable parsed Patch



31
32
33
# File 'lib/ld/patch.rb', line 31

def self.parse(input, **options)
  LD::Patch::Parser.new(input, **options).parse
end