tsd:multiPath

Purpose

This element specifies information on multipath indexes, which enable efficient indexing even on recursive structures.

Contrary to the earlier versions of Tamino, where each index reflected an absolute XPath address (meaning for queries containing wildcard expressions that all matching indexes had to be analyzed with respect to the given predicate in order to receive a complete index), Tamino can now define an index whose XPath address matches special criteria.

This index is called a multipath index. The idea behind a multipath index is that indexes are identified by a unique label. All nodes (i.e. elements and attributes) having the same label in their index definition address the same index.

The label is specified in the contents of the tsd:multiPath element (see the example below). The type of the label is xs:NMTOKEN.

A multipath index can be defined either as a text index or as a standard index, depending on which is the parent element within the schema. It also allows indexing of recursive structures that could not be indexed in earlier versions of Tamino.

Parent element tsd:text, tsd:standard
Child elements None
Attributes None
Type xs:NMTOKEN
Restrictions The multipath index can only be used when the structure index is set to "condensed" or "full". Identical datatypes and collations must be defined for the nodes that are grouped into one index.

Example

The following example shows an excerpt for the global element Title and two local element definitions for /Play/Act/Abstract/Title and /Play/Prologue/Title. The index definition is extended with the <tsd:multiPath> attribute. The definition above results in three multiPath indexes:

  • an index for /Play/*/Title, labelled as "MultiPathIndex2", containing data from the global title element restricted by the <tsd:which>/Play/Act/Title and data from the local element in /Play/Prologue

  • an index for /Play/Act/*/Title, labelled as "MultiPathIndex3", containing data from the global title element restricted by the <tsd:which>/Play/Act/Scene/Title and data from the local element in /Play/Act/Abstract

  • an index for all other Title elements, labelled as "MultiPathIndex0"

graphics/tsdmultipath1.png

The picture shows which of these three indexes works with which parts of the structure tree. In TSD, the index definition looks like this:

<!-- global Element Definition for Title -->
<xs:element name="Title" type="xs:string">
  <xs:annotation>
    <xs:appinfo>
      <tsd:elementInfo>
        <tsd:physical>
          <!-- default which for global Element Definition Title -->
          <tsd:native>
            <tsd:index>
              <tsd:text>
                <tsd:multiPath>MultiPathIndex0</tsd:multiPath>
              </tsd:text>
            </tsd:index>
          </tsd:native>
        </tsd:physical>
        <tsd:physical>
          <tsd:which>/Play/Act/Title</tsd:which>
          <tsd:native>
            <tsd:index>
              <tsd:text>
                <tsd:multiPath>MultiPathIndex2</tsd:multiPath>
              </tsd:text>
            </tsd:index>
          </tsd:native>
        </tsd:physical>
        <tsd:physical>
          <tsd:which>/Play/Act/Scene/Title</tsd:which>
          <tsd:native>
            <tsd:index>
              <tsd:text>
                <tsd:multiPath>MultiPathIndex3</tsd:multiPath>
              </tsd:text>
            </tsd:index>
          </tsd:native>
        </tsd:physical>
      </tsd:elementInfo>
    </xs:appinfo>
  </xs:annotation>
</xs:element>
.
.
.
<!-- local Element Definition for /Play/Prologue /Title -->
<xs:element name="Title" type="xs:string">
  <xs:annotation>
    <xs:appinfo>
      <tsd:elementInfo>
        <tsd:physical>
          <tsd:native>
            <tsd:index>
              <tsd:text>
                <tsd:multiPath>MultiPathIndex2</tsd:multiPath>
              </tsd:text>
            </tsd:index>
          </tsd:native>
        </tsd:physical>
      </tsd:elementInfo>
    </xs:appinfo>
  </xs:annotation>
</xs:element>
.
.
.
<!-- local Element Definition for /Play/Act/Abstract/Title -->
<xs:element name="Title" type="xs:string">
  <xs:annotation>
    <xs:appinfo>
      <tsd:elementInfo>
        <tsd:physical>
          <tsd:native>
            <tsd:index>
              <tsd:text>
                <tsd:multiPath>MultiPathIndex3</tsd:multiPath>
              </tsd:text>
            </tsd:index>
          </tsd:native>
        </tsd:physical>
      </tsd:elementInfo>
    </xs:appinfo>
  </xs:annotation>
</xs:element>