rdflib icon indicating copy to clipboard operation
rdflib copied to clipboard

Fix Liskov substitution principle violations in sub-classes of Store

Open aucampia opened this issue 2 years ago • 0 comments

We have a couple of LSP violations in Store class hierarchy.

One example:

https://github.com/RDFLib/rdflib/blob/0856ac8842697fb00199d2beb9ae1ee5b9152c68/rdflib/store.py#L175

https://github.com/RDFLib/rdflib/blob/0856ac8842697fb00199d2beb9ae1ee5b9152c68/rdflib/plugins/stores/berkeleydb.py#L100

If someone does

store: rdflib.store.Store = rdflib.plugins.stores.berkeleydb.BerkeleyDB(...)
store.open(configuration="/var/tmp/eg.db")

Then it will fail, even though the store interface defines the open method as taking configuration as an argument.

aucampia avatar Jul 27 '22 21:07 aucampia