Surf 1.1.3 and RDFLib 3.0.0

33 views
Skip to first unread message

Alex Stolz

unread,
Jan 18, 2011, 9:46:55 AM1/18/11
to surfrdf
Hi,

today I tried to use Surf in combination with RDFLib 3.0.0. But my
programs fail with a VersionConflict error saying that the dependencies
between the two libs are not met. Does anybody know how I can run Surf
with RDFLib 3? Is it possible? Below you see the output of my test
program (the first two lines print the versions of Surf and RDFLib):

(1, 1, 3, u'Sunknown')
3.0.0
Traceback (most recent call last):
File "surf_test.py", line 9, in <module>
rdflib_store = 'IOMemory')
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/store.py",
line 72, in __init__
load_plugins()
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/plugin/manager.py",
line 72, in load_plugins
__init_plugins(__readers__, __ENTRYPOINT_READER__)
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/plugin/manager.py",
line 60, in __init_plugins
plugin_class = entrypoint.load()
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
line 1953, in load
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
line 1966, in require
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
line 569, in resolve
pkg_resources.VersionConflict: (rdflib 3.0.0
(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdflib-3.0.0-py2.6.egg),
Requirement.parse('rdflib==2.4.2'))

Thanks in advance,
Alex

--
Alex Stolz

e-mail: in...@stalsoft.com
www: http://www.stalsoft.com/
skype: stalsoft.com

Christoph Burgmer

unread,
Jan 18, 2011, 3:46:48 PM1/18/11
to sur...@googlegroups.com, Alex Stolz
Hi Alex

Am Dienstag, 18. Januar 2011 schrieb Alex Stolz:
> today I tried to use Surf in combination with RDFLib 3.0.0. But my
> programs fail with a VersionConflict error saying that the dependencies
> between the two libs are not met. Does anybody know how I can run Surf
> with RDFLib 3? Is it possible? Below you see the output of my test
> program (the first two lines print the versions of Surf and RDFLib):

[...]

> File
> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packa


> ges/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 569, in resolve
> pkg_resources.VersionConflict: (rdflib 3.0.0
> (/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packa
> ges/rdflib-3.0.0-py2.6.egg), Requirement.parse('rdflib==2.4.2'))

If you are using surf.sparql_protocol, then you have a dependency on
SPARQLWrapper. SPARQLWrapper has in turn a hard dependeny on rdflib==2.4.2 as
you can see from their source [1].

For me it worked by removing the strict dependency by changing line 12 to

_install_requires.append('rdflib')

I filed a bug report there [2], so we can just hope this will be solved soon.

Hope this helps
-Chris

[1] http://sparql-wrapper.svn.sourceforge.net/viewvc/sparql-
wrapper/trunk/src/setup.py?view=markup
[2]
http://sourceforge.net/tracker/index.php?func=detail&aid=3154434&group_id=217900&atid=1041487

Alex Stolz

unread,
Jan 19, 2011, 4:00:02 AM1/19/11
to Christoph Burgmer, surfrdf
Hi Christoph,

thanks for your quick answer. I reinstalled SPARQLWrapper and it doesn't
complain anymore about the RDFLib version. But now a PluginException is
raised. I tried to reinstall the surf.sparql_protocol plugin via
easy_install, but it didn't help (see the stack trace below). Any ideas?

(1, 1, 3, u'Sunknown')
3.0.0

Load RDF data


Traceback (most recent call last):

File "surf_test.py", line 23, in <module>
print 'Found %d businessentities'%(len(all_be))
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/resource/result_proxy.py",
line 226, in __len__
_, get_by_response = self.__execute_get_by()
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-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
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/store.py",
line 182, in get_by
return self.reader.get_by(params)
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/plugin/reader.py",
line 149, in get_by
return self._get_by(params)
File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/SuRF-1.1.3_r296-py2.6.egg/surf/plugin/query_reader.py",
line 207, in _get_by
table = self._to_table(self._execute(query))
File "build/bdist.linux-x86_64/egg/surf_rdflib/reader.py", line 74,
in _execute
File "build/bdist.linux-x86_64/egg/surf_rdflib/reader.py", line 78,
in execute_sparql
File "build/bdist.macosx-10.3-fat/egg/rdflib/graph.py", line 767, in
query
File "build/bdist.macosx-10.3-fat/egg/rdflib/plugin.py", line 89, in get
rdflib.plugin.PluginException: No plugin registered for (sparql, <class
'rdflib.query.Processor'>)

Best,
Alex

--

Christoph Burgmer

unread,
Jan 19, 2011, 8:00:02 AM1/19/11
to sur...@googlegroups.com, Alex Stolz
Hi


Yes, this is an issue with rdflib 3.0.0. The SPARQL capabilities have been
moved from rdflib to rdfextras and in this fashion you need to add two extra
lines to your code if you use the surf.rdflib plugin [1]. If you do not use
this plugin it is maybe best to remove it from your installation.

For SuRF this probably means that we should detect rdflib 3.0.0 and do the
appropriate registration + dependency handling.

It is somehow a mess as we don't want to depend on 2.4.2 (which would be bad
as it's old and 3.0.0. fixes some issues) nor can we depend on 3.0.0 (which
doesn't work with SPARQLWrapper and introduces other bugs, e.g. [2]).

HTH
-Chris

[1] http://code.google.com/p/rdflib/wiki/IntroSparql
[2] http://code.google.com/p/rdflib/issues/detail?id=154

Christoph Burgmer

unread,
Jan 22, 2011, 7:34:06 AM1/22/11
to sur...@googlegroups.com
> Yes, this is an issue with rdflib 3.0.0. The SPARQL capabilities have been
> moved from rdflib to rdfextras and in this fashion you need to add two
> extra lines to your code if you use the surf.rdflib plugin [1]. If you do
> not use this plugin it is maybe best to remove it from your installation.
>
> For SuRF this probably means that we should detect rdflib 3.0.0 and do the
> appropriate registration + dependency handling.
>
> It is somehow a mess as we don't want to depend on 2.4.2 (which would be
> bad as it's old and 3.0.0. fixes some issues) nor can we depend on 3.0.0
> (which doesn't work with SPARQLWrapper and introduces other bugs, e.g.
> [2]).

I commited some changes to SuRF trunk for integration with rdflib 3.0.0.
This includes:
- registering plugins from rdfextras (split off rdflib [1])
- dependency on rdfextras & pyparsing
- bug fixing to make SuRF's tests pass

This comes at a cost of a few lines more code only for working around
bugs&changes in rdflib 3.0.0 and a general dependeny on the two packages named
above. This now requires those two packages for the surf.rdflib plugin even if
installing rdflib 2.4.2 due to (reasonably) limited dependency handling in
setuptools.

I believe these changes are needed, even considering the added complexity
(code & dependency) as 3.0.0 is maintained and easy_install will by default
install this version.

Note though, that rdflib 3.0.0 comes with major changes, a lot of code was
dropped upstream (e.g. SQL support was removed).

Reading through bug reports and the rdflib mailinglist archive give the
impression that while interest on rdflib is strong, the activity really is
"Medium". Version 3.0.0 is an undertaking to get rid of unmaintained and
unmaintainable parts, but sadly only few productive commits have gone into svn
the following months. Let's hope rdflib keeps to be the solid foundation needed
for SuRF.

As for the surf.rdflib plugin we might need to communicate that it now depends
on rdfextras which is considered unstable. For surf.sparql_protocol we are
still stuck with 2.4.2 as of the SPARQLWrapper dependency.

-Chris

[1] http://code.google.com/p/rdflib/issues/detail?id=116

William Waites

unread,
Jan 22, 2011, 9:10:45 AM1/22/11
to sur...@googlegroups.com
On 22 January 2011 12:34, Christoph Burgmer <cbur...@ira.uka.de> wrote:
>
> As for the surf.rdflib plugin we might need to communicate that it now depends
> on rdfextras which is considered unstable. For surf.sparql_protocol we are
> still stuck with 2.4.2 as of the SPARQLWrapper dependency.

The fix for SPARQLWrapper to support 3.0 looks trivial. In fact there is
only one import statement (of ConjunctiveGraph) in the entire codebase.
I think a patch that wrapped this in a try/except and loosened the
rdflib dependency would be likely to be accepted.

Cheers,
-w

--
William Waites
Email: wwa...@gmail.com
UK tel: +44 131 516 3563
UK mob: +44 789 798 9965

Pēteris Caune

unread,
Feb 12, 2011, 11:36:39 AM2/12/11
to surfrdf
Recently released SPARQLWrapper 1.4.2 works with rdflib 3.0.0.
In the Pylons app I'm working on, I upgraded SuRF and
surf.sparql_wrapper to current svn versions, bumped rdflib from 2.4.2
to 3.0.0, and SPARQLWrapper from 1.4.1 to 1.4.2. Things seem to work--
all my tests pass!

On 22 Janv., 15:10, William Waites <wwai...@googlemail.com> wrote:
> On 22 January 2011 12:34, Christoph Burgmer <cburg...@ira.uka.de> wrote:
>
>
>
> > As for the surf.rdflib plugin we might need to communicate that it now depends
> > on rdfextras which is considered unstable. For surf.sparql_protocol we are
> > still stuck with 2.4.2 as of the SPARQLWrapper dependency.
>
> The fix for SPARQLWrapper to support 3.0 looks trivial. In fact there is
> only one import statement (of ConjunctiveGraph) in the entire codebase.
> I think a patch that wrapped this in a try/except and loosened the
> rdflib dependency would be likely to be accepted.
>
> Cheers,
> -w
>
> --
> William Waites
> Email: wwai...@gmail.com

Chris Wj

unread,
Feb 12, 2011, 5:22:40 PM2/12/11
to sur...@googlegroups.com
This is good news Peteris. I'll bring my software up to the latest to test as well.

2011/2/12 Pēteris Caune <cuu...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "surfrdf" group.
To post to this group, send email to sur...@googlegroups.com.
To unsubscribe from this group, send email to surfrdf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/surfrdf?hl=en.


Reply all
Reply to author
Forward
0 new messages