buildingmotif.database.graph_connection#

Classes

GraphConnection(engine[, db_identifier])

Manages graph connection.

class GraphConnection(engine: BuildingMotifEngine, db_identifier: Optional[str] = 'buildingmotif_store')[source]#

Manages graph connection.

create_graph(identifier: str, graph: Graph) Graph[source]#

Create a graph in the database.

Parameters:
  • identifier (str) – identifier of graph

  • graph (Graph) – graph to add, defaults to None

Returns:

graph added

Return type:

Graph

get_all_graph_identifiers() List[str][source]#

Get all graph identifiers.

Returns:

all graph identifiers

Return type:

List[str]

get_graph(identifier: str) Graph[source]#

Get graph by identifier. Graph has triples, no context.

Parameters:

identifier (str) – graph identifier

Returns:

graph without context

Return type:

Graph

delete_graph(identifier: str) None[source]#

Delete graph.

Parameters:

identifier (str) – graph identifier