kasei / perlrdf

Deprecated in favor of the Attean package
26 stars 25 forks source link

RDF::Query: broken local name if prefixes overlap #135

Closed nichtich closed 8 years ago

nichtich commented 8 years ago
use v5.14;
use RDF::Query;
say RDF::Query->new(join "", <DATA>)->as_sparql;
__DATA__
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
SELECT * WHERE {
    ?id p:P1549 ?statement .
    ?statement ps:P1549 ?label .
}

Expect query as given above but got:

PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
SELECT * WHERE {
    ?id p:P1549 ?statement .
    ?statement p:statement/P1549 ?label .
}

which is invalid because p:statement/P1549 is not IRI and should be ps:P1549.

I am sorry to say: RDF::Query is great for query execution but seems to be a bit too buggy for my use case (parsing, inspecting and pretty-printing SPARQL queries). Do you plan to create a new SPARQL parser as part of Attean? I'd prefer to split SPARQL parsing and serialization from SPARQL execution. Thanks anyway!

kasei commented 8 years ago

Hi Jakob. Really sorry to hear this. I'll be committing a fix for this, but can appreciate that you've been finding quite a few bugs, and am sorry about that.

I've actually been working on a new SPARQL parser for Attean in the last few days, but a few thoughts I think are relevant:

Let me know if I can be of any further help.

best, .greg

nichtich commented 8 years ago

Thanks for fixing, you were right this was a serializing issue. Anyway, could you please release a new version of RDF::Query including this fix?

kasei commented 8 years ago

Sure. I've uploaded a beta of RDF::Query 2.917 to CPAN, and will release a full version as soon as I see successful reports from cpan-testers.