Documentation

GTF Document

GTF documents are plain text files. It is consisted of different key-value pairs arragements. The key value pair represent the name and value of one attribute. It is represented like this:

type=Person or name="Mark"

The value should be inside quotation marks if it contains spaces itself, or if the value is considered as a string.

Different key-value pairs are separated by spaces. A line can contain many key-value pairs. For example:

In this simple example, each line represent an address because the "type" key-value pairs are both "Address". This means that each line represent one instance of the type indicated in the "type" key-value pair.

Things can get more complex when the indentation comes in. Let's use the folloing example:

The above is basically the same as the example before, but in a different representation. This time we took out the common key-value pair to the first line. The rest of the 2 lines goes after the common attributed first line, but indented once. This grouping of key-value pairs is the most important property of a GTF document. Note that the "type" key-value pair does not necessarily have to be in the front, and the key-value pairs can be arranged in any order if they are in the same line.

The first form which is not indented is called the normalised form of the document. It is the most simple form that has a lot of key-values repeated.

GTF Validation Header

Just like XML has its DTD and schema, GTF has its own header which can help validating the document. The GTF validation header is a header put in the beginning of a GTF file. It describe the expected relationships which can appear in the document. For our example before, we can have the following header:

Address(city, street, number)

This specifies that there should only be information type of "Address", and this type should contain "city", "street" and "number" key-value pairs. Each new definition should start on a new line.

XML Represenation of GTF

There is an XML representation of the GTF document. The following is the normalised previous example in XML:

Each entity is surrounded by a <link> tag, with the key-value pairs inside it.

To make the XML represent a non-normalised GTF document, we used another tag called <block> like this:

Common key-value pairs are placed inside the <block> tag but before the <link> tag. <block> tag contains everything which belong to that group.

The XML file does not have a validation header. Instead it can be linked to 2 other schema, one being more relaxed and another one being more strict. The relax one can be added by having the "schema" attribute in the document tag. The stricter one is added using the "schema_norm" attribute. For example:

Both schema files can be generated using the converter.