Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the RDF-Query CPAN distribution.

Report information
The Basics
Id: 62694
Status: patched
Priority: 0/
Queue: RDF-Query

People
Owner: gwilliams [...] cpan.org
Requestors: ONEGRAY [...] cpan.org
oneingray [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Ivan Shmakov <oneingray [...] gmail.com>
Subject: property paths going crazy?
Date: Thu, 04 Nov 2010 18:14:21 +0600
To: bug-RDF-Query [...] rt.cpan.org
From: Ivan Shmakov <ivan [...] main.uusia.org>
[Versions: RDF-Query-2.902.tar.gz, with RDF-Trine-0.130.tar.gz.] Following the example in [1], I'm trying to SELECT all the elements of the ex:odd list from the following dataset: --cut-- @base <x-dummy:uri> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <http://example.com/#> . ex:odd rdf:value (1 3 5 7) . ex:even rdf:value (2 4 6 8) . --cut-- My query is: --cut-- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ex: <http://example.com/#> SELECT ?elt WHERE { ex:odd rdf:value/rdf:rest*/rdf:first ?elt . } --cut-- Contrary to my expectations, I get a whole lot of results, including the elements of /both/ lists, and not just ex:odd! (A simplistic wrapper over RDF::Query, rdf-query.pl, is MIME'd.) $ perl rdf-query.pl data.turtle "$(cat < query.sparql)" elt "1"^^<http://www.w3.org/2001/XMLSchema#integer> elt "3"^^<http://www.w3.org/2001/XMLSchema#integer> elt "5"^^<http://www.w3.org/2001/XMLSchema#integer> elt "6"^^<http://www.w3.org/2001/XMLSchema#integer> ## ... 1950 more results... elt "8"^^<http://www.w3.org/2001/XMLSchema#integer> elt "3"^^<http://www.w3.org/2001/XMLSchema#integer> elt "4"^^<http://www.w3.org/2001/XMLSchema#integer> elt "7"^^<http://www.w3.org/2001/XMLSchema#integer> $ [1] http://www.w3.org/TR/sparql11-query/#propertypath-examples -- FSF associate member #7257
### rdf-query-2010-11-04.pl -*- Perl -*- use strict; use warnings; require RDF::Query; require RDF::Trine::Model; require RDF::Trine::Store::Memory; die ("Usage: rdf-query-2010-11-04 TURTLE-FILE QUERY") unless (1 + $#ARGV == 2); my ($file, $sparql) = @ARGV; my $store = RDF::Trine::Store->new_with_config ({ "storetype" => "Memory", "sources" => [ { "file" => $file, "syntax" => "turtle", "base_uri" => "x-dummy:uri" } ] }); my $model = new RDF::Trine::Model ($store); my $query = RDF::Query->new ($sparql); for (my $iterator = $query->execute ($model); my $row = $iterator->next (); ) { foreach my $k (keys (%$row)) { print (" ", $k, " ", $row->{$k}); } print ("\n"); } ## Local variables: ## fill-column: 72 ## indent-tabs-mode: nil ## End: ### rdf-query-2010-11-04.pl ends here
Download (untitled)
application/pgp-signature 196b

Message body not shown because it is not plain text.

Thanks for the bug report. I've confirmed that it's still a problem in the most recent version of the code -- a very strange bug. I'm looking into it and will let you know when I have more details. thanks, .greg
RT-Send-CC: ivan [...] main.uusia.org
Ivan, I believe I've found the source of this bug. I've applied a patch to fix it in github and it will appear in the next release of RDF::Query on CPAN (2.904). thanks, .greg