Alloy Query Syntax (AQS)
Query your Alloy data
Alloy Query Syntax (AQS) provides a way for you to query the data stored in your Alloy database.
You can:
-
fetch items of a particular design/interface and view their attribute data
-
filter queried items based on one or more conditions, for example:
- Is this attribute populated?
- Is the value of this attribute less than X?
- Is the item located in this area?
-
view the attribute data of items referenced by a Link attribute on queried items, for example:
- What defects does each Bollards item have?
- What jobs were raised from each Inspections item?
- Which team members are part of each Teams item?
-
count items and calculate statistics for specific attributes, for example:
- How many assets in a specific area have unresolved defects?
- What's the standard deviation of the trunk width of all Trees items?
- What's the minimum column height of all Street Lights items?
Building queries
Alloy lets you build queries visually, without having to write any code!
To learn how, familiarise yourself with the AQS Builder, and then see Building an AQS query.
Advanced users can write queries in JSON format and run them via the Alloy API, see the Developer Docs.
Query ideas
To get an idea of what AQS can do, consider the Jobs interface. Here are some of the queries that are possible:
See job query ideas
- fetch jobs that are High priority and In Progress
- fetch jobs that were raised between 15 March 2021 and 30 April 2021
- fetch jobs that are estimated to end in the next 14 days
- fetch jobs that fix registered defects
- fetch jobs with long descriptions or that contain a keyword
- see which teams jobs are assigned to (including those with none set)
- count the jobs in a specific area