[redland-dev] [Rasqal RDF Query Library 0000400]: SPARQL query requires URIs with scheme component

Mantis Bug Tracker mantis-bug-sender at librdf.org
Mon Nov 29 05:00:22 CET 2010


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=400 
====================================================================== 
Reported By:                dbrnz
Assigned To:                
====================================================================== 
Project:                    Rasqal RDF Query Library
Issue ID:                   400
Category:                   query engine
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Query Language:             SPARQL 
====================================================================== 
Date Submitted:             2010-11-29 04:00
Last Modified:              2010-11-29 04:00
====================================================================== 
Summary:                    SPARQL query requires URIs with scheme component
Description: 
Even though URIs in the form <source> can be used to construct models, and those
statements found by using place-holders in a SPARQL query, they are not found by
a specific query giving the URI. URIs in the form
<http://www.example.org/ontology#source> work just fine. 








Steps to Reproduce: 
The following Python code illustrates the problem:

from RDF import *

par = NTriplesParser()
m = Model()
par.parse_string_into_model(m, """<http://www.ex.org/ont#source>
<http://www.ex.org/ont#p1> "44" .\n<s> <p> "v" .\n""", Uri('base'))

q = SPARQLQuery('select ?s ?p ?o  where { ?s ?p ?o }')
for a in m.execute(q): print a['s'], a['p'], a['o']
# Prints as expected:
#   <http://www.ex.org/ont#source> <http://www.ex.org/ont#p1> "44"
#   <s> <p> "v"

q = SPARQLQuery('select ?s  ?o  where { ?s <http://www.ex.org/ont#p1>  ?o }')
for a in m.execute(q): print a['s'],  a['o']
# Prints as expected:
#   <http://www.ex.org/ont#source> "44"

q = SPARQLQuery('select ?s  ?o  where { ?s <p>  ?o }')
for a in m.execute(q): print a['s'],  a['o']
# Nothing printed (expected <p> "v")

# Whereas:
for s in m.find_statements(Statement(None, Uri('p'), None)):
  print s.subject, s.object
# Prints as expected:
#   <p> "v"

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-11-29 04:00 dbrnz          New Issue                                    
======================================================================



More information about the redland-dev mailing list