GeoEco.Datasets.Collections.FileDatasetCollection.GetOldestDataset

FileDatasetCollection.GetOldestDataset(expression=None, **options)

Queries the collection and returns the oldest Dataset that matches the search expression.

Requires: Python pyparsing module.

Parameters:
  • expression (str, optional) –

    A SQL-like query expression that selects the datasets of interest based on the values of their queryable attributes. If not provided, all of the datasets in the collection will be selected.

    The expression is similar to a SQL “where” clause and may contain the following elements:

    • The names of any queryable attributes, with no delimiters, that are defined for objects in the collection, including those they inherit from their parents.

    • The binary comparison operators =, <, >, <=, >=, and <>.

    • Literals for integers, floating point numbers (with . as the decimal point), Booleans (written true and false), strings (delimited with single or double quotation marks), or dates (written #YYYY-mm-dd HH:MM:SS# or #YYYY-mm-dd# with YYYY as the four-digit year, mm as the two-digit month, dd as the two-digit day, HH as the two-digit hour 00 to 23, MM as the two-digit second, and SS as the two-digit second, with the hour, minute, and second assumed to be 00:00:00 if not provided).

    • The binary comparison operator in or not in followed by a comma-delimited list of literals, enclosed in ( and ).

    • The binary comparison operator matches followed by a string literal that specifies a regular expression in Python syntax.

    • The binary arithmetic operators +, -, *, and /, which may be applied to queryable attributes and numeric literals.

    • The unary arithmetic operator -, which may be used to negate a queryable attribute or numeric literal.

    • The binary logical operators or and and and unary logical operator not. not has highest precedence; or has lowest. Logical expressions may be chained together but not nested (in parentheses or by any other means).

    Operators and queryable attribute names are case-insensitive.

    Minimum length꞉ 1.

  • options (dict mapping str to object) – Additional options specific to the collection type.

Returns:

The oldest Dataset that matches the search expression, or None if nothing matches or the collection is empty.

Return type:

Dataset