diff options
author | Matthias Baumgartner <dev@igsor.net> | 2022-12-18 14:11:27 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2022-12-18 14:11:27 +0100 |
commit | 58496960926a56149c10d64e01b6df7d048eed0e (patch) | |
tree | 72bc16a5bead955ec216681efa39f2b6c5a9d6e8 /bsfs | |
parent | 3165c3609a5061135ff7393747f8dc3f7f7abe0c (diff) | |
download | bsfs-58496960926a56149c10d64e01b6df7d048eed0e.tar.gz bsfs-58496960926a56149c10d64e01b6df7d048eed0e.tar.bz2 bsfs-58496960926a56149c10d64e01b6df7d048eed0e.zip |
triple store Open interface
Diffstat (limited to 'bsfs')
-rw-r--r-- | bsfs/triple_store/base.py | 7 | ||||
-rw-r--r-- | bsfs/triple_store/sparql.py | 10 |
2 files changed, 6 insertions, 11 deletions
diff --git a/bsfs/triple_store/base.py b/bsfs/triple_store/base.py index a2668c3..942a16b 100644 --- a/bsfs/triple_store/base.py +++ b/bsfs/triple_store/base.py @@ -54,11 +54,7 @@ class TripleStoreBase(abc.ABC): @classmethod @abc.abstractmethod - def Open( - cls, - uri: str, - **kwargs: typing.Any, - ) -> 'TripleStoreBase': + def Open(cls, **kwargs: typing.Any) -> 'TripleStoreBase': # pylint: disable=invalid-name # capitalized classmethod """Return a TripleStoreBase instance connected to *uri*.""" @abc.abstractmethod @@ -75,6 +71,7 @@ class TripleStoreBase(abc.ABC): """Return the store's local schema.""" @schema.setter + @abc.abstractmethod def schema(self, schema: _schema.Schema): """Migrate to new schema by adding or removing class definitions. diff --git a/bsfs/triple_store/sparql.py b/bsfs/triple_store/sparql.py index d9ed55a..fc161b3 100644 --- a/bsfs/triple_store/sparql.py +++ b/bsfs/triple_store/sparql.py @@ -72,13 +72,11 @@ class SparqlStore(base.TripleStoreBase): self._transaction = _Transaction(self._graph) self._schema = bsc.Schema.Empty() + # NOTE: mypy and pylint complain about the **kwargs not being listed (contrasting super) + # However, not having it here is clearer since it's explicit that there are no arguments. @classmethod - def Open( - cls, - uri: str, - **kwargs: typing.Any, - ) -> 'SparqlStore': - return cls(None) + def Open(cls) -> 'SparqlStore': # type: ignore [override] # pylint: disable=arguments-differ + return cls() def commit(self): self._transaction.commit() |