Class: SPARQL::Algebra::Operator::BGP

Inherits:
Operator
  • Object
show all
Defined in:
lib/sparql/algebra/operator/bgp.rb

Overview

The SPARQL GraphPattern bgp operator.

Query with graph_name set to false.

Examples:

SPARQL Grammar

PREFIX : <http://example/>
SELECT * { ?s ?p ?o }

SSE

(prefix ((: <http://example/>))
  (bgp (triple ?s ?p ?o)))

SPARQL Grammar (sparql-star)

PREFIX : <http://example.com/ns#>
SELECT * {<< :a :b :c ~ :r >> :p1 :o1.}

SSE (sparql-star)

(prefix
 ((: <http://example.com/ns#>))
 (bgp
  (triple :r <http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies>
   (qtriple :a :b :c))
  (triple :r :p1 :o1)))

See Also:

Constant Summary collapse

NAME =
[:bgp]

Class Method Summary collapse

Class Method Details

.self.new(*patterns) ⇒ RDF::Query

A graph is an RDF::Query with a graph_name.

Parameters:

Yields:

  • (solution)

    each matching solution

Yield Parameters:

Yield Returns:

  • (void)

    ignored

Returns:



41
42
43
# File 'lib/sparql/algebra/operator/bgp.rb', line 41

def self.new(*patterns, **options, &block)
  RDF::Query.new(*patterns, graph_name: false, &block)
end