Query Assets

Assets | Lapine Studios provides a query engine for locating assets that match a certain criteria. The query can be used in the search bar on the 'Query' page.

Assets Query Language (AQL)

Within AQL, each criteria is resolved as an 'AND' clause. A valid AQL query is space separated.

Simple Queries

The following table shows the strict AQL syntax where '{X}' is user input. All inputs are case insensitive, and the single quote characters ' are required syntax for a valid AQL query.

Key Function Supports WildCard '*'
ASSET.NAME='{X}' Queries friendly name assigned to the asset.
ASSET.LABEL='{X}' Queries the asset label assigned to the asset.
ASSET.STATUS='{X}' Queries the status or state of the asset..
INVENTORY.NAME='{X}' Queries the name of the inventory for the asset.
TEMPLATE.NAME='{X}' Queries the name of the template for the asset.
ASSET.INDEX='{X}' Queries the asset index. -
ASSET.INDEX.GREATER='{X}' Queries the asset index. -
ASSET.INDEX.LESSER='{X}' Queries the asset index. -
TEMPLATE.INDEX='{X}' Queries the asset template index. -
TEMPLATE.INDEX.GREATER='{X}' Queries the asset template index. -
TEMPLATE.INDEX.LESSER='{X}' Queries the asset template index. -

Complex Queries

The following queries allow checking the created date for the asset for time-based batching. Assets uses the format 'YYYY-MM-DD' for dates.

Key Function
MADE.ON='{YYYY-MM-DD}' Returns assets made on the provided date.
MADE.MADEAFTER='{YYYY-MM-DD}' Returns assets made after the provided date.
MADE.MADEBEFORE='{YYYY-MM-DD}' Returns assets made before the provided date.

Metadata Queries

Assets also allows using metadata for queries. When building a query using metadata, the path to the metadata field must be constructed using the period . character to denote object membership. For example, the nested field 'serial' in the following object has the metadata_key_path of features.manufacturer.serial.

{
    "features": {
        "manufacturer": {
            "serial": "KVVM-567",
            "date": "1678-12-25"
        },
        "exterior": {
            "colour": "green", 
            "make": "metal",
            "logo": false
        }
    }
}

The following table depicts syntax for querying metadata. Note that dates must be provided in the 'YYYY-MM-DD' format both in queries and in respective metadata fields for correct behaviour to occur.

Key Function
[metadata_key_path]:like='{X}' Performs a like comparison for strings, supports the '*' wildchar.
[metadata_key_path]:greater='{X}' Performs a numerical comparison and returns assets with a matching metadata value greater than the provided value.
[metadata_key_path]:lesser='{X}' Performs a numerical comparison and returns assets with a matching metadata value lesser than the provided value.
[metadata_key_path]:equal='{X}' Performs a numerical comparison and returns assets with a matching metadata value equal to the provided value.
[metadata_key_path]:on='{YYYY-MM-DD}' Performs a date comparison and returns assets with a matching metadata date.
[metadata_key_path]:after='{YYYY-MM-DD}' Performs a numerical comparison and returns assets with a later metadata date.
[metadata_key_path]:before='{YYYY-MM-DD}' Performs a numerical comparison and returns assets with an earlier metadata date.

Example

The following example shows a valid AQL query and describes its target assets.

Scheduled Maintainence

The following query requests assets within the 'Red' inventory, held by the user 'bill@example.com', with the metdata key 'maintainance.next.date' between '2025-05-05' and '2025-06-05'.

INVENTORY.NAME='Red' HOLDER.NAME='bill@example.com' maintainence.next.date:after='2025-05-05' maintainence.next.date:before='2025-06-05'