The format of a macrocontribution search result

Here is - for pedagogical reasons - a step-wise explanation of the format.

The result from a macrocontribution search has a sequence of <talia:entry> elements, one for each found contribution (or rather contribution version):

<?xml version="1.0" encoding="UTF-8"?>
<talia:result xmlns:talia="http://trac.talia.discovery-project.eu/wiki/Exist#" total="123">

    <talia:entry>...</talia:entry>

    <talia:entry>...</talia:entry>

    <talia:entry>...</talia:entry>

    <talia:entry>...</talia:entry>

    <talia:entry>...</talia:entry>

    ...

</talia:result>

To support the building of the left menu, the entries are wrapped in a hierarchy of elements that reflect the material hierarchy of the macrocontribution.

Here's a sketch:

<?xml version="1.0" encoding="UTF-8"?>
<talia:result xmlns:talia="http://trac.talia.discovery-project.eu/wiki/Exist#" total="123">

    <book>

        <chapter>

            <paragraph>

                <talia:entry>...</talia:entry>

            </paragraph>

            <paragraph>

                <talia:entry>...</talia:entry>

            </paragraph>

            ...

        </chapter>

        <chapter>

            ...

        </chapter>

        ...

    </book>
    
    ...

</talia:result>

The grouping is realised not with particular elements for each granularity level like shown above (<book>, <chapter>, etc), but with one common <talia:group> element. Each <talia:group> element contains sub-elements with all the necessary information to build the left menu.

This is more like the real thing:

<?xml version="1.0" encoding="UTF-8"?>
<talia:result xmlns:talia="http://trac.talia.discovery-project.eu/wiki/Exist#" total="123">

    <talia:group>
    
        <talia:granularity>book</talia:granularity>
        <talia:title>...title of book...</talia:title>
        <talia:uri>...uri of book...</talia:uri>

        <talia:group>
        
            <talia:granularity>chapter</talia:granularity>
            <talia:uri>...uri of chapter...</talia:uri>
            <talia:title>...title of chapter...</talia:title>

            <talia:group>
            
                <talia:granularity>paragraph</talia:granularity>
                <talia:title>...title of paragraph...</talia:title>
                <talia:uri>...uri of paragraph...</talia:uri>

                <talia:entry>...</talia:entry>

            </talia:group>

            <talia:group>
            
                <talia:granularity>paragraph</talia:granularity>
                <talia:uri>...uri of paragraph...</talia:uri>
                <talia:title>...title of paragraph...</talia:title>

                <talia:entry>...</talia:entry>

            </talia:group>
            
            ...

        </talia:group>

        <talia:group>
        
            <talia:granularity>chapter</talia:granularity>
            <talia:uri>...uri of chapter...</talia:uri>
            <talia:title>...title of chapter...</talia:title>

            ...

        </talia:group>
        
        ...

    </talia:group>
    
    <talia:group>
    
        <talia:granularity>book</talia:granularity>
        <talia:title>...title of book...</talia:title>
        <talia:uri>...uri of book...</talia:uri>

        ...

    </talia:group>
    
    ...

</talia:result>

Comment: Normally the <talia:group> elements at leaf level have one <talia:entry> sub-element each. But in theory there can be more than one <talia:entry> sub-element. E.g, in theory there might be more than one contribution for the same paragraph.

The entries themselves have the following format:

<talia:entry>

    <talia:metadata>
    
        <talia:maintype>contribution</talia:maintype>
        <talia:type>transcription</talia:type>
        <talia:subtype>hnml</talia:subtype>
        <talia:uri>http://a.b.c/ccc</talia:uri>
        <talia:authors>
            <talia:author>
                <talia:lastname>Williams</talia:lastname>
                <talia:firstname>Andrew</talia:firstname>
            </talia:author>
            ...
        </talia:authors>
        <talia:title>...</talia:title>
        <talia:standard_title>...</talia:standard_title>
        <talia:language>it</talia:language>
        <talia:date>2006-03-03</talia:date>
        
    </talia:metadata>

    <talia:excerpt>...</talia:excerpt>
    
</talia:entry>

At the time of writing (2008-09-17) the <talia:entry> element might contain additional elements, but the above are what the search interface needs.

Finally, the root element <talia:result> might contain attributes that are not relevant for the current version of macrocontribution search. These attributes are meant for long results that are divided into pages. Currently we do not divide macrocontribution search results into pages. The total attribute is the only useful attribute for macrocontribution search. It contains the number of contributions (entries) found. A search that finds nothing will have an empty root element and a total value of 0. But the total can also be found by counting the <talia:entry> elements, and is therefore somewhat redundant.