tracdap.rt.metadata.search

Module Contents

Classes

LogicalExpression

Logical expression for a search of the TRAC metadata store.

LogicalOperator

Metadata search logical operator, used as part of a LogicalExpression.

SearchExpression

Search expression for a search of the TRAC metadata store.

SearchOperator

Metadata search term operator, used as part of a SearchTerm

SearchParameters

Parameters to define a metadata search.

SearchTerm

Individual search term for a search of the TRAC metadata store.

class tracdap.rt.metadata.search.LogicalExpression

Logical expression for a search of the TRAC metadata store.

Applies a logical operator to one or more sub-expressions.

expr

A set of sub-expressions.

For AND or OR operations, there must be two or more sub-expressions. For NOT operations, there must be precisely one sub-expression.

Type:

List[SearchExpression]

operator

The logical operator to apply to sub-expressions

Type:

LogicalOperator

class tracdap.rt.metadata.search.LogicalOperator

Bases: enum.Enum

Metadata search logical operator, used as part of a LogicalExpression.

AND = [1, 'LOGICAL AND\n    \n    The AND operator combines two or more search expressions, the...
LOGICAL_OPERATOR_NOT_SET = [0]
NOT = [3, 'LOGICAL NOT\n    \n    The NOT operator applies to a single sub-expression, the logical...
OR = [2, 'LOGICAL OR\n    \n    The OR operator combines two or more search expressions, the logical...
class tracdap.rt.metadata.search.SearchExpression

Search expression for a search of the TRAC metadata store.

A search expression is either a single search term or a logical combination of other expressions. Search expressions can be built up to express complex logical conditions.

logical

Set if this search expression is a logical expression

Type:

Optional[LogicalExpression]

term

Set if this search expression is a single term

Type:

Optional[SearchTerm]

class tracdap.rt.metadata.search.SearchOperator

Bases: enum.Enum

Metadata search term operator, used as part of a SearchTerm

See also

SearchTerm

EQ = [1, 'EQUALS\n    \n    The EQ operator matches a tag when the tag has an attribute that matches...
GE = [6, 'GREATER THAN OR EQUAL TO\n    \n    The GE operator matches a tag when the tag has an...
GT = [5, 'GREATER THAN\n    \n    The GT operator matches a tag when the tag has an attribute with a...
IN = [7, 'IN\n    \n    The IN operator matches a tag when the tag has an attribute whose value is...
LE = [4, 'LESS THAN OR EQUAL TO\n    \n    The LE operator matches a tag when the tag has an...
LT = [3, 'LESS THAN\n    \n    The LT operator matches a tag when the tag has an attribute with a...
NE = [2, 'DOES NOT EQUAL\n    \n    The NE operator matches a tag precisely when the EQ operator does...
SEARCH_OPERATOR_NOT_SET = [0]
class tracdap.rt.metadata.search.SearchParameters

Parameters to define a metadata search.

objectType

The type of object to search for

Type:

ObjectType

priorTags

Include prior tags in the search.

By default, only the latest tag for each object version is considered in a search. If the as-of parameter is specified, latest tags are considered as of that time.

Setting this flag to true will cause TRAC to consider superseded tags in the search. If the as-of parameter is specified as well then all tags up to that time are considered. Only the latest matching tag will be included in the search result.

This flag can be combined with priorVersions to search across all tags and object versions. If neither flag is specified, only the latest version and latest tag is considered for each object.

Type:

bool

priorVersions

Include prior versions of objects in the search.

By default, only the latest version of each object is considered in a search. If the as-of parameter is specified, latest versions are considered as of that time.

Setting this flag to true will cause TRAC to consider superseded object versions in the search. If the as-of parameter is specified as well then all object versions up to that time are considered. Only the latest matching version will be included in the search result.

This flag can be combined with priorTags to search across all tags and object versions. If neither flag is specified, only the latest version and latest tag is considered for each object.

Type:

bool

search

A search expression based on tag attributes.

This field is optional. If no search parameters are given, then all objects are returned.

Type:

SearchExpression

searchAsOf

Perform the search as of a specific date/time.

Supplying this field will cause TRAC to ignore all metadata changes from the specified time onwards. The result will be the same as if a search was performed at the specified time with this field left blank.

If a zone offset is supplied as part of the timestamp, TRAC will apply the offset to search across all metadata items in UTC.

If this parameter is not supplied, the search will be executed as of the current time.

Type:

Optional[DatetimeValue]

class tracdap.rt.metadata.search.SearchTerm

Individual search term for a search of the TRAC metadata store.

Applies a search operator against an individual tag attribute.

attrName

The name of the attribute to search for

Type:

str

attrType

The primitive type of the attribute being searched for

Type:

BasicType

operator

The search operator to apply

Type:

SearchOperator

searchValue

The search value to look for

Type:

Value