architxt.database.loader.cypher#
Functions
|
Create a tree representation for a table with its columns and data. |
|
Create a tree representation for a relation. |
|
Get the relations with data from the graph. |
|
Get the root nodes of the graph. |
|
Parse a relation between two nodes. |
|
Read the graph instance as a tree using Neo4j. |
|
Read the node and its children from the graph. |
- architxt.database.loader.cypher.build_group(node)[source]#
Create a tree representation for a table with its columns and data.
- architxt.database.loader.cypher.build_relation(node1, node2, rel_name)[source]#
Create a tree representation for a relation.
- architxt.database.loader.cypher.get_relation_with_data(session)[source]#
Get the relations with data from the graph.
- Parameters:
session (
Session) – Neo4j session.- Return type:
set[str]- Returns:
A set of relations with data.
- architxt.database.loader.cypher.get_root_nodes(session, sample)[source]#
Get the root nodes of the graph.
- Parameters:
session (
Session) – Neo4j session.sample (
int) – Number of samples to get.
- Return type:
Generator[Node, None, None]- Returns:
A generator of root nodes.
- architxt.database.loader.cypher.parse_relation(record, visited_relations, relations_with_data, *, session)[source]#
Parse a relation between two nodes.
- Parameters:
record (
Record) – Record containing the relation.visited_relations (
set[str]) – Set of visited relations.relations_with_data (
set[str]) – Set of relations with data.session (
Session) – Neo4j session.
- Return type:
Generator[Tree, None, None]- Returns:
A generator that yields trees representing the relation.
- architxt.database.loader.cypher.read_cypher(session, *, sample=0)[source]#
Read the graph instance as a tree using Neo4j.
- Parameters:
session (
Session) – Neo4j session.sample (
int) – Number of samples for each node to get.
- Return type:
Generator[Tree, None, None]- Returns:
A generator that yields trees representing the graph.
- architxt.database.loader.cypher.read_node(node, *, session, visited_relations, relations_with_data)[source]#
Read the node and its children from the graph.
- Parameters:
node (
Node) – Node to read.session (
Session) – Neo4j session.visited_relations (
set[str]) – Set of visited relations.relations_with_data (
set[str]) – Set of relations with data.
- Return type:
Generator[Tree, None, None]- Returns:
A generator that yields trees representing the node.