Composite Data Type Variables

Abstact Data Structures over neo4j.

author:

Athanasios Anastasiou

date:

Feb 2023

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

A native Neo4J array of dates.

Parameters:

value (neomodel.ArrayProperty) – The actual array value

DoesNotExist

alias of CompositeArrayDateDoesNotExist

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

A native Neo4j array of numbers.

Parameters:

value (neomodel.ArrayProperty) – An array of Real numbers.

DoesNotExist

alias of CompositeArrayNumberDoesNotExist

from_query_IDs(query, refresh=True, auto_reset=False)

Executes a special type of query to populate the array of numbers with the IDs of the entities in the query.

Consequently, the query must have a specific structure. The general pattern of the query is as follows:

MATCH Array WITH Array [query] WITH Array,collect(id(ListItem)) as ItemIds set Array.value=ItemIds;

Where [query] is an INCOMPLETE Cypher MATCH query with at least one named Node that is called “ListItem”. That named node is the node whose id will be catalogued in the list.

Warning

The predefined “Array” must be propagated in subsequent withs for it to go all the way to the other side of the query and finish.

Note

This functionality is not meant to substitute double linked lists for collections of articles because it relies heavily on Node IDs which are subject to change. Instead, this functionality is meant to ASSIST in creating Double Linked Lists of articles FROM lists of IDs

Parameters:
  • query (str) – A Cypher Query making specific reference to ListItem.

  • refresh (bool) – Whether this action should trigger a refresh or not

  • auto_reset (bool) – Whether to clear the list if it is found to be populated

Returns:

self

class neoads.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.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.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

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

A native Neo4j array of strings.

Parameters:

value (neomodel.ArrayProperty) – An array of strings

DoesNotExist

alias of CompositeArrayStringDoesNotExist

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

A typical string.

Strings are represented as composite objects to support indexing naturally.

Parameters:

value (neomodel.StringProperty) – The actual string value

DoesNotExist

alias of CompositeStringDoesNotExist