The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=513 
====================================================================== 
Reported By:                [email protected]
Assigned To:                
====================================================================== 
Project:                    Redland Language Bindings
Issue ID:                   513
Category:                   api
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Binding Language (java, perl, php, python, ruby, tcl): python 
====================================================================== 
Date Submitted:             2012-06-21 14:03
Last Modified:              2012-06-21 14:03
====================================================================== 
Summary:                    SELECT FROM without data file fails with
python-bindings
Description: 
The following query:

    PREFIX ab: <http://learningsparql.com/ns/addressbook#> 
    
    SELECT ?craigEmail FROM <ex002.ttl>
    WHERE
    { ab:craig ab:email ?craigEmail . }

with roqet produces:

roqet: Querying from file ex007.rq
roqet: Query has a variable bindings result
result: [craigEmail=string("[email protected]")]
result: [craigEmail=string("[email protected]")]
roqet: Query returned 2 results

as expected.
However, the following python code produces no output ( that is no results):

#!/usr/bin/python

import RDF

test_query= \
  """
  # filename: ex007.rq

    PREFIX ab: <http://learningsparql.com/ns/addressbook#> 
    
    SELECT ?craigEmail FROM <ex002.ttl>
    WHERE
    { ab:craig ab:email ?craigEmail . }

  """

storage=RDF.Storage(storage_name="hashes", name="test",
options_string="new='yes',hash-type='memory',dir='.'")
if storage is None:  raise "new RDF.Storage failed"
model=RDF.Model(storage)
if model is None:  raise "new RDF.model failed"


q = RDF.SPARQLQuery(test_query)

for result in q.execute(model):
  print "{"
  for k in result:
    print "  "+k+" = "+str(result[k])
  print "}"

Steps to Reproduce: 
run the above script 

Additional Information: 
raptor2-2.0.7
rasqal-0.9.29
redland-1.0.15 
redland-bindings-1.0.14.1

all compiled from source
other queries with RDF work as expected, so the overall install should be OK
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-21 14:03 [email protected] Issue                                  
 
2012-06-21 14:03 [email protected] Added: no_data.py                     
 
======================================================================

_______________________________________________
redland-dev mailing list
[email protected]
http://lists.librdf.org/mailman/listinfo/redland-dev

Reply via email to