Friday, February 26, 2010

An Open Suggestion to Wolfram|Alpha

It's just a suggestion, really: nested queries. This feature is partially implemented currently, as you can search things like "weather Chicago the day Barack Obama was born", but there's no reserved character system to input queries in queries and use the sub-queries results as arguments in the main query.

Example of possible use: "max({{life expectancy USA {{USA median age male}} male}}, {{life expectancy USA {{USA median age female}} female}})", where {{query}} denotes a subquery.

That particular example finds the life expectancy of American men and women of the median American age for their gender and returns the larger of the two. Normally this would take five queries:

USA male median age --> 35.4 years
USA female median age --> 38.1 years
life expectancy USA male 35.4 years --> 77.35 years
life expectancy USA female 38.1 years --> 81.76 years
max(77.35, 81.76) --> 81.76

With subqueries, however, we get a single mega-query which returns our answer (81.76 years) without several queries and copy and paste.

Just my two cents.

No comments: