cymple.builder.Where

class cymple.builder.Where(query)

Bases: Query

A class for representing a “WHERE” 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 .

where(name, comparison_operator, value, **kwargs)

Concatenate a WHERE clause to the query, created as {name} {comparison_operator} {value}.

where_literal(statement, **kwargs)

Concatenate a literal WHERE clause to the query.

where_multiple(filters[, ...])

Concatenate a WHERE clause to the query, created from a list of given property filters.

cypher(cypher_query_str)

Concatenate a cypher query string

get()

Get the final query string .

where(name: str, comparison_operator: str, value: str, **kwargs)

Concatenate a WHERE clause to the query, created as {name} {comparison_operator} {value}. E.g. x = ‘abc’.

Parameters:
  • name (str) – The name of the object which is to be used in the comparison

  • comparison_operator (str) – A string operator, according to which the comparison between compared object and the {value} is done, e.g. for “=”, we get: {name} = {value}

  • value (str) – The value which is compared against

  • **kwargs

    kwargs

:type **kwargs

Returns:

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

Return type:

WhereAvailable

where_literal(statement: str, **kwargs)

Concatenate a literal WHERE clause to the query.

Parameters:
  • statement (str) – A literal string of the required filter

  • **kwargs

    kwargs

:type **kwargs

Returns:

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

Return type:

WhereAvailable

where_multiple(filters: dict, comparison_operator: str = '=', boolean_operator: str = ' AND ', **kwargs)

Concatenate a WHERE clause to the query, created from a list of given property filters.

Parameters:
  • filters (dict) – A dict representing the set of properties to be filtered

  • comparison_operator (str) – A string operator, according to which the comparison between property values is done, e.g. for “=”, we get: property.name = property.value, defaults to “=”

  • boolean_operator (str) – The boolean operator to apply between predicates, defaults to ‘ AND ‘

  • **kwargs

    kwargs

:type **kwargs

Returns:

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

Return type:

WhereAvailable