XIB: eXtensible Information Broker

Home ] Up ] Documents ] Wrapper Builder ] Demo ] Tools used ] Downloads ] Contact Us ]

Up

XIB Broker Builder
Output Template

 

        When information sources are selected, there are numerous ways to integrate them.  For example, given sources ChaptersGlobalSearch and AmazonSearch, we can use them to search for books that appear in both places, for books that can be shipped within 24 hours, etc.  Here we are concerned with the comparison of the prices of the books in these two places.    Hence, the broker engineer needs to interact with XIB to define the output XML template.   This is done in the third frame of the Broker Builder.

Example

    Given the output XML schemata for AmazonSearch and ChaptersGlobalSearch, the broker engineer can define the output XML template as follows:

<?xml version="1.0"?>
<TEMPLATE>
    <CONSTRUCT>
        <newbook>
            <author> $a </author>
            <title> $t </title>
            <AmazonPrice> $p3 </AmazonPrice>
            <ChaptersPrice> $p2 </ChaptersPrice>
        </newbook>
    </CONSTRUCT>

    <WHERE>

        <SOURCE>
            <amazonBook>
                <author> $a </author>
                <title> $t </title>
                <price> $p1 </price>
            </amazonBook>
            <IN> AmazonSearch </IN>
            <CONDITION> amazonSearch.INPUT.query=newSearch.INPUT.queryString</CONDITION>
        </SOURCE>

        <AND/>
        <SOURCE>
            <chaptersBook>
                <authors> $a </authors>
                <bookName> $t </bookName>
                <ourPrice> $p2 </ourPrice>
            </chaptersBook>
            <IN> ChaptersSearch </IN>
            <CONDITION> ChaptersSearch.INPUT.queryString=newSearch.INPUT.queryString </CONDITION>
        </SOURCE>

    </WHERE>
</TEMPLATE>

   This kind of template uses a simplified form of the XML query laguage called XML-QL.  The major difference in the syntax of XIB templates is that the IN clause contains wrapper information, instead of an URL that points to a XML file.  The Construct component of the template defines the intended output, i.e., a list of <newbook> elements which consist of elements <author>, <title>, <AmazonPrice> and <ChaptersPrice>.  The Where part defines how to compose results from different information sources.  Note that the strings preceded by the sign $ denote variables.  In this example, the information sources are joined by the author and title.

    Templates may be edited, loaded or saved in the following frame:

template.jpg (140131 bytes)

 

    

  

ut_crest.gif (2479 bytes)
© Copyrighted University of Toronto

Maintained by Jianguo Lu