Thesaurus paths are like sets, just a step further: they allow for tree structures and other types of relationships. For instance, if you want to catch all the names, first names and last names, you could write a path like ^n:noun.name (n is the name of the variable). If you wanted only the first names: ^n:noun.name.(first name) or ^n:noun.(first name)
Sub topics are actually ‘non-terminators’ in EBNF: whenever you declare a pattern, all signs are terminators, except when you allow for other (sub) patterns to be part of another pattern.
A simple example would be:
~subject ^v:verb.be ~object
where ~subject is another topic that has patterns like:
^s:pronoun
^s:noun.name
...
You can find lots more info in my tutorials.
What could be done to make Xaiml the “perfect” AI database language?
Don’t make it AIML (or any other language) specific, but allow for multiple systems to co-exist or provide some convertion tool.