walidazizi / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

SPARQL query with "OPTIONAL" triggers error in mysql backend #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Initialize mysql backend
2. Insert triple that has Literal as value
3. Execute SPARQL query "SELECT ?s ?p ?o WHERE { ?s ?p ?o . OPTIONAL { ?o
?op ?ov } }"

A python script that demonstrates this problem is attached.

What is the expected output? What do you see instead?

I would expect query to work and return some or no results.

Instead I get traceback that ends with:

/usr/local/lib/python2.6/dist-packages/rdflib-2.4.2-py2.6-linux-i686.egg/rdflib/
store/MySQL.pyc
in determine_initial_subset(self, store)
    216     if isinstance(self.subject, Literal):
    217       raise ValueError(
--> 218         'A subject cannot be a literal.')
    219 
    220     if isinstance(self.predicate, URIRef):

ValueError: A subject cannot be a literal.

What version of the product are you using? On what operating system?

rdflib 2.4.2, Ubuntu 9.04

Please provide any additional information below.

It seems that the error gets triggered by "OPTIONAL" keyword.

Original issue reported on code.google.com by cuu...@gmail.com on 14 Oct 2009 at 2:54

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by eik...@gmail.com on 1 Feb 2010 at 7:31

GoogleCodeExporter commented 8 years ago

Original comment by eik...@gmail.com on 1 Feb 2010 at 8:04

GoogleCodeExporter commented 8 years ago
These issues involve bits that have been moved out of rdflib proper for now. We 
will re-open them 
or move them to rdfextas as appropriate.

Original comment by eik...@gmail.com on 11 Feb 2010 at 6:06