- *The correct title of this article is xAIML. To avoid letting the initial letter be capitalized due to technical restrictions with WikiMedia, we have prepended a "*" (asterisk) to the title.
xAIML is a meta-specification for extending AIML while preserving measurable compatibility with other interpreters.
xAIML dialects comprise a hierarchy, at the root of which is xAIML0. xAIML0 is functionally exactly equivalent to AIML. Subsequent children in the hierarchy are derivations from this root. The simplest derivations may simply add or remove a template element, while the most radical may replace the pattern matching mechanism or completely overhaul the AIML syntax/functionality set.
An xAIML dialect is described by a specially annotated XML Schema. The xAIML annotations provide the following information about every element in the dialect:
- complete functional description
- availability/location of test cases
- reference implementation
- recommended fallback behavior
The root-level xAIML0 schema provides this information for all elements of AIML. An xAIML dialect really only needs to provide information about how it differs from its parent. This information is provided using a schema called xAIML-Spec. An xAIML Interpreter is able to compare xAIML dialects (xAIML specs) with one another, and provide a measurement of the difference between any two dialects. Any xAIML Interpreter is capable of interpreting one or more xAIML dialects. If presented with an xAIML set associated with a "foreign" xAIML dialect, it is able to:
- retrieve the foreign schema
- provide information about elements that the current interpreter does not implement according to the foreign dialect
- indicate which elements it will be able to handle using fallback behavior
- indicate which elements will fail
This enables the user of the xAIML interpreter to make informed decisions about whether to seek another interpreter, modify an existing interpreter, modify a given xAIML set, or proceed without changes.
Thus, for example, if we wanted to create a simple xAIML dialect that simply extends xAIML0 by adding a
<spellcheck/> element, we would only need to provide the description of this element and information about where it can appear. The xAIML-Spec fragment that would take care of this might look something like this:
<xas:insert location="xpointer(http://aitools.org/xaiml/xaiml0.xsd#/xs:schema/xs:group[@name = 'textFormattingElements']/xs:choice/xs:element[position() = last()]" point="after"> <xs:element name="spellcheck" type="MixedTemplateContentContainer"> <xs:annotation> <xs:appinfo> <xas:spec> <xas:functional-description> Checks its content (result of processing contents) against a spelling dictionary (configured elsewhere) and replaces any word not found in the dictionary with its closest match. (If no match is found according to the spellchecker's algorithm, the original word is preserved.) </xas:functional-description> <xas:test-cases> <tc:TestCase> <tc:Description>Tests the spellcheck function.</tc:Description> <tc:Input>testspellcheck That is so wierd.</tc:Input> <tc:ExpectedAnswer>That is so weird.</tc:ExpectedAnswer> </tc:TestCase> </xas:test-cases> <xas:reference-implementation url="http://x-31.com/spellingbot"/> <xas:fallback strategy="transparent"/> </xas:spec> </xs:appinfo> </xs:annotation> </xs:element> </xas:insert>
Given that this specifies its parent as being the xAIML0 dialect, if this is the only item in the xAIML-Spec document for this dialect, then we know that the only difference between this dialect and xAIML0 is the addition of the
<spellcheck/> element. We are also told that the fallback strategy is "transparent", which means (according to xAIML-Spec) that if a given xAIML interpreter cannot implement the functionality of this element, it is to simply ignore the presence of the element, as if the element's contents were included directly.
Thus, if we are using an xAIML interpreter that does not know this dialect, and we give it an xAIML file that starts like this:
<?xml version="1.0" encoding="UTF-8" ?> <x:aiml xmlns:aiml="http://x-31.com/xaiml-spellingbot"> ...
...we know that the interpreter can still confidently load and interpret the entire file--it will only be unable to correct spelling with the
<spellcheck/> element. The xAIML interpreter will provide information that might look something like this:
WARN: File "example.xml" contains unknown xAIML dialect "http://x-31.com/xaiml-spellingbot". WARN: "http://x-31.com/xaiml-spellingbot" parent is "http://aitools.org/xaiml". WARN: Difference from parent is 1%. WARN: 1 element(s) in foreign dialect are not implemented by this interpreter: element spellcheck. WARN: 1 out of 1 unimplemented element(s) can be successfully handled with fallback behavior.
xAIML grows out of needs that have arisen since the formalization and standardization of AIML in 2001. It is generally agreed that the publication of the formal AIML specification encouraged an explosion in the development of AIML interpreters. Implementors of these interpreters, as well as AIML developers, found it very beneficial to be able to rely on a fixed standard that provided a reasonable guarantee that AIML working on one interpreter would work on another.
At the same time, however, many people have wished to extend the functionality of AIML, and some people have decided to implement AIML interpreters that do not fully conform to the AIML specification (for instance, commonly, do not implement the
In order to alleviate the pressure and the confusion, xAIML is provided as a "meta-specification" that gives interpreter implementors and AIML developers a path to follow when providing and using new functionality. xAIML does not specify any new functionality for AIML--instead, it specifies how to specify a derivation of AIML. It is anticipated that people's needs may vary widely--some may only want to remove or add one or two tags, while others will want to deploy a considerably different variation of the functionality set. In all cases, xAIML offers a framework for formally describing these derivations, called "xAIML dialects", and for measuring the difference between any two dialects.
A key aspect of the xAIML framework is its use of Internet domain names. Since the ownership of domain names is well-established and regulated, this provides a handy mechanism for implementors and developers to keep track of "ownership" of xAIML dialects. Creators of xAIML dialects are provided the opportunity to supply extensive detail about the implementation of unique functionality, although some parts of the specification are also optional and do not preclude the participation of dialects whose source code is hidden.
Also key to xAIML is its use of a simple hierarchy of inheritance (see above). The "baseline" xAIML, dubbed "xAIML0" is functionally equivalent to AIML (and provides a fully xAIML-Spec annotated description of the same)--every other dialect inherits directly or indirectly from this. This is the mechanism by which xAIML dialects may easily make small changes to a dialect (or numerous changes) without needing to literally duplicate the effort provided by parent/ancestor dialects.
Any AIML interpreter may become an "xAIML Interpreter" by implementing a well-specified set of essential functionality. It is anticipated that a liberally-licensed library of xAIML functionality in several popular programming languages will be made available here.
- Does xAIML "compete" with AIML?
- How is "xAIML" pronounced?
- What happens if there is a new version of AIML?
The xAIML specification currently exists as an open discussion, facilitated by wiki and mailing list. It is anticipated that the development process will be iterative, and will benefit from wide involvement by the community of AIML interpreter implementors, AIML developers, and other interested parties.