noctis.repository.neo4j.neo4j_queries.LoadRelationshipsFromCsv

pydantic model noctis.repository.neo4j.neo4j_queries.LoadRelationshipsFromCsv[source]

Query to load relationships from CSV file

Show JSON schema
{
   "title": "LoadRelationshipsFromCsv",
   "description": "Query to load relationships from CSV file",
   "type": "object",
   "properties": {
      "query": {
         "default": null,
         "items": {
            "type": "string"
         },
         "title": "Query",
         "type": "array"
      },
      "graph_schema": {
         "anyOf": [
            {
               "$ref": "#/$defs/GraphSchema"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "base_nodes": {
               "chemical_equation": "ChemicalEquation",
               "molecule": "Molecule"
            },
            "base_relationships": {
               "product": {
                  "end_node": "molecule",
                  "start_node": "chemical_equation",
                  "type": "PRODUCT"
               },
               "reactant": {
                  "end_node": "chemical_equation",
                  "start_node": "molecule",
                  "type": "REACTANT"
               }
            },
            "extra_nodes": {},
            "extra_relationships": {}
         }
      },
      "file_path": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "format": "path",
               "type": "string"
            }
         ],
         "default": null,
         "title": "File Path"
      },
      "batch_size": {
         "default": 100,
         "title": "Batch Size",
         "type": "integer"
      },
      "field_terminator": {
         "default": ",",
         "title": "Field Terminator",
         "type": "string"
      },
      "import_from_file_system": {
         "default": true,
         "title": "Import From File System",
         "type": "boolean"
      }
   },
   "$defs": {
      "GraphSchema": {
         "additionalProperties": false,
         "description": "Base model representing the schema of a NOCtis graph",
         "properties": {
            "base_nodes": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {
                  "chemical_equation": "ChemicalEquation",
                  "molecule": "Molecule"
               },
               "minProperties": 2,
               "title": "Base Nodes",
               "type": "object"
            },
            "base_relationships": {
               "additionalProperties": {
                  "additionalProperties": {
                     "type": "string"
                  },
                  "type": "object"
               },
               "default": {
                  "product": {
                     "end_node": "molecule",
                     "start_node": "chemical_equation",
                     "type": "PRODUCT"
                  },
                  "reactant": {
                     "end_node": "chemical_equation",
                     "start_node": "molecule",
                     "type": "REACTANT"
                  }
               },
               "minProperties": 2,
               "title": "Base Relationships",
               "type": "object"
            },
            "extra_nodes": {
               "additionalProperties": {
                  "type": "string"
               },
               "title": "Extra Nodes",
               "type": "object"
            },
            "extra_relationships": {
               "additionalProperties": {
                  "additionalProperties": {
                     "type": "string"
                  },
                  "type": "object"
               },
               "title": "Extra Relationships",
               "type": "object"
            }
         },
         "title": "GraphSchema",
         "type": "object"
      }
   }
}

Config:
  • arbitrary_types_allowed: bool = True

Fields:
Validators:

field batch_size: int = 100
Validated by:
field field_terminator: str = ','
Validated by:
field file_path: str | Path = None
Validated by:
field import_from_file_system: bool = True
Validated by:
field query: list[str] = None
Validated by:
get_query() list[str][source]
parameters_embedded: ClassVar[bool] = True
query_args_optional: ClassVar[list[str]] = ['batch_size', 'field_terminator', 'import_from_file_system']
query_args_required: ClassVar[list[str]] = ['file_path']
query_name: ClassVar[str] = 'load_relationships_from_csv'
query_type: ClassVar[str] = 'modify_graph'