birds.taq

$ java -jar taq.jar birds

Running query waterfowl in global scope 
waterfowl(
 bird=whistling swan,
 family=swan,
 color=white,
 flight=ponderous,
 voice=muffled musical whistle,
)
waterfowl(
 bird=trumpeter swan,
 family=swan,
 color=white,
 flight=ponderous,
 voice=loud trumpeting,
)
waterfowl(
 bird=snow goose,
 family=goose,
 color=white,
 size=plump,
 flight=powerful,
 voice=honks,
)
waterfowl(bird=pintail, family=duck, flight=agile, voice=short whistle)

Description

birds.taq throws the spotlight on the normally hidden role archetypes play in unifying axioms with templates. An archetype records the names and order of the participating terms, It allows axiom terms to be paired with template terms efficiently.

In this example, data on birds is segmented into categories “order”, “family” and “species”. This data is incomplete as not all attributes apply to any particular bird. This is how the waterfowl order attributes are indicated

“waterfowl”, ?, ?, “flat”, “webbed”, ?

The applicable order attributes are bill=“flat” and feet=“webbed”. The other attributes are marked with a question mark, meaning “not specified in this category”. Only when all categories are read can the status of this attribute be finalized.

A question mark is implemented as a special type of term called a “blank term”. An archetype recognizes a blank term as a wild card match when paired with any other term and this allows the following sequence over two different query stages

  1. Axiom blank term unifies with empty template term
  2. Axiom valid term unifies with blank template term

Each “waterfowl” axiom in the query result actually contains a mix of blank and filled-in terms, but the blank terms are not shown for clarity.


template order
(
order,
string nostrils,
string live,
string bill,
string feet,
string eats
)

template family
(
family,
order ? order == order.order,
string size,
string wings,
string neck,
string color,
string flight,
string feed,
string head,
string feet,
string tail,
string bill,
string eats
)

template waterfowl
(
bird,
family ? family.family,
. order ? "waterfowl",
color,
size,
flight,
throat,
voice,
eats,
tail
)

query<axiom> waterfowl (bird_order:order, bird_family:family, bird_species:waterfowl)

axiom list bird_order (order, nostrils, live, bill, feet, eats)
{"waterfowl", ?, ?, "flat", "webbed", ?}
{"tubenose", "external tubular", "at sea", "hooked", "webbed", ?}
{"falconiforms", ?, ?, "sharp hooked", "curved talons", "meat"}
{"passerformes", ?, ?, ?, "one long backward toe", ?}

axiom list bird_family (family, order, size, wings, neck, color, flight, feed, head, tail, bill, eats)
{"swan", "waterfowl", ?, ?, "long", "white", "ponderous", ?, ?, ?, ?, ?}
{"goose", "waterfowl", "plump", ?, ?, ?, "powerful", ?, ?, ?, ?, ?}
{"duck", "waterfowl", ?, ?, ?, ?, "agile", "on water surface", ?, ?, ?, ?}
{"albatross", "tubenose", "large", "long narrow", ?, ?, ?, ?, ?, ?, ?, ?}
{"procellariidae", "tubenose", ?, "long narrow", ?, ?, ?, ?, ?, ?, ?, ?}
{"vulture", "falconiforms", ?, "broad", ?, ?, ?, "scavange", ?, ?, ?, ?}
{"falcon", "falconiforms", ?, "long pointed", ?, ?, ?, ?, "large", "narrow at tip", ?, ?}
{"flycatcher", "passerformes", ?, ?, ?, ?, ?, ?, ?, ?, "flat", "flying insects"}
{"swallow", "passerformes", ?, "long pointed", ?, ?, ?, ?, ?, "forked", "short", ?}

axiom list bird_species (bird, family, color, size, flight, throat, voice, eats, tail)
{"whistling swan", "swan", ?, ?, ?, ?, "muffled musical whistle", ?, ?}
{"trumpeter swan", "swan", ?, ?, ?, ?, "loud trumpeting", ?, ?}
{"snow goose", "goose", "white", ?, ?, ?, "honks", ?, ?}
{"pintail", "duck", ?, ?, ?, ?, "short whistle", ?, ?}
{"laysan_albatross", "albatross", "white", ?, ?, ?, ?, ?, ?}
{"black footed albatross", "albatross", "dark", ?, ?, ?, ?, ?, ?}
{"fulmar", "procellariidae", ?, "medium", "flap glide", ?, ?, ?, ?}
{"turkey vulture", "vulture", ?, ?, "v shaped", ?, ?, ?, ?}
{"california condor", "vulture", ?, ?, "flat", ?, ?, ?, ?}
{"sparrow hawk", "falcon", ?, ?, ?, ?, ?, "insects", ?}
{"peregrine falcon", "falcon", ?, ?, ?, ?, ?, "birds", ?}
{"great crested flycatcher", "flycatcher", ?, ?, ?, ?, ?, ?, "long rusty"}
{"ash throated flycatcher", "flycatcher", ?, ?, ?, "white", ?, ?, ?}
{"barn swallow", "swallow", ?, ?, ?, ?, ?, ?, "forked"}
{"cliff swallow", "swallow", ?, ?, ?, ?, ?, ?, "square"}
{"purple martin", "swallow", "dark", ?, ?, ?, ?, ?, ?}