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

Simplify use of the Triplestore triples() and remove() methods #50

Closed
jesper-friis opened this issue Dec 11, 2022 · 0 comments · Fixed by #51
Closed

Simplify use of the Triplestore triples() and remove() methods #50

jesper-friis opened this issue Dec 11, 2022 · 0 comments · Fixed by #51
Assignees

Comments

@jesper-friis
Copy link
Contributor

jesper-friis commented Dec 11, 2022

The Triplestore triples() and remove() methods were originally modelled after the corresponding methods in rdflib. However, they are unnecessarily inconvenient to use.

By changing the prototype from triples(self, triple) to triples(self, subject=None, predicate=None, object=None) would make the API more intuitive and easier to use. For instance, looping over all instances would simply be triples() instead of triples((None, None, None)). The same apply for remove().

The backend interface should be unchanged.

To ensure backward compatibility, we should allow subject to be either a string or a triple. We could also add an additional triple keyword argument. Providing a triple in subject or using the triple keyword argument should raise a deprecation warning.

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

Successfully merging a pull request may close this issue.

1 participant