Repository Module

The Repository Module is a crucial component of the Noctis project, primarily focused on interactions with Neo4j databases. This module provides a comprehensive set of tools and functionalities for managing, querying, and manipulating graph data within a Neo4j environment.

Neo4j Queries

Abstract Classes

AbstractQuery

Abstract class representing a query

Neo4jQueryRegistry()

A registry for managing and accessing Neo4j query classes.


Constraints

CreateUniquenessConstraints

Query to constraint uniqueness of Molecule and ChemicalEquation nodes

DropUniquenessConstraints

Query to remove the uniqueness constraint for Molecule and ChemicalEquation nodes

ShowUniquenessConstraints

Query to show the uniqueness constraints


Retrieve Graph Queries

GetNode

Query to retrieve a node based on its uid or other properties

GetTree

Query to retrieve a tree for the given Molecule root

GetRoutes

Query to retrieve the list of routes for a given Molecule root

GetPathsThroughIntermediates

Query to get paths which start with start node and go through provided intermediate nodes


Modify Graph Queries

AddNodesAndRelationships

Query to add nodes and relationships from a python object.

LoadNodesFromCsv

Query to load nodes from a csv file.

LoadRelationshipsFromCsv

Query to load relationships from CSV file

ImportDbFromCsv

Query to import nodes and relationships from CSV files

DeleteAllNodes

Query to delete ChemicalEquation nodes based on the number of a particular relationship type


Retrieve Stats Query

GetGDBSchema

Query to delete ChemicalEquation nodes based on the number of a particular relationship type


Custom Query

CustomQuery

Custom query class for executing queries from YAML files

Neo4j Repository

Neo4jRepository([uri, username, password, ...])

Repository class for interacting with a Neo4j database using defined query strategies.

Neo4j Functions

_convert_datacontainer_to_query(data_container)

To convert a DataContainer into a query string

_convert_record_to_query_neo4j(record)

To convert a GraphRecord into a query string

_create_node_queries(nodes)

To create node queries

_create_relationship_queries(relationships)

To create relationship query

_generate_properties_assignment(properties)

To generate properties assignment

_get_dict_keys_from_csv(csv_file_path)

_create_neo4j_import_path(directory, file_name)

Combines the directory and file name into an absolute file path and converts it into a file URI suitable for use in a Cypher LOAD CSV command.

_generate_files_string(folder_path, prefix, ...)

Generates a string of file descriptors for nodes or relationships.

_generate_nodes_files_string(folder_path, ...)

Generates a string of file descriptors for nodes.

_generate_relationships_files_string(...)

Generates a string of file descriptors for relationships.