ruby-rdf / sparql

Ruby SPARQL library
http://rubygems.org/gems/sparql
The Unlicense
89 stars 14 forks source link

SPARQL Grammar parsing regression on 1.1.7 #21

Closed abrisse closed 9 years ago

abrisse commented 9 years ago

A bug was introduced in sparql 1.1.7. See the script below:

require 'sparql'

query = <<-eos
  PREFIX ext:<http://ext.com/1.0#>

  CONSTRUCT {
      ?x ?prop ?obj .
      ?obj rdf:type ext:Subject .
    }
    WHERE {
      ?x rdf:type ext:Subject ;
        ?prop ?obj .
    }
eos

SPARQL::Grammar.parse(query).to_sxp

1.1.6 - OK

(prefix ((ext: <http://ext.com/1.0#>)) (construct ((triple ?x ?prop ?obj) (triple ?obj rdf:type ext:Subject)) (bgp (triple ?x rdf:type ext:Subject) (triple ?x ?prop ?obj))))

1.1.7 - KO

(prefix ((ext: <http://ext.com/1.0#>)) (construct ((triple ?x ?prop ?obj) (triple ?obj rdf:type ext:Subject)) (bgp (triple ?x rdf:type ext:Subject) (triple ?x <type[#<RDF::Query::Variable:0x1fa12b0(?prop)>]> ?obj))))

gkellogg commented 9 years ago

See if that fixes the issue you're seeing and I'll push out 1.1.8.

abrisse commented 9 years ago

@gkellogg :+1: