AQL Example Queries

Get A Value from an Asset & Property

'<assetid>' ASSET '<propertyname>' PROPERTY VALUES

This function returns the value of propertyname for the asset assetid.


Get All of the Properties of an Asset

'<assetid>' ASSET ALLPROPS

This function returns all of the properties that are available for the asset. Note that these are properties and not points - they won't contain the actual values.


Get all Property Values for an Asset

'<assetid>' ASSET ALLPOINTS

This function returns all of the points that are available for the asset, which in turn give you the values.


'<assetid>' ASSET '<relationshipname>' RELATIONSHIP 'down' RELATED

This function returns a list of assets that are downstream from assetid along relationshipname.


Get the value of several different Properties

'<assetid>' ASSET ('Temperature','Status') PROPERTY POINTS

This script gets values for both Temperature and Status from assetid.


Get history for a set of Assets

('<assetida>','<assetidb>') ASSET 'Temperature' PROPERTY POINTS { “range”: “today” } GETHISTORY

This function gets the temperature history for both assetida and assetidb for today.


Get media for an Asset

'<assetid>' ASSET MEDIA

Gets a list of all of the media items for assetid.


Get specific media for an Asset

'<assetid>' ASSET MEDIA 'name' '*isolation*' FILTERMAP

This gets a list of all media items on assetid that has a 'name' that includes the text 'isolation'.


Get values from a table

'<assetid>' ASSET {“Table”: “<tablename>”} GETTABLE

Gets table entries from the specified connected tables for a specific asset.


Get every direct relationship an asset has

NOTE: It might be simpler to use API functions for this call - it is provided as an example of a complex query that builds a program rather than a simple query

This returns every direct relationship an asset has with its neighbours.

Note that each relationship and direction is returned as a separate stack item, so they can be easily identified.

'<assetid>' ASSET 'asset' SET RELS 'rels' SET [ 'asset' GET SWAP 'ddown' RELATED 'index' GET ' downstream' CONCAT NAME ] EACH EAT 'rels' GET [ 'asset' GET SWAP 'dup' RELATED 'index' GET ' upstream' CONCAT NAME ] EACH EAT 'rels' GET


More Examples

See specific examples for more.