high_cities2.taq

$ java -jar taq.jar high_cities2

Running query high_cities in global scope 
high_city(city=addis ababa, altitude=8000)
high_city(city=denver, altitude=5280)
high_city(city=flagstaff, altitude=6970)
high_city(city=leadville, altitude=10200)

Description

high_cities2.taq demonstrates query paraemterization.The “high_cities” query returns a list of cities which are above 5,000 feet elevation. The height threshold is set as a query parameter appended to the query declaration. This makes it easier to change the threshold at a later date.


// Set high elevation threshold query parameter
template high_city(
city ? altitude > threshold, altitude
)

query<axiom> high_cities (city_altitude : high_city)(threshold=5000)

axiom list city_altitude()
{"bilene", 1718}
{"addis ababa", 8000}
{"denver", 5280}
{"flagstaff", 6970}
{"jacksonville", 8}
{"leadville", 10200}
{"madrid", 1305}
{"richmond",19}
{"spokane", 1909}
{"wichita", 1305}