Crash Course AllianceBlock Query Language (ABQL)

Getting started with ABQL


If you are already comfortable with JSON (JavaScript Object Notation), you shouldn't have problems to write to write valid ABQL. 


                                     

                                              Overview of all queries 


Basic examples
Return all data 
Return some data 
Data schema 
There are two root properties returned in each dataset result
"Schema" contains the description of each data field, including their data types

"Results" show data itself 
Concrete examples
Select 3 columns from all records 
Select data from a nested object and rename the column name user friendly 
Select the sum of the amounts and name it total
Working with conditions 
Records whose property "year" equals 2015
A range (>2000, < / = 2010) 
"or" condition 

Ordering data

Ordering data can be done on

multiple fields (in an array). Use ASC for ascending order

DESC for descending order.

Query operators ($<operator>)

Operators are used mainly in

conditions to build ranges, exclusions or inclusions. 

The following operators are currently supported



  • $eq (equal)
  • $neq (not equal)
  • $gt (greather than)
  • $lt (less than)
  • $gte (greater than or equal to)
  • $lte (less than or equal to)
  • $or (or)
  • $and (and)
  • $nlt (not less than)
  • $ngt (not greater than)

A more advanced example

Get the current stock bought, subtracting everything that was sold from everything that was bought





*ABQL is based on JSON. Click here for a deeper understanding of working with JSON. 

**Please note that ABQL is still in development 


Click here to read the full article on Medium.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.