Konnexion

XML Result Format

Version: 05/22/2005

The result of a konnexion chain is available in form of XML. This should be easy to consume in all kinds of applications and platforms. The XML identifies/names each step in the konnexion chain, list the properties of each step and indicates which properties have been passed as parameters to the next step.

The outermost element is <ChainResultList>. This element contains a list of <ChainResult> elements. Each of those elements represents the result set of a given service:

  	<ChainResultList>
	  <ChainResult searchTerm="Diana" 
	  	targetNamespace="http://soap.amazon.com/googleSearch" 
	  	timeStamp="10/19/04 9:03 AM">
	  ...	  	
  

The attribute searchTerm is the passed in search parameter, the timestamp the time when the request was made and the attribute targetNamespace identifies the service. Currently there are the following services (bound to grow):

The <ChainResult> contains the element <ChainResultElementList> which contains the list of results returned from service. This element contains a list of <ChainResultElement> elements. If the service returns only a single result, like weather as opposed to google, then only one ChainResultElement exists. The konnexion engine is always selecting one element randomly. The selected element has the attribute selected set to 'true'.

Here is an example ChainResult:

    <ChainResult searchTerm="Quad,City,Times" 
		targetNamespace="http://www.flickr.com/services/" 
		timeStamp="5/22/05 9:35 AM">
        <ChainResultElementList>
            <ChainResultElement selected="true">
                <Property name="details">
                    <Array name="tags">
                        <Element value="barcelona"/>
                        <Element value="catalunya"/>
                        <Element value="street"/>
                        <Element value="calle"/>
                        <Element value="city"/>
                        <Element value="ciudad"/>
                        <Element value="ciudades"/>
                        <Element value="papelera"/>
                    </Array>
                    <Property name="dateTaken" value="2005-05-22 12:08:18"/>
                </Property>
                <Property name="imageURL" value="http://photos12.flickr.com/15071862_20d655aa38.jpg"/>
                <Property connector="true" name="title" value="Papelera / Litter"/>
            </ChainResultElement>
        </ChainResultElementList>
    </ChainResult>
    

This represents the result of the term "Quad, City, Times" send to the flickr webservices. Only one ResultElement is returned in the call above. The result properties are represented via Property, Array and (Array)Element tags. The actual values that are passed to the next service are indicated with attribute connector set to 'true', as the Property with the name title above. At least one connector must exists. The konnexion engine is selecting randomly which values to choose as connectors. Here is an example with several connectors and two result elements.

    <ChainResult searchTerm="Quad,City,Times" 
    		    targetNamespace="http://www.flickr.com/services/" 
    		    timeStamp="5/22/05 9:35 AM">
        <ChainResultElementList>
            <ChainResultElement selected="true">
                <Property name="details">
                    <Array name="tags">
                        <Element value="barcelona" connector="true"/>
                        <Element value="catalunya" connector="true"/>
                        <Element value="street"/>
                        <Element value="calle"/>
                        <Element value="city" connector="true"/>
                        <Element value="ciudad"/>
                        <Element value="ciudades"/>
                        <Element value="papelera"/>
                    </Array>
                    <Property name="dateTaken" value="2005-05-22 12:08:18"/>
                </Property>
                <Property name="imageURL" value="http://photos12.flickr.com/15071862_20d655aa38.jpg"/>
                <Property  name="title" value="Papelera / Litter"/>
            </ChainResultElement>
            <ChainResultElement selected="false">
                <Property name="details">
                    <Array name="tags">
                    	<Element value="false"/>
                        <Element value="peter"/>
                        <Element value="noortje"/>
                        <Element  value="photo made by evert"/>
                    </Array>
                    <Property name="dateTaken" value="2005-05-22 15:18:33"/>
                </Property>
                <Property name="imageURL" value="http://photos9.flickr.com/15072130_818ccab175.jpg"/>
                <Property name="title" value="peter & noortje"/>
            </ChainResultElement>
        </ChainResultElementList>
    </ChainResult>
 

This is almost as complex as it can get, more ChainResultElements can exist or deeper nested properties, but the structure will remain the same. Take a look at some of the raw xml results referenced in the blog and start playing with it.