diff options
author | Matthias Baumgartner <dev@igsor.net> | 2022-12-18 14:15:18 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2022-12-18 14:15:18 +0100 |
commit | e19c8f9d0818a147832df0945188ea14de9c7690 (patch) | |
tree | 6a1e388af7ace081fbe516b0c56e28ff1f1e48db /bsfs/graph/graph.py | |
parent | 58496960926a56149c10d64e01b6df7d048eed0e (diff) | |
download | bsfs-e19c8f9d0818a147832df0945188ea14de9c7690.tar.gz bsfs-e19c8f9d0818a147832df0945188ea14de9c7690.tar.bz2 bsfs-e19c8f9d0818a147832df0945188ea14de9c7690.zip |
documentation, types, and style fixes
Diffstat (limited to 'bsfs/graph/graph.py')
-rw-r--r-- | bsfs/graph/graph.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bsfs/graph/graph.py b/bsfs/graph/graph.py index 4a36ff6..87f7a31 100644 --- a/bsfs/graph/graph.py +++ b/bsfs/graph/graph.py @@ -25,8 +25,15 @@ __all__: typing.Sequence[str] = ( ## code ## class Graph(): + """The Graph class is + + The Graph class provides a convenient interface to query and access a graph. + Since it logically builds on the concept of graphs it is easier to + navigate than raw triple stores. Naturally, it uses a triple store + as *backend*. It also controls actions via access permissions to a *user*. + """ - """ + # link to the triple storage backend. _backend: TripleStoreBase @@ -81,8 +88,14 @@ class Graph(): return self def nodes(self, node_type: URI, guids: typing.Iterable[URI]) -> _nodes.Nodes: + """Return nodes *guids* of type *node_type* as a `bsfs.graph.Nodes` instance. + + Note that the *guids* need not to exist (however, the *node_type* has + to be part of the schema). Inexistent guids will be created (using + *node_type*) once some data is assigned to them. + """ - node_type = self.schema.node(node_type) + type_ = self.schema.node(node_type) # NOTE: Nodes constructor materializes guids. return _nodes.Nodes(self._backend, self._user, type_, guids) |