diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-01-12 10:17:07 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-01-12 10:17:07 +0100 |
commit | 6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb (patch) | |
tree | fac9c7de8e8dcf202c1aff9fd76c5bfe9626eb31 /bsfs | |
parent | 3940cb3c79937a431ba2ae3b57fd0c6c2ccfff33 (diff) | |
download | bsfs-6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb.tar.gz bsfs-6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb.tar.bz2 bsfs-6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb.zip |
changed path to from_string in clients
Diffstat (limited to 'bsfs')
-rw-r--r-- | bsfs/apps/migrate.py | 6 | ||||
-rw-r--r-- | bsfs/graph/graph.py | 10 | ||||
-rw-r--r-- | bsfs/triple_store/sparql/sparql.py | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/bsfs/apps/migrate.py b/bsfs/apps/migrate.py index 91c1661..b9d019f 100644 --- a/bsfs/apps/migrate.py +++ b/bsfs/apps/migrate.py @@ -42,15 +42,15 @@ def main(argv): graph = bsfs.Open(config) # initialize schema - schema = bsfs.schema.Schema.Empty() + schema = bsfs.schema.Schema() if len(args.schema) == 0: # assemble schema from standard input - schema = schema + bsfs.schema.Schema.from_string(sys.stdin.read()) + schema = schema + bsfs.schema.from_string(sys.stdin.read()) else: # assemble schema from input files for pth in args.schema: with open(pth, mode='rt', encoding='UTF-8') as ifile: - schema = schema + bsfs.schema.Schema.from_string(ifile.read()) + schema = schema + bsfs.schema.from_string(ifile.read()) # migrate schema graph.migrate(schema, not args.remove) diff --git a/bsfs/graph/graph.py b/bsfs/graph/graph.py index f030fed..2210755 100644 --- a/bsfs/graph/graph.py +++ b/bsfs/graph/graph.py @@ -10,7 +10,7 @@ import typing # bsfs imports from bsfs.query import ast, validate -from bsfs.schema import Schema +from bsfs import schema as bsc from bsfs.triple_store import TripleStoreBase from bsfs.utils import URI, typename @@ -67,11 +67,11 @@ class Graph(): return f'{typename(self)}({str(self._backend)}, {self._user})' @property - def schema(self) -> Schema: + def schema(self) -> bsc.Schema: """Return the store's local schema.""" return self._backend.schema - def migrate(self, schema: Schema, append: bool = True) -> 'Graph': + def migrate(self, schema: bsc.Schema, append: bool = True) -> 'Graph': """Migrate the current schema to a new *schema*. Appends to the current schema by default; control this via *append*. @@ -79,14 +79,14 @@ class Graph(): """ # check args - if not isinstance(schema, Schema): + if not isinstance(schema, bsc.Schema): raise TypeError(schema) # append to current schema if append: schema = schema + self._backend.schema # add Graph schema requirements with open(os.path.join(os.path.dirname(__file__), 'schema.nt'), mode='rt', encoding='UTF-8') as ifile: - schema = schema + Schema.from_string(ifile.read()) + schema = schema + bsc.from_string(ifile.read()) # migrate schema in backend # FIXME: consult access controls! self._backend.schema = schema diff --git a/bsfs/triple_store/sparql/sparql.py b/bsfs/triple_store/sparql/sparql.py index c3cbff6..ddace35 100644 --- a/bsfs/triple_store/sparql/sparql.py +++ b/bsfs/triple_store/sparql/sparql.py @@ -94,7 +94,7 @@ class SparqlStore(base.TripleStoreBase): super().__init__(None) self._graph = rdflib.Graph() self._transaction = _Transaction(self._graph) - self._schema = bsc.Schema.Empty() + self._schema = bsc.Schema() self._filter_parser = parse_filter.Filter(self._schema) # NOTE: mypy and pylint complain about the **kwargs not being listed (contrasting super) |