[redland-dev] [Redland Language Bindings 0000513]: SELECT FROM without data file fails with python-bindings

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


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=513 
====================================================================== 
Reported By:                mycircuit at sunrise.ch
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("craigellis at yahoo.com")]
result: [craigEmail=string("c.ellis at usairwaysgroup.com")]
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 mycircuit at sunrise.chNew Issue                                  
 
2012-06-21 14:03 mycircuit at sunrise.chFile Added: no_data.py                     
 
======================================================================



More information about the redland-dev mailing list