Aug 5, 2008

gt project: Explaining the XML schema

The XML data file is the most important input to the gt project. It contains the necessary information to describe each person in the tree as well as his/her relationships with the other people in the data set. The schema of the XML file is as following:

<people>
Initiates a collection of people. This is the root node for the XML file.

  • <person id="1" name="Robert" dob="21-12-1959" dod="" gender="1">
    Initiates each person within the collection. It has the following attributes:
    id: An unique numeric ID given to each person within the collection.
    name: A short name for this person. It is used when rendering the family tree.
    dob: Date of birth in the format DD-MM-YYYY.
    dod: Date of death in the format DD-MM-YYYY. Left blank if not applicable.
    gender: Specifies the gender of the person (0 for a woman, 1 for a man).

    • <parents mother="5" father="4"/>
      Defines who are the parents of the given person. It has the following attributes:
      mother: The unique numeric ID of the mother. Use -1 to specify that mother is unknown.
      father: The unique numeric ID of the father. Use -1 to specify that father is unknown.

    • <spouses id="5,6"/>
      Describes the spouses of the given person. It has the following attributes:
      id: A string containing the comma separated unique numeric IDs of the person's spouses. Left blank if the person has no spouses.

    • <children id="3,2,1"/>
      Describes the children of the given person. It contains the following attributes:
      id: A string containing the comma separated unique numeric IDs of the person's children. Left blank if the person has no children.

    • <names>
            <name id="1" value="Robert Lee Gates"/>
      </names>

      Describes any mutations made to the person's full name. The following attributes are used for each name:
      id: A number representing the order in which the name has changed.
      value: A string representing the changes in the person's name.

    • <description></description>
      A placeholder for placing any free text information about the person.

    • <photos>
            <photo src="[URL]" description="" />
      </photos>

      A collection of photos where the given person is pictured. The following attributes are used for each photo:
      src: The URL of the photo.
      description: A placeholder for any free text captions.

    • <geo>
            <location coords="52.359458,4.887543"/>
      </geo>

      A collection of geographical locations for the given person. This information will be used together with Google Maps to present the locations where the person has spent significant periods of time. The following attributes are used for each location:
      coords: A string representing the comma separated latitude and longitude values of the location.
A sample XML file is available here.

No comments: