walidazizi / rdflib

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

Sparql Query Examples Broken #159

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
None of the Sparql query examples at 
http://code.google.com/p/rdflib/wiki/IntroSparql work anymore. There's a vague 
reference to this functionality being moved to rdfextras, but that project has 
no documentation. Easy_installing rdfextras does not fix the example sparql 
code.

Original issue reported on code.google.com by chrisspen@gmail.com on 13 Mar 2011 at 6:02

GoogleCodeExporter commented 8 years ago
I am sorry you are having problems - I went through all the wiki-pages a little 
while ago to make sure they were still current, and it worked fine for me. 

However, I see now that if you easy_install rdfextras you get the hg-snapshot 
from 2010, and with this version the example does NOT run. For a quick fix you 
can try checking out the default branch of rdfextras, or try this snapshot: 
http://code.google.com/p/rdfextras/downloads/detail?name=rdfextras-hgsnapshot-20
110225.zip&can=2&q=

I will try to make an rdfextras release now to make this easier.

(Another possible issue is whether you really are running version 3.0 (or the 
brand new as of today 3.1)? 

try: 

import rdflib
print rdflib.__version__

It should say 3.0 or 3.1 ?
)

Original comment by gromgull on 17 Mar 2011 at 9:24

GoogleCodeExporter commented 8 years ago
I have released a rdfextras 1.0 - if you re-run easy_install you should be ok!

Original comment by gromgull on 18 Mar 2011 at 7:45

GoogleCodeExporter commented 8 years ago
Thanks for looking at this. Yes, I was using rdflib 2.4 and rdfextras 0.1a. I 
checked out rdflib and reinstalled, and now it's at 3.0. I couldn't find 
rdfextras 1.0, so I installed the most recent 0.1 release. Easy_install still 
installs 0.1a, so I downloaded the tarball. Now most of the examples run, 
except the queries, which give me the error:

TypeError: query() got an unexpected keyword argument 'initNs'

Original comment by chrisspen@gmail.com on 18 Mar 2011 at 12:49

GoogleCodeExporter commented 8 years ago
Add parameters initNs and initBindigs in rdflib.graph.query()

def query(..., initNs={}, initBindings={})
and add the same in the return statement

return result(processor.query(query_object, initBindings, initNs))

Original comment by MrLe...@gmail.com on 6 May 2011 at 1:38

GoogleCodeExporter commented 8 years ago
This should all work fine with rdflib3.1 and new rdfextras - please start a new 
ticket if you still have problems.

Original comment by gromgull on 9 May 2011 at 11:41