RDFLib/rdflibissueplayground — Issue #16: Depend on pyparsing
Author: gjhiggins
Created: 2012-02-20 07:43:35+00:00
State: closed

christop...@gmail.com, 2011-01-20T20:48:46.000Z

rdfextras uses pyparsing but does not depend on it.
When using SuRF's example with rdflib/rdfextras the follow exception is raised:

$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from surf import *

>>>
>>> store = Store( reader='rdflib',
... writer='rdflib',
... rdflib_store = 'IOMemory')
>>>
>>> session = Session(store)
>>>
>>> print 'Load RDF data'
Load RDF data
>>> store.load_triples(source='http://www.w3.org/People/Berners-Lee/card.rdf')
True
>>>
>>> Person = session.get_class(ns.FOAF['Person'])
>>>
>>> all_persons = Person.all()
>>>
>>>
>>> print 'Found %d persons that Tim Berners-Lee knows'%(len(all_persons))
Traceback (most recent call last):
File "", line 1, in
File "/tmp/rdflibenv/lib/python2.6/site-packages/SuRF-1.1.3_r294-py2.6.egg/surf/resource/result_proxy.py", line 226, in __len__
_, get_by_response = self.__execute_get_by()
File "/tmp/rdflibenv/lib/python2.6/site-packages/SuRF-1.1.3_r294-py2.6.egg/surf/resource/result_proxy.py", line 206, in __execute_get_by
self.__get_by_response = store.get_by(self.__get_by_args)
File "/tmp/rdflibenv/lib/python2.6/site-packages/SuRF-1.1.3_r294-py2.6.egg/surf/store.py", line 182, in get_by
return self.reader.get_by(params)
File "/tmp/rdflibenv/lib/python2.6/site-packages/SuRF-1.1.3_r294-py2.6.egg/surf/plugin/reader.py", line 149, in get_by
return self._get_by(params)
File "/tmp/rdflibenv/lib/python2.6/site-packages/SuRF-1.1.3_r294-py2.6.egg/surf/plugin/query_reader.py", line 207, in _get_by
table = self._to_table(self._execute(query))
File "/tmp/rdflibenv/lib/python2.6/site-packages/surf.rdflib-1.0.0_r295-py2.6.egg/surf_rdflib/reader.py", line 74, in _execute
return self.execute_sparql(unicode(query))
File "/tmp/rdflibenv/lib/python2.6/site-packages/surf.rdflib-1.0.0_r295-py2.6.egg/surf_rdflib/reader.py", line 78, in execute_sparql
return self.__graph.query(q_string)
File "/tmp/rdflibenv/lib/python2.6/site-packages/rdflib-3.0.0-py2.6.egg/rdflib/graph.py", line 767, in query
processor = plugin.get(processor, query.Processor)(self)
File "/tmp/rdflibenv/lib/python2.6/site-packages/rdflib-3.0.0-py2.6.egg/rdflib/plugin.py", line 90, in get
return p.getClass()
File "/tmp/rdflibenv/lib/python2.6/site-packages/rdflib-3.0.0-py2.6.egg/rdflib/plugin.py", line 53, in getClass
module = __import__(self.module_path, globals(), locals(), [""])
File "/tmp/rdflibenv/lib/python2.6/site-packages/rdfextras-0.1a-py2.6.egg/rdfextras/sparql/processor.py", line 2, in
import rdfextras.sparql.parser
File "/tmp/rdflibenv/lib/python2.6/site-packages/rdfextras-0.1a-py2.6.egg/rdfextras/sparql/parser.py", line 5, in
from pyparsing import (Regex, Suppress, Combine, Optional, CaselessKeyword,
ImportError: No module named pyparsing
>>>

Doing an `easy_install pyparsing` solves the issue.

Comment 1 by gromgull
This issue was closed by revision 0df4fc35c9.