py2neo.cypher.queries – Cypher Query Generation Functions

py2neo.cypher.queries.unwind_create_nodes_query(data, labels=None, keys=None)[source]

Generate a parameterised UNWIND...CREATE query for bulk loading nodes into Neo4j.

Parameters:
  • data

  • labels

  • keys

Returns:

(query, parameters) tuple

py2neo.cypher.queries.unwind_create_relationships_query(data, rel_type, start_node_key=None, end_node_key=None, keys=None)[source]

Generate a parameterised UNWIND...CREATE query for bulk loading relationships into Neo4j.

Parameters:
  • data

  • rel_type

  • start_node_key

  • end_node_key

  • keys

Returns:

(query, parameters) tuple

py2neo.cypher.queries.unwind_merge_nodes_query(data, merge_key, labels=None, keys=None, preserve=None)[source]

Generate a parameterised UNWIND...MERGE query for bulk loading nodes into Neo4j.

Parameters:
  • data

  • merge_key

  • labels

  • keys

  • preserve – Collection of key names for values that should be protected should the node already exist.

Returns:

(query, parameters) tuple

py2neo.cypher.queries.unwind_merge_relationships_query(data, merge_key, start_node_key=None, end_node_key=None, keys=None, preserve=None)[source]

Generate a parameterised UNWIND...MERGE query for bulk loading relationships into Neo4j.

Parameters:
  • data

  • merge_key – tuple of (rel_type, key1, key2…)

  • start_node_key

  • end_node_key

  • keys

  • preserve – Collection of key names for values that should be protected should the relationship already exist.

Returns:

(query, parameters) tuple