[redland-dev] [Rasqal RDF Query Library 0000514]: NOT EXISTS and MINUS do not work in SPARQL

Mantis Bug Tracker mantis-bug-sender at librdf.org
Thu Jun 21 10:17:19 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=514 
====================================================================== 
Reported By:                mycircuit at sunrise.ch
Assigned To:                
====================================================================== 
Project:                    Rasqal RDF Query Library
Issue ID:                   514
Category:                   query engine
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Query Language:             sparql11 
====================================================================== 
Date Submitted:             2012-06-21 14:17
Last Modified:              2012-06-21 14:17
====================================================================== 
Summary:                    NOT EXISTS and MINUS do not work in SPARQL
Description: 
the keywords NOT EXISTS and MINUS seem not work, neither in roqet nor from
within python.


Steps to Reproduce: 
Given this data:
# filename: ex054.ttl

@prefix ab: <http://learningsparql.com/ns/addressbook#> .
@prefix d:  <http://learningsparql.com/ns/data#> .

d:i0432 ab:firstName "Richard" . 
d:i0432 ab:lastName  "Mutt" . 
d:i0432 ab:homeTel   "(229) 276-5135" . 
d:i0432 ab:nick      "Dick" .
d:i0432 ab:email     "richard49 at hotmail.com" . 

d:i9771 ab:firstName "Cindy" . 
d:i9771 ab:lastName  "Marshall" . 
d:i9771 ab:homeTel   "(245) 646-5488" . 
d:i9771 ab:email     "cindym at gmail.com" . 

d:i8301 ab:firstName "Craig" . 
d:i8301 ab:lastName  "Ellis" . 
d:i8301 ab:workTel   "(245) 315-5486" .
d:i8301 ab:email     "craigellis at yahoo.com" . 
d:i8301 ab:email     "c.ellis at usairwaysgroup.com" . 

and this query:
# filename: ex067.rq

PREFIX ab: <http://learningsparql.com/ns/addressbook#> 

SELECT ?first ?last 

WHERE
{
  ?s ab:firstName ?first ;
     ab:lastName ?last .
  NOT EXISTS { ?s ab:workTel ?workNum }
}

The expected result ( validated with arq ) should be:
--------------------------
| first     | last       |
==========================
| "Cindy"   | "Marshall" |
| "Richard" | "Mutt"     |
--------------------------

but roqet returns:

% roqet  --data ex054.ttl ex067.rq
roqet: Querying from file ex067.rq
roqet: Error - URI
file:///home/p/git/py/exp/modules/semweb/redland/bugs/ex067.rq:11 - syntax
error, unexpected NOT, expecting '}'

with MINUS instead of NOT EXISTS:
$roqet  --data ex054.ttl ex067.rq
roqet: Querying from file ex067.rq
roqet: Query execution failed

Additional Information: 

run roqet with the provide data and query
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-21 14:17 mycircuit at sunrise.chNew Issue                                  
 
2012-06-21 14:17 mycircuit at sunrise.chFile Added: ex054.ttl                      
 
======================================================================



More information about the redland-dev mailing list