====AQL Example Queries==== ===Get A Value from an Asset & Property=== **'' [[fASSET|ASSET]] '' [[fPROPERTY|PROPERTY]] [[fPOINTS|VALUES]]** \\ This function returns the value of //propertyname// for the asset //assetid//. ---- ===Get All of the Properties of an Asset=== **'' [[fASSET|ASSET]] [[fALLPROPS|ALLPROPS]]** This function returns all of the properties that are available for the asset. Note that these are [[property_list|properties]] and not [[point_list|points]] - they won't contain the actual values. ---- ===Get all Property Values for an Asset=== **'' [[fASSET|ASSET]] [[fALLPOINTS|ALLPOINTS]]** This function returns all of the points that are available for the asset, which in turn give you the values. ---- ===Get related Asssets=== **'' [[fASSET]] '' [[fRELATIONSHIP]] 'down' [[fRELATED]]** This function returns a list of assets that are //down//stream from //assetid// along //relationshipname//. ---- ===Get the value of several different Properties=== **'' [[fASSET]] ('Temperature','Status') [[fPROPERTY]] [[fPOINTS]]** This script gets values for both Temperature and Status from //assetid//. ---- ===Get history for a set of Assets=== (**'','') [[fASSET]] 'Temperature' [[fPROPERTY]] [[fPOINTS]] { "range": "today" } [[fGETHISTORY]]** This function gets the temperature history for both assetida and assetidb for today. ---- ===Get media for an Asset=== **'' [[fASSET]] [[fMEDIA]]** Gets a list of all of the media items for //assetid//. ---- ===Get specific media for an Asset=== **'' [[fASSET]] [[fMEDIA]] 'name' '*isolation*' [[fFILTERMAP]]** This gets a list of all media items on //assetid// that has a 'name' that includes the text 'isolation'. ---- ===Get values from a table=== **'' [[fASSET]] {"Table": ""} [[fGETTABLE]]** 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. **'' [[fASSET]] 'asset' [[fSET]] [[fRELS]] 'rels' [[fSET]] [ 'asset' [[fGET]] [[fSWAP]] 'ddown' [[fRELATED]] 'index' [[fGET]] ' downstream' [[fCONCAT]] [[fNAME]] ] [[fEACH]] [[fEAT]] 'rels' [[fGET]] [ 'asset' [[fGET]] [[fSWAP]] 'dup' [[fRELATED]] 'index' [[fGET]] ' upstream' [[fCONCAT]] [[fNAME]] ] [[fEACH]] [[fEAT]] 'rels' [[fGET]]** ---- ===More Examples=== See [[specific examples|specific examples]] for more.