Asq is the query engine of Smart World Professional (SWP). It is used two ways: first as a Natrual Language query tool that allows you to speak or type English (only language supported) queries. Second it also allows "SQL-like" queries to be type for fine grained control.
Any time you run an Asq query, they are in a temporary view. If you quit SWP, you'll lose them. To save a query as a Layer, just click the save icon and it will be added to layers.
Natural Language Queries in SWP
You access the natural language query system in SWP by clicking on the microphone icon to the right of the Asq bar. You must hold it down to talk and let go when you are down. At that point it will submit the voice to Asq and it will speak you the results and show the query on the map. On some computers, more than one voice input can be used. Go to Settings > General and under the Audio section pick the microphone you wish to use.
When you hold down the microphone you should speak clearly into the microphone. If Asq doesn't understand you it will tell you so. There are many Asq commands that can be said:
- Go to location (can be a city, state, address, etc): for example
go to Chicago Illinoisor
go to 332 South Michigan Ave Chicago Illinois
- Show me Smart City Layer near a location. Choose anything from the Smart City layers and ask Asq to show you where they are: for example
show me ATMs near Londonor
show me police stations near Newark
- Area Information: To enable area information anywhere in the world, you first need to set a geofence. Set the geofence, click the geofence icon to the right of the Asq bar.
Once you click the geofence tool, click on the map where you want to place the geofence.
Then all you need to do is grab the white corners of the blue fence and drag them to the size you need. After the fence is set (it can be any size), you only need to say the command
area information and Asq will give you a report of what is in that area. Right-click on any points to learn more about what they are.
Important Note: you can type any said natural language command if you don't want to speak to your computer. It will perform the same result.
SQL-like Queries in SWP
You can also think of Asq as the command line for SWP. These can be done using our "Sql-like" query language.
Writing an Asq Query
As mentioned above, Asq is a SQL-like query tool. This means that it generally follows the SQL language. For example:
select * from my_dataset
You can also put in a WHERE clause:
select * from my_dataset where field_name = "value"
There are other supported operators as well including:
Greater than, less than or equal
select * from my_dataset where field_name > 50
select * from my_dataset where radius('1km',point(-0.127758, 51.507351))
Combined queries with multiple operators
select * from my_dataset where field_name = "value and radius('1km',point(-0.127758, 51.507351))
Saving Asq Query
Remember you can save Asq queries by clicking the save icon. See documentation above.
Past Asq queries are saved below the query bar. To re-run a query, just click on it in the list and it will appear back in the Asq query tool.