PyPGX Common

Python PGX client.

class pypgx.EdgeFilter(filter_expr)

Bases: pypgx.common.graph_filter.GraphFilter

A class that wraps a filter expression supposed to be evaluated on each edge of the graph.

static from_collection(edge_collection)

Instantiate a new edge collection edge filter.

:param edge_collection the collection on which the filter acts :return the new filter

classmethod from_expression(filter_expression)

Instantiate a new edge filter using an expression.

:param : (String) the edge-filter expression :return: the new filter (EdgeFilter)

static from_pgql_result_set(result_set, column_name)

Instantiate a new result set edge filter.

Parameters
  • result_set – the result set on which the filter acts (PgqlResultSet)

  • column_name – the column name to be fetched from the result set (String)

:return the new filter (ResultSetEdgeFilter)

class pypgx.GraphFilter(java_filter)

Bases: object

An abstract class representing any GraphFilters.

static from_type_and_expression(filter_type, filter_expression)

Instantiate a new filter using an expression and type.

Parameters
  • filter_expression – (String) filter expression

  • filter_type – (String) filter type

Returns

the new filter

get_filter_expression()

Fetch the filter expression “filter name”

Returns

filter expression (string)

has_expression()

Check if this GraphFilter object has an expression associated with it.

intersect(other)

Intersect this filter with another graph-filter object.

Parameters

other – the other graph-filter

Returns

a class representing the filter intersection.

is_binary_operation()

Check this GraphFilter object represents is binary operation.

Returns

true, if this GraphFilter object represents is binary operation

is_collection_filter()

Check the filter is using a collection.

Returns

true if the filter is using a collection.

is_path_finding_filter()

Check the filter is a path finding filter.

Returns

true if the filter is a path finding filter

is_result_set_filter()

Check the filter if is acting on a result set.

Returns

true if the filter is acting on a result set

union(other)

Union this filter with another graph-filter object.

Parameters

other – the other graph-filter

Returns

a class representing the filter union.

class pypgx.VertexFilter(filter_expr)

Bases: pypgx.common.graph_filter.GraphFilter

A class that wraps a filter expression supposed to be evaluated on each vertex of the graph.

static from_collection(vertex_collection)

Instantiate a new vertex collection vertex filter.

:param vertex_collection the collection on which the filter acts :return the new filter

classmethod from_expression(filter_expression)

Instantiate a new vertex filter using an expression.

:param : (String) the vertex-filter expression :return: the new filter (VertexFilter)

static from_pgql_result_set(result_set, column_name)

Instantiate a new result set vertex filter.

Parameters
  • result_set – the result set on which the filter acts (PgqlResultSet)

  • column_name – the column name to be fetched from the result set (String)

:return the new filter (ResultSetVertexFilter)

pypgx.get_session(base_url=None, session_name=None, token=None, redirect_stdout=None, redirect_stderr=None)

Connect to a PGX server and return a PgxSession instance.

Parameters
  • base_url – The URL of the running session. if None a session is created.

  • session_name – Session name. If None “python_pgx_client” is the default value.

  • token – The access token

pypgx.setloglevel(loggername: str = '', loglevel: str = 'DEBUG')

Set loglevel for PGX. :param loggername: Name of the PGX logger. If empty, ROOT logger’s level is updated. :param loglevel: Level specification - one of OFF / FATAL / ERROR / WARN / INFO / DEBUG / TRACE / ALL :return: None