Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdflib 3.2.2 sparql query broken #234

Closed
nschwertner opened this issue Oct 10, 2012 · 6 comments
Closed

rdflib 3.2.2 sparql query broken #234

nschwertner opened this issue Oct 10, 2012 · 6 comments

Comments

@nschwertner
Copy link

Running this example:

https://github.com/RDFLib/rdflib/blob/master/examples/sparql_query_example.py

under Python 2.7 with rdfextras 0.1 and 0.2 produces:

TypeError: query() takes exactly 4 arguments (5 given)

@nschwertner
Copy link
Author

It looks like the addition of this method is causing the problem:

def query(self, query, initNs, initBindings, **kwargs):

The problem was first introduced with this commit:
ca4085f

@gromgull
Copy link
Member

You are right - it IS broken, but not that in that commit - it was broken over 2 years ago:

r451780760e801d51288d62e131ce70137bd1d086

I'm surprised noone tried to query since then...

I will fix and push a 3.2.3 soon

@gromgull
Copy link
Member

Hmm - it was broken in 3.2.1 as well - and noone noticed :)

@gromgull
Copy link
Member

Hmm - tricker than I thought - in sparql_store I actually use the signature:

query(self, graph, query, initNs, initBindings, **kwargs) 

since you need to know whether the requesting graph is a ConjunctiveGraph (in which case you should query the union of all graphs, depending on the DAWG_COMPLIANCE_FLAG)
This also matches what a real QueryProcessor sees - it gets constructed with the graph instance:

https://github.com/RDFLib/rdflib/blob/master/rdflib/graph.py#L936

BUT mixing the graph into the store interface and requiring the store implementor to know about conjunctive graphs seems too complicated - so I've added a new queryGraph parameter, see docs in store.query.

@gromgull
Copy link
Member

A new 3.2.3 has been release with this fix.

@nschwertner
Copy link
Author

Thank you, Gunnar. I tested 3.2.3 with our code and now everything is back to normal. Confirming successful resolution of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants