bsfs.graph.nodes module#

class bsfs.graph.nodes.Nodes(backend: TripleStoreBase, access_control: AccessControlBase, node_type: Node, guids: Iterable[URI])#

Bases: object

Container for graph nodes, provides operations on nodes.

NOTE: Should not be created directly but only via bsfs.graph.Graph. NOTE: guids may or may not exist. This is not verified as nodes are created on demand.

get(*paths: ~bsfs.utils.uri.URI | ~typing.Iterable[~bsfs.utils.uri.URI], view: ~typing.Type[list] | ~typing.Type[dict] = <class 'dict'>, **view_kwargs) Any#

Get values or nodes at paths. Return an iterator (view=list) or a dict (view=dict) over the results.

property guids: Iterator[URI]#

Return all node guids.

property node_type: Node#

Return the node’s type.

property schema: Schema#

Return the store’s local schema.

set(pred: URI, value: Any) Nodes#

Set predicate pred to value.

set_from_iterable(predicate_values: Iterable[Tuple[URI, Any]]) Nodes#

Set mutliple predicate-value pairs at once.