falkordb package

Subpackages

Submodules

falkordb.edge module

falkordb.exceptions module

exception falkordb.exceptions.SchemaVersionMismatchException(version: int)[source]

Bases: Exception

Exception raised when the schema version of the database does not match the version of the schema that the application expects.

falkordb.execution_plan module

class falkordb.execution_plan.ExecutionPlan(plan)[source]

Bases: object

ExecutionPlan Class for representing a collection of operations.

Attributes:

plan (list): List of strings representing the collection of operations. structured_plan (Operation): Root of the structured operation tree.

collect_operations(op_name)[source]

Collects all operations with specified name from plan

Args:

op_name (string): Name of operation to collect

Returns:

List[Operation]: All operations with the specified name

class falkordb.execution_plan.Operation(name: str, args: str | None = None, profile_stats: ProfileStats | None = None)[source]

Bases: object

Operation Class for representing a single operation within an execution plan.

Attributes:

name (str): The name of the operation. args (str): Operation arguments. children (list): List of child operations. profile_stats (ProfileStats): Profile statistics for the operation.

append_child(child)[source]

Appends a child operation to the current operation.

Args:

child (Operation): The child operation to append.

Returns:

Operation: The updated operation instance.

child_count() int[source]

Returns the number of child operations.

Returns:

int: Number of child operations.

property execution_time: float

returns operation’s execution time in ms

property records_produced: int

returns number of records produced by operation.

class falkordb.execution_plan.ProfileStats(records_produced: int, execution_time: float)[source]

Bases: object

ProfileStats Class for representing runtime execution statistics of an operation.

Attributes:

records_produced (int): The number of records produced. execution_time (float): The execution time in milliseconds.

falkordb.falkordb module

falkordb.graph module

falkordb.graph_schema module

class falkordb.graph_schema.GraphSchema(graph)[source]

Bases: object

The graph schema. Maintains the labels, properties and relationships of the graph.

clear()[source]

Clear the graph schema.

Returns:

None

get_label(idx: int) str[source]

Returns a label by its index.

Args:

idx (int): The index of the label.

Returns:

str: The label.

get_property(idx: int) str[source]

Returns a property by its index.

Args:

idx (int): The index of the property.

Returns:

str: The property.

get_relation(idx: int) str[source]

Returns a relationship type by its index.

Args:

idx (int): The index of the relation.

Returns:

str: The relationship type.

refresh(version: int) None[source]

Refresh the graph schema.

Args:

version (int): The version of the graph schema.

Returns:

None

refresh_labels() None[source]

Refresh labels.

Returns:

None

refresh_properties() None[source]

Refresh property keys.

Returns:

None

refresh_relations() None[source]

Refresh relationship types.

Returns:

None

falkordb.helpers module

falkordb.helpers.quote_string(v)[source]

FalkorDB strings must be quoted, quote_string wraps given v with quotes incase v is a string.

falkordb.helpers.stringify_param_value(value)[source]

turn a parameter value into a string suitable for the params header of a Cypher command you may pass any value that would be accepted by json.dumps()

ways in which output differs from that of str(): * strings are quoted * None –> “null” * in dictionaries, keys are wrapped in backticks so that non-bare-

identifier keys (e.g. @type, hyphenated UUIDs) are accepted by the Cypher parser. Empty keys and keys containing a literal backtick raise ValueError because FalkorDB’s CYPHER header parser does not support escaped backticks inside identifiers.

Parameters:

value – the parameter value to be turned into a string

Returns:

string

falkordb.node module

class falkordb.node.Node(node_id: int | None = None, alias: str | None = '', labels: str | List[str] | None = None, properties=None)[source]

Bases: object

A graph node.

to_string() str[source]

Get a string representation of the node’s properties.

Returns:

str: A string representation of the node’s properties.

falkordb.path module

falkordb.query_result module

Module contents