AnnotationAttribute

class polyglotdb.query.annotations.attributes.base.AnnotationAttribute(annotation, label)[source]

Class for information about the attributes of annotations in a graph query

Parameters:
annotation : AnnotationAttribute

Annotation that this attribute refers to

label : str

Label of the attribute

Attributes:
annotation : AnnotationAttribute

Annotation that this attribute refers to

label : str

Label of the attribute

output_label : str or None

User-specified label to use in query results

Methods

__init__(annotation, label) Initialize self.
aliased_for_cypher() creates cypher string to use in db
aliased_for_output([type]) creates cypher string for output
coerce_value(value)
column_name(label) sets a column name to label
for_column()
for_cypher([type]) Returns annotation duration or annotation type if applicable, otherwise annotation name and label
for_filter()
for_json()
for_return()
for_type_filter()
in_(other) Checks if the parameter other has a ‘cypher’ element executes the query if it does and appends the relevant results or appends parameter other
not_in_(other) Checks if the parameter other has a ‘cypher’ element executes the query if it does and appends the relevant results or appends parameter other
regex(pattern) Returns a clause for filtering based on regular expressions.
requires_type()
value_type()
aliased_for_output(type=False)[source]

creates cypher string for output

Returns:
string

string for output

for_cypher(type=False)[source]

Returns annotation duration or annotation type if applicable, otherwise annotation name and label

in_(other)[source]

Checks if the parameter other has a ‘cypher’ element executes the query if it does and appends the relevant results or appends parameter other

Parameters:
other : list

attribute will be checked against elements in this list

Returns
——-
string

clause for asserting membership in a filter

not_in_(other)[source]

Checks if the parameter other has a ‘cypher’ element executes the query if it does and appends the relevant results or appends parameter other

Parameters:
other : list

attribute will be checked against elements in this list

Returns
——-
string

clause for asserting non-membership in a filter

regex(pattern)[source]

Returns a clause for filtering based on regular expressions.

with_alias

returns type_alias if there is one alias otherwise