Axpress.English

It would be easy to program Axpress to act a certain way if it was able to detect a noticeable decrease in stress, or generally desirable outcome. This can be very useful, but we should also be careful to make sure we don't make short term gains in determent to long term ones. It will be difficult to measure which outcomes are long term.


Easy:

How much energy did my %appliance% use %time period%?

Difficult:

How much more energy did my %appliance% use %time period% than %appliance%?

How to do the above without having to implement for every use case? Meta-rules:

How much %unit% did %thing% %qualifiers% than %other thing%

This can make sense in this limited situation, but what about:

Easy:

How much energy did my %appliance% use %time period%?

Difficult:

How much energy did my %appliance% use %time period% compared to my neighbors?

Is this more abstractly:

How much energy did my %appliance% use %time period% compared to my neighbors?
    or
How much energy did my %appliance% use %time period% compared to %watts%?

One solution:

string: x[string.string] = "my neighbors"
query:  x[units.watts] = _watts

however, how do we know if the question is asking:

How much energy did my %appliance% use %time period% compared to my neighbors' house?
    or
How much energy did my %appliance% use %time period% compared to my neighbors' %appliance%?

Our basic grammar:

How much %unit% did %thing% use
How much %unit% did %thing% use %time period%
How much %unit% did %thing% use %time period% compared to %other thing%
How much more %unit% did %thing% use %time period% than %other thing%

Ok, lets try:

How much %unit% did %thing% use %time period%
    =>
query[abstract.subject] = thing
query[abstract.result] = _result
query[abstract.result][abstract.qualifier] = unit
query[abstract.qualifier] = time_period

drill down:

if:
    query[abstract.subject][rdfs.type] = plotwatt.appliance
    query[abstract.result][abstract.qualifier][units.name] = "watts"
    optional:
    query[abstract.qualifier(a)][rdfs.type] = range.type
    optional:
    query[abstract.qualifier(b)][rdfs.type] = plotwatt.users
then:
    newquery[plotwatt.appliance] = query[abstract.subject]
    newquery[range.time_range] = query[abstract.qualifier(a)]
    newquery[plotwatt.users] = query[abstract.qualifier(b)]
    newquery[units.watts] = _result
and

if:
    q[plotwatt.appliance][plotwatt_appliance.id] = _id
    q[range.begin] = _begin
    q[range.end] = _end
then:
    q[units.watts] = _result
fn:
    select kw from disag6hr where ...

Is there any reason not to just skip the middle step and implement the plotwatt (mysql) query in the abstract?