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

Graph.update with SPARQLStore should return Exception #1032

Closed
white-gecko opened this issue May 1, 2020 · 2 comments · Fixed by #1623
Closed

Graph.update with SPARQLStore should return Exception #1032

white-gecko opened this issue May 1, 2020 · 2 comments · Fixed by #1623
Labels
Milestone

Comments

@white-gecko
Copy link
Member

When I instantiate a Graph with the SPARQLStore and call query() on it I get:

TypeError: update() takes from 2 to 3 positional arguments but 5 were given

while I would expect an Exception.

Reproduce it with:

from rdflib import Graph
graph = Graph(store="SPARQLStore")
graph.update("insert data {graph <urn:ex> {<urn:s> <urn:p> <urn:o>}}")

This is caused by the fact, that the SPARQLStore inherits from SPARQLConnector:

class SPARQLStore(SPARQLConnector, Store):

Two issues:

  • Why does SPARQLStore inherit from SPARQLConnector?
  • The SPARQLStore should define update and return en Exception.
@white-gecko white-gecko added SPARQL store Related to a store. labels May 1, 2020
@white-gecko white-gecko added this to the rdflib 6.0.0 milestone May 1, 2020
@nicholascar
Copy link
Member

The SPARQLStore should define update and return en Exception.

Agree. I think a few people trip up on this - SPARQLStore is read-only - so returning an error would be best to make it clear.

@white-gecko
Copy link
Member Author

Do you see any reason, why SPARQLStore should inherit from SPARQLConnector? Maybe it is better to just instantiate a SPARQLConnector and use it in the SPARQLStore. That would provide a clearer structure in my eyes.

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

Successfully merging a pull request may close this issue.

2 participants