cymple.builder.MatchAvailable

class cymple.builder.MatchAvailable(query)

Bases: Node, Return, OperatorStart

A class decorator declares a Match is available in the current query.

__init__(query)

Initialize the query object.

Methods

__init__(query)

Initialize the query object.

cypher(cypher_query_str)

Concatenate a cypher query string

get()

Get the final query string .

node([labels, ref_name, properties])

Concatenate a graph Node, which may be filtered using any label/s and/or property/properties.

operator_start(operator[, ref_name, args])

Concatenate an operator (e.g. ShortestPath), where its result may be given a name for future reference.

return_literal(literal)

Concatenate a literal RETURN statement.

return_mapping(mappings)

Concatenate a RETURN statement for multiple objects.

cypher(cypher_query_str)

Concatenate a cypher query string

get()

Get the final query string .

node(labels: List[str] | str | None = None, ref_name: str | None = None, properties: dict | None = None, **kwargs)

Concatenate a graph Node, which may be filtered using any label/s and/or property/properties.

Parameters:
  • labels (Union[List[str], str]) – The neo4j label (or list of labels) for that node, defaults to None

  • ref_name (str) – A reference name to be used later in the rest of the query, defaults to None

  • properties (dict) – A dict representing the set of properties by which the nodes are filtered, defaults to None

  • **kwargs

    kwargs

:type **kwargs

Returns:

A Query object with a query that contains the new clause.

Return type:

NodeAvailable

operator_start(operator: str, ref_name: str | None = None, args: dict | None = None)

Concatenate an operator (e.g. ShortestPath), where its result may be given a name for future reference.

Parameters:
  • operator (str) – The neo4j operator to be used (e.g. ShortestPath)

  • ref_name (str) – A reference name of the result, to be used later in the rest of the query, defaults to None

  • args (dict) – A dict of arguments, to be passed to the operator function, defaults to None

Returns:

A Query object with a query that contains the new clause.

Return type:

OperatorStartAvailable

return_literal(literal: str)

Concatenate a literal RETURN statement.

Parameters:

literal (str) – A Cypher string describing the objects to be returned, referencing name/names which were defined earlier in the query

Returns:

A Query object with a query that contains the new clause.

Return type:

ReturnAvailable

return_mapping(mappings: List[Mapping])

Concatenate a RETURN statement for multiple objects.

Parameters:

mappings (List[Mapping]) – The mapping (or a list of mappings) of db property names to code names, to be returned

Returns:

A Query object with a query that contains the new clause.

Return type:

ReturnAvailable