cymple.builder.Relation

class cymple.builder.Relation(query)

Bases: Query

A class for representing a “RELATION” clause.

__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 .

related([label, ref_name, properties, ...])

Concatenate an undirectional (i.e. --) graph Relationship, which may be filtered.

related_from([label, ref_name, properties, ...])

Concatenate a backward (i.e. <--) graph Relationship, which may be filtered.

related_to([label, ref_name, properties, ...])

Concatenate a forward (i.e. -->) graph Relationship, which may be filtered.

cypher(cypher_query_str)

Concatenate a cypher query string

get()

Get the final query string .

related(label: str | None = None, ref_name: str | None = None, properties: dict | None = None, min_hops: int = 1, max_hops: int = 1, **kwargs)

Concatenate an undirectional (i.e. –) graph Relationship, which may be filtered.

Parameters:
  • label (str) – The relationship label (type) in the DB, 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 relationship is filtered, defaults to None

  • min_hops (int) – The minimal desired number of hops (set -1 for maximum boundary only), defaults to 1

  • max_hops (int) – The maximal desired number of hops (set -1 for minimal boundary only), defaults to 1

  • **kwargs

    kwargs

:type **kwargs

Returns:

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

Return type:

RelationAvailable

related_from(label: str | None = None, ref_name: str | None = None, properties: dict = {}, min_hops: int = 1, max_hops: int = 1, **kwargs)

Concatenate a backward (i.e. <–) graph Relationship, which may be filtered.

Parameters:
  • label (str) – The relationship label (type) in the DB, 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 relationship is filtered, defaults to {}

  • min_hops (int) – The minimal desired number of hops (set -1 for maximum boundary only), defaults to 1

  • max_hops (int) – The maximal desired number of hops (set -1 for minimal boundary only), defaults to 1

  • **kwargs

    kwargs

:type **kwargs

Returns:

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

Return type:

RelationAvailable

related_to(label: str | None = None, ref_name: str | None = None, properties: dict = {}, min_hops: int = 1, max_hops: int = 1, **kwargs)

Concatenate a forward (i.e. –>) graph Relationship, which may be filtered.

Parameters:
  • label (str) – The relationship label (type) in the DB, 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 relationship is filtered, defaults to {}

  • min_hops (int) – The minimal desired number of hops (set -1 for maximum boundary only), defaults to 1

  • max_hops (int) – The maximal desired number of hops (set -1 for minimal boundary only), defaults to 1

  • **kwargs

    kwargs

:type **kwargs

Returns:

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

Return type:

RelationAvailable