walidazizi / rdflib

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

TypeError in SPARQLEvaluate when using FILTER regex( '', '', 'i') #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. python test/test_sparql/sparl_regex.py

I was trying to follow along with one of the examples in Programming the
Semantic Web, and got an exception in sparql queries that had a FILTER
regex() statement.

What is the expected output? What do you see instead?
Using your already existing testing code. I get this exception:
======================================================================
ERROR: testRegex (__main__.TestRegex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "sparql_regex.py", line 31, in testRegex
    results = graph.query(test_query)
  File "/Users/diane/src/python/rdflib/devel/rdflib/graph.py", line 804, in
query
    dataSetBase, extensionFunctions))
  File
"/Users/diane/src/python/rdflib/devel/rdflib/sparql/bison/Processor.py",
line 54, in query
    extensionFunctions=extensionFunctions)
  File "/Users/diane/src/python/rdflib/devel/rdflib/sparql/Algebra.py",
line 317, in TopEvaluate
    None)
  File "/Users/diane/src/python/rdflib/devel/rdflib/sparql/Algebra.py",
line 166, in ReduceToAlgebra
    prolog))
  File
"/Users/diane/src/python/rdflib/devel/rdflib/sparql/bison/SPARQLEvaluate.py",
line 358, in createSPARQLPConstraint
    constraint=const)
  File
"/Users/diane/src/python/rdflib/devel/rdflib/sparql/bison/SPARQLEvaluate.py",
line 235, in mapToOperator
    expr.arg3 and ',"'+expr.arg3 + '"' or '',
TypeError: cannot concatenate 'str' and
'ParsedConditionalAndExpressionList' objects

What version of the product are you using? On what operating system?
I'm using svn revno 1691, on os x 10.5 with the standard python 2.5 and
easy_installed dependencies.

Please provide any additional information below.

Changing expr.arg3 to expr.arg3.reduce() in mapToOperator in
SPARQLEvaluate.py seems to have fixed the crash, and also seems to produce
a believable argument.

Original issue reported on code.google.com by alieng...@gmail.com on 10 Aug 2009 at 6:22

Attachments:

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