rdflib
rdflib copied to clipboard
Fix Liskov substitution principle violations in sub-classes of Store
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.