Formatting the Thesaurus XML

Last Updated: 17 Dec 2015

When creating a Thesaurus, terms can be added either manually using the Asset Map or automatically by uploading an XML file. The XML File will determine the layout of the Thesaurus, including its terms and relations. For more information on importing an XML File, refer to the Thesaurus chapter in this manual.

When using an XML File to set the layout of the Thesaurus, the file must have a set structure to allow the Thesaurus to correctly output the terms and their relations. Below are basic XML code structures for the Thesaurus with the code variables highlighted. On the left is the basic structure while on the right is the code put into context.

<thesaurus>
  <term name="TERM1">
     <relation name="RELATION">
      <term name="TERM2" />
    </relation>
  </term>
</thesaurus>  
<thesaurus>
  <term name="disappear">
    <relation name="synonym_of">
      <term name="vanish" />
    </relation>
  </term>
</thesaurus>  

The above code displays two Thesaurus Terms linked by a relation. In this case, disappear and vanish are linked by synonym of.

To display more than one set of terms and relations, the structure of the code is duplicated within the <thesaurus> tags, as shown below.

<thesaurus>
  <term name="TERM1">
    <relation name="RELATION">
      <term name="TERM2" />
    </relation>
  </term>
  <term name="TERM3">
    <relation name="RELATION">
      <term name="TERM4" />
    </relation>
  </term>
</thesaurus>   
<thesaurus>
  <term name="disappear">
    <relation name="synonym_of">
      <term name="vanish" />
    </relation>
  </term>
  <term name="letter">
    <relation name="synonym_of">
      <term name="message" />
    </relation>
  </term>
</thesaurus>   

Now the code displays four Thesaurus Terms linked in pairs by the same relation. In this case, letter and message are also linked by synonym of as well as disappear and vanish.

To relate terms to child terms, duplicate the code structure within the child term’s tags, as shown below.

<thesaurus>
  <term name="TERM1">
    <relation name="RELATION">
      <term name="TERM2" >
        <relation name="RELATION2">
          <term name="TERM3" />
        </relation>
      </term>
    </relation>
  </term>
</thesaurus>   
<thesaurus>
  <term name="disappear">
    <relation name="synonym_of">
      <term name="vanish" >
        <relation name="antonym_of">
          <term name="appear" />
        </relation>
      </term>
    </relation>
  </term>
 </thesaurus>   

The new code contains three Thesaurus Terms and two relations. In this case, disappear is a synonym of vanish which is an antonym of appear.

To assign multiple children to a term using more than one relation, duplicate the child term tags within multiple sets of relation tags, as shown below. 

<thesaurus>
  <term name="TERM1">
    <relation name="RELATION">
      <term name="TERM2" />
      <term name="TERM3" />
      <term name="TERM4" />
    </relation>
    <relation name="RELATION2">
      <term name="TERM5" />
      <term name="TERM6" />
      <term name="TERM7" />
    </relation>
  </term>
</thesaurus>   
<thesaurus>
  <term name="disappear">
    <relation name="synonym_of">
      <term name="vanish" />
      <term name="fade_away" />
      <term name="dissolve" />
    </relation>
    <relation name="antonym_of">
      <term name="appear" />
      <term name="materialise" />
      <term name="emerge" />
    </relation>
   </term>
 </thesaurus>   

In the above code, the term disappear has six child terms catagorised into either the synonym of (vanish, fade away and dissolve) or antonym of (appear, materialise and emerge) relations.

These basic formats can be recreated to configure a Thesaurus of any kind and by using Reflections these relations can reciprocate either the same or different relations back to their parent. For more information on Reflections, refer to the Thesaurus chapter in this manual.

PreviousFinish


Previous Chapter

The Latest

Let Us Know What You Think

Let us know if you spot any errors or if you have any ideas on how we can improve the Matrix Community Website.

Contact Squiz for Demo

Let us show you the true power of Squiz Matrix by giving you a personalised demonstration.