lib/sparql/grammar/parser11.rb in sparql-2.1.0 vs lib/sparql/grammar/parser11.rb in sparql-2.2.0
- old
+ new
@@ -605,10 +605,16 @@
if !Array(data[:pattern]).empty?
query = SPARQL::Algebra::Operator::BGP.new
Array(data[:pattern]).each {|p| query << p}
# Append triples from ('.' TriplesBlock? )?
- Array(data[:query]).each {|q| query += q}
+ Array(data[:query]).each do |q|
+ if q.respond_to?(:patterns)
+ query += q
+ else
+ query = SPARQL::Algebra::Operator::Join.new(query, q)
+ end
+ end
if (lhs = (input.delete(:query) || []).first) && !lhs.empty?
query = SPARQL::Algebra::Expression.for(:join, lhs, query)
end
add_prod_datum(:query, query)
else