aboutsummaryrefslogtreecommitdiffstats
path: root/bsfs/graph/graph.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-01-12 10:17:07 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-01-12 10:17:07 +0100
commit6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb (patch)
treefac9c7de8e8dcf202c1aff9fd76c5bfe9626eb31 /bsfs/graph/graph.py
parent3940cb3c79937a431ba2ae3b57fd0c6c2ccfff33 (diff)
downloadbsfs-6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb.tar.gz
bsfs-6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb.tar.bz2
bsfs-6b3e32b29799a8143e8ce9d20c5f27e3e166b9bb.zip
changed path to from_string in clients
Diffstat (limited to 'bsfs/graph/graph.py')
-rw-r--r--bsfs/graph/graph.py10
1 files changed, 5 insertions, 5 deletions
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