Relatics allows users to import data using XML files. XML files are likely to be used when the data provider wants to ensure an open, neutral format and/or needs to apply complex transformations to align source data with the Relatics format.
Data structure of XML file
An XML file contains elements from one or more type elements. The root node, named ‘elements’, contains a child node for each type element.
The code below describes the structure needed to import data into Relatics:
<elements>
<Type_element_name identifyBy="Identifying_type_property">
<element>
<properties>
<Type_property_name>Element data</Type_property_name>
<Type_property_name>Element data</Type_property_name>
<Type_property_name_OptionSet>
<option>Element data</option>
<option>Element data</option>
...
</Type_property_name>
...
</properties>
<relations>
<Type_role_name>
<Target_Type_element_name id="Relation" />
...
</Type_role_name>
<Type_role_name>
<Target_Type_element_name id="Relation" />
<Target_Type_element_name id="Relation" />
...
</Type_role_name>
...
</relations>
</element>
...
</Type_element_name>
...
</elements>
The italicized text in the structure description needs to be replaced by a specific value of the type model.
| Model inserters | Description |
|---|---|
| Type_element_name | The name of the type element. E.g., Action, Person. |
| Identifying_type_property | The name of the type property that identifies an element. The type property must be of the ‘single line text’ data type and comprise unique values. E.g., Name, Requirement Title. |
| Type_property_name | The name of the type property. E.g., Name, Status. |
| Type_property_name_OptionSet | The name of the type property of data type Option set. The values are child elements named option. |
| Type_role_name | The type relation role. E.g., ‘has_x0020_source’, ‘applies_x0020_to’. |
| Target_type_element_name | The type element name of the to type element. E.g., Document, Object. |
When one of the following characters is used in the Type_element_name, Type_element_name, Property_name, or Role_name, the representing escape characters must replace this character:
| Character | Escape character |
|---|---|
| & | _x0026_ |
| – | _x002D_ |
| ( | _x0028_ |
| ) | _x0029_ |
| , | _x002C_ |
| [space] | _x0020_ |
Note:
- Relations are always included in the sheet of the type element that originates from the outgoing direction.
- The names in the XML nodes must match the names of the model objects of the type model.
- Type relations to the same type element must use the same identifying property throughout the whole workbook. For example, a combination of Actions with ‘has executive: Person’ using the EmployeeNumber as identification and Work packages with ‘has responsible: Person’ using the Name as identification is not allowed.
- In a collection relation, the related elements are Target_type_element_name nodes in the same Type_role_name node.
Element data
The XML element ‘element’ data that will be included in the workspace upon import. Each property value must follow the formatting conventions belonging to its data type.
OptionThe value is an exact match of an option value.
| Data type | Value format |
|---|---|
| Attachment | The name and extension of the file (e.g. attachment.txt). When attachment data is used in the XML file, it must be imported as a zip file. |
| Date | Date value formatted as YYYY-MM-DD, e.g., 2025-06-20. |
| Option | The value is an exact match of an option value. |
| Option set | The values are child elements that exactly match an option set value. |
| Number | Numeric value with a dot as decimal separator. The number of digits cannot exceed the precision of the type property. |
| Single line text | Value with a maximum length of 255. |
| Text | Text value can be presented in one of the following two formats:
When text values are formed in HTML format, the value must be placed in a CDATASection object. Notes:
|
| URL | Value as a complete URL. |
Notes:
- Element data is imported following the same rules as manual data editing.
- Number property configured as a formula cannot receive data from an import.
- An absent property node sets the value of the property to the default value of the property.
Relations
Relations are created using one type property as an identifier, which comprises unique values. There are two methods to create relations. Once a method is used for a specific type element, all other relations to this type element need to use the same method.
| Method | XML structure |
|---|---|
| Create relations with existing elements in the workspace. | The value of the id attribute of the Target_Type_element_name XML node must equal the value of the identifyBy property of the related element in the workspace. The XML contains the identifyBy attribute in an XML node with the type element name and no child nodes.
To see an example, refer to the relation Is_x0020_part_x0020_of and the element Risk_x0020_group in the XML example below. |
| Create relations with new elements created while importing. | The value of the id attribute of the Target_Type_element_name XML node equals the value of the identifyBy property of the related element in the file. The XML contains an XML node with the type element name, the identifyBy attribute, and at least a child node for each element that is related to.
To see an example, refer to the relation Arises_x0020_in and element Phase in the XML example below. |
Notes:
- For derived elements, the relation to the origin must be included.
- For middle elements, the relation to the origin and target must be included.
- Recursive elements can be directly related to the elements in the XML file.
XML example
<elements>
<Risk identifyBy="name">
<element>
<properties>
<name>Delays</name>
<description><![CDATA[<p>Delays are a frequent risk in construction projects, often resulting from poor management, permitting issues, or unforeseen circumstances.</p>]]> </description>
</properties>
<relations>
<Arises_x0020_in>
<Phase id="Preliminary design" />
<Phase id="Detailed design" />
<Phase id="Construction" />
</Arises_x0020_in>
<Is_x0020_part_x0020_of>
<Risk_x0020_group id="Project management and planning" />
</Is_x0020_part_x0020_of>
</relations>
</element>
<element>
<properties>
<name>Design inefficiencies</name>
<description><![CDATA[<p>Design inefficiencies can have a major impact on the progress of a project, leading to cost overruns and delays.</p>]]></description>
</properties>
<relations>
<Arises_x0020_in>
<Phase id="Preliminary design" />
<Phase id="Detailed design" />
</Arises_x0020_in>
<Is_x0020_part_x0020_of>
<Risk_x0020_group id="Technical and operational" />
</Is_x0020_part_x0020_of>
</relations>
</element>
</Risk>
<Phase identifyBy="name">
<element>
<properties>
<name>Preliminary design</name>
</properties>
<relations />
</element>
<element>
<properties>
<name>Detailed design</name>
</properties>
<relations />
</element>
<element>
<properties>
<name>Construction</name>
</properties>
<relations />
</element>
</Phase>
<Risk_x0020_group identifyBy="name" />
</elements>
Format attachments
To import attachments, a zip file must be uploaded. The zip consists of the XML file and a folder named ‘Attachments’. The attachments folder contains the files referred to in the XML file for the properties of the attachment data type.
Example structure:
./requirements.zip/
├── Attachments/
│ ├── Verification Plan - Bridge preview.pdf
│ ├── Test report lightning Oct. 27, 2023.pdf
│ ├── Requirement Specification - Bridge 002.pdf
│ └── Public Lighting Standards - Part I.pdf
└── Projectdata.xml
Note:
- Only files named in the XML file are imported into the workspace.