Class: RDF::Query

Inherits:
Object show all
Defined in:
lib/sparql/algebra/extensions.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Equivalence for Queries: Same Patterns Same Context

Returns:

  • (Boolean)


184
185
186
# File 'lib/sparql/algebra/extensions.rb', line 184

def ==(other)
  other.is_a?(RDF::Query) && patterns == other.patterns && context == context
end

#to_sseArray

Transform Query into an Array form of an SSE

If Query is named, it's treated as a GroupGraphPattern, otherwise, a BGP

Returns:



193
194
195
196
# File 'lib/sparql/algebra/extensions.rb', line 193

def to_sse
  res = [:bgp] + patterns.map(&:to_sse)
  (context ? [:graph, context, res] : res)
end