Composite “object” Arrays

Definitions for composite “object” data types.

The classes defined in this module can be used to store a specific neo4j cypher query and “address” it as if it was a dict, list or pandas.DataFrame

author:

Athanasios Anastasiou

date:

Jan 2018

class neoads.composite_array_object.CompositeArrayObjectBase(value, name=None, **kwargs)

Represents a query that upon instantiation returns results in a particular form.

Warning

Not to be instantiated directly by user code.

Note

This data structure stores the actual query that returns the results, NOT the results themselves. For this reason, the results might be different every time the query is executed (because the backend data may have changed).

DoesNotExist

alias of CompositeArrayObjectBaseDoesNotExist

execute(params=None, refresh=True)

Executes the query and returns the result. The data type of specific categories of queries is specialised further by descendants of CompositeArrayObjectBase

Returns:

Query Results

class neoads.composite_array_object.CompositeArrayObjectDataFrame(value, name=None, **kwargs)

Represents a query that returns results as a pandas DataFrame.

Note

The DataFrame does not have an index and access is through pandas’ iloc.

DoesNotExist

alias of CompositeArrayObjectDataFrameDoesNotExist

execute(params=None, refresh=True)

Executes the query and returns the result. The data type of specific categories of queries is specialised further by descendants of CompositeArrayObjectBase

Returns:

Query Results

class neoads.composite_array_object.CompositeArrayObjectDict(value, name=None, **kwargs)

Represents a query that returns results as a Python dict.

Note

By convention, the first return value from the query is the key and all others become the value. Therefore, “duplicates” (items that are returned but happen to have the same key) are removed.

Warning

The functionality of this data type removes duplicates AT THE CLIENT SIDE, NOT AT THE SERVER SIDE.

DoesNotExist

alias of CompositeArrayObjectDictDoesNotExist

execute(params=None, refresh=True)

Executes the query and returns the result. The data type of specific categories of queries is specialised further by descendants of CompositeArrayObjectBase

Returns:

Query Results

class neoads.composite_array_object.CompositeArrayObjectList(value, name=None, **kwargs)

Represents a query that returns results as a Python list of dictionaries. It is therefore possible to request an item by integer index followed by column name.

DoesNotExist

alias of CompositeArrayObjectListDoesNotExist

execute(params=None, refresh=True)

Executes the query and returns the result. The data type of specific categories of queries is specialised further by descendants of CompositeArrayObjectBase

Returns:

Query Results