Last active
August 29, 2015 14:02
-
-
Save milko/f2dcea3c3a94f69bb0bb to your computer and use it in GitHub Desktop.
OntologyWrapper XML export schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | |
| <!-- ============================================================ --> | |
| <!-- METADATA --> | |
| <!-- ============================================================ --> | |
| <!-- ROOT --> | |
| <xs:element name="METADATA"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This is the root element for metadata blocks. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The meta block is the metadata transaction unit. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:sequence> | |
| <xs:element maxOccurs="unbounded" ref="META"/> | |
| </xs:sequence> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- ELEMENTS --> | |
| <xs:element name="META"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each block represents a set of term, node, edge and tag | |
| instances which define a set of graph related elements. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="TERM"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| List of terms. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:element> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="TAG"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| List of tags. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:element> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="NODE"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| List of nodes. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:element> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="EDGE"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| List of edges. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:element> | |
| </xs:sequence> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- TERM --> | |
| <xs:element name="TERM"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This block holds the term properties, this element is repeated | |
| for as many terms need to be defined in the current META block. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each item represents a term property, these items should include | |
| all properties except those defined by the term attributes: namespace, | |
| local identifier and native identifier. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="item"/> | |
| </xs:sequence> | |
| <xs:attribute name="ns" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Term namespace as the namespace's term global identifier. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="lid" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Term local identifier, required to provide the term identifier. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="pid" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Term persistent identifier, optional if the local identifier was provided. | |
| The main use of this attribute is to provide a persistent identifier that | |
| is not composed by the concatenation of the namespace and local identifier | |
| with the colon separator token. This attribute represents the term native | |
| identifier. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="set" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Modification reference. This attribute must hold the persistent identifier | |
| of a term: if provided, it means that the properties of the current block | |
| will be added or replace those in the term corresponding to the native | |
| identifier provided in this attribute. This should be the only attribute | |
| of this element. Note that the block properties are assumed to be at the | |
| root level, this means that to modify a nested property you must provide | |
| the full root level enclosing property. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- NODE --> | |
| <xs:element name="NODE"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This block holds the node properties, this element is repeated | |
| for as many nodes need to be defined in the current META block. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each item represents a node property, these items should include | |
| all properties except those defined by the node attributes: term, | |
| tag and persistent identifier. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="item"/> | |
| </xs:sequence> | |
| <xs:attribute name="tag" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Tag reference, should refer to the native identifier of the tag; | |
| this attribute and the term attribute are mutually exclusive. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="term" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Term reference, should refer to the native identifier of the term; | |
| this attribute and the tag attribute are mutually exclusive. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="pid" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute represents the node persistent identifier. | |
| Node native identifiers are integer sequence numbers that are assigned | |
| sequentially as nodes are instantiated, which makes them unusable | |
| across implementations. This optional persistent identifier can be used | |
| to uniquely identify a node across implementations. | |
| This attribute can be used to reference an existing alias node, in that | |
| case you should omit both the tag and term and all other items. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="set" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Modification reference. This attribute must hold the persistent identifier | |
| of a node: if provided, it means that the properties of the current block | |
| will be added or replace those in the node corresponding to the native | |
| identifier provided in this attribute. This should be the only attribute | |
| of this element. Note that the block properties are assumed to be at the | |
| root level, this means that to modify a nested property you must provide | |
| the full root level enclosing property. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- EDGE --> | |
| <xs:element name="EDGE"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This block holds the edge properties, this element is repeated | |
| for as many edges need to be defined in the current META block. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each item represents an edge property, these items should include | |
| all properties since none are defined by attributes. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="item"/> | |
| </xs:sequence> | |
| <xs:attribute name="set" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Modification reference. This attribute must hold the persistent identifier | |
| of an edge: if provided, it means that the properties of the current block | |
| will be added or replace those in the edge corresponding to the native | |
| identifier provided in this attribute. This should be the only attribute | |
| of this element. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- TAG --> | |
| <xs:element name="TAG"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This block holds the tag properties, this element is repeated | |
| for as many tags need to be defined in the current META block. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each item represents a tag property, these items should include | |
| all properties since none are defined by attributes. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="item"/> | |
| </xs:sequence> | |
| <xs:attribute name="set" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Modification reference. This attribute must hold the persistent identifier | |
| of a tag: if provided, it means that the properties of the current block | |
| will be added or replace those in the tag corresponding to the native | |
| identifier provided in this attribute. This should be the only attribute | |
| of this element. Note that the block properties are assumed to be at the | |
| root level, this means that to modify a nested property you must provide | |
| the full root level enclosing property. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- Properties --> | |
| <xs:element name="item"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| These elements represent object properties, each element must reference a Tag. | |
| Tags are identified with the property attributes, array properties are | |
| expressed with nested item elements, while scalar properties are expressed | |
| in the element value. Structures are represented by nested item elements. | |
| Of these attributes, tag, seq and const serve the purpose of selecting the | |
| Tag; the node attribute indicates that the element value is referencing a node | |
| and it provides the necessary information to interpret the element value; | |
| the key attribute indicates an array key. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType mixed="true"> | |
| <xs:sequence> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Nested item elements represent members of an array or structured property. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="item"/> | |
| </xs:sequence> | |
| <!-- Tag references --> | |
| <xs:attribute name="tag" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute can be used to qualify the current element as an offset | |
| identified by a tag reference, in this case the attribute value is a string | |
| representing a Tag object native identifier. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="seq" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute can be used to qualify the current element as an offset | |
| identified by a tag reference, in this case the attribute value is a string | |
| representing a Tag object sequence number. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <!-- Node references --> | |
| <xs:attribute name="node" type="node-ref-type"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute can be used to qualify the current element as a node reference, | |
| the attribute value is an enumerated set that indicates how the element value | |
| should be interpreted: | |
| tag - the element value is a tag native identifier; | |
| term - the element value is a term native identifier; | |
| node - the element value is a node native identifier; | |
| pid - the element value is a node persistent identifier. | |
| The last two options represent a univoque node reference; when using the first | |
| two options, the resulting master node will be resolved by default. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <!-- Key references --> | |
| <xs:attribute name="const" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute can be used to qualify the current element as either a root | |
| property, or as a sub-structure element, in this case the attribute value | |
| references a constant that should be defined and resolved by the software | |
| that will parse the file. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="key" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute can be used to qualify the current element as either a root | |
| property, or as a sub-structure element, in this case the attribute value | |
| represents the actual offset or element key. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <!-- Structure references --> | |
| <xs:attribute name="struct" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute is used to indicate in which container structure the | |
| current element should be stored, this and the next two attributes | |
| can be used to provide individual structure elements at the root | |
| level without the need to shape the XML as the actual structure. | |
| The value of this attribute should be a Tag object native identifier, | |
| this tag should be of type struct. If the tag is not a list, the | |
| value of the current element will be set in the offset indicated by | |
| the other tag reference attributes and that offset will be stored as | |
| an element of the structure indicated by this attribute, in this case, | |
| the next two attributes should be omitted; if the tag is a list, the | |
| next two attributes are required to identify which element of the list | |
| of structures is to receive the current element. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="index" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute is only relevant if the struct attribute was provided | |
| and if that struct is also a list: it holds the Tag object native | |
| identifier indicating which offset in the container structures list | |
| acts as the index of the list elements. | |
| This means that the current item element should be stored in the list | |
| element which features the tag identified by this attribute matching | |
| the value provided in the next attribute. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="value" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute is only relevant if the struct attribute was provided | |
| and if that struct is also a list: it holds the value that should be | |
| matched with the values of the tag indicated in the index attribute | |
| to select in which element of the list the current element should be | |
| stored. | |
| This means that the current item element should be stored in the list | |
| element in which the offset value, defined by the index attribute, is | |
| equal to the value of the current attribute. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- ============================================================ --> | |
| <!-- UNITS --> | |
| <!-- ============================================================ --> | |
| <!-- ROOT --> | |
| <xs:element name="UNITS"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This is the root element for units blocks. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The unit block is the units transaction unit. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:sequence> | |
| <xs:element maxOccurs="unbounded" ref="UNIT"/> | |
| </xs:sequence> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- UNIT --> | |
| <xs:element name="UNIT"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each unit represents a unit object. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:element minOccurs="1" maxOccurs="unbounded" ref="item"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| List of unit attributes. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:element> | |
| </xs:sequence> | |
| <xs:attribute name="class" use="required" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute represents the class of the unit, it will be used to | |
| instantiate the object. Note that the class name should not include the | |
| namespace, it is the responsibility of the script which will parse the | |
| XML file to resolve the namespace. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="set" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Modification reference. This attribute must hold the persistent identifier | |
| of a unit: if provided, it means that the properties of the current block | |
| will be added or replace those in the unit corresponding to the native | |
| identifier provided in this attribute. Note that the block properties are | |
| assumed to be at the root level, this means that to modify a nested | |
| property you must provide the full root level enclosing property. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- ============================================================ --> | |
| <!-- ENTITIES --> | |
| <!-- ============================================================ --> | |
| <!-- ROOT --> | |
| <xs:element name="USERS"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This is the root element for user blocks. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The entity block is the users transaction unit. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:sequence> | |
| <xs:element maxOccurs="unbounded" ref="USER"/> | |
| </xs:sequence> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- UNIT --> | |
| <xs:element name="USER"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Each element represents a user object. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <xs:element minOccurs="1" maxOccurs="unbounded" ref="item"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| List of user attributes. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:element> | |
| </xs:sequence> | |
| <xs:attribute name="class" use="required" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This attribute represents the class of the user, it will be used to | |
| instantiate the object. Note that the class name should not include the | |
| namespace, it is the responsibility of the script which will parse the | |
| XML file to resolve the namespace. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| <xs:attribute name="set" type="xs:string"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| Modification reference. This attribute must hold the persistent identifier | |
| of a user: if provided, it means that the properties of the current block | |
| will be added or replace those in the user corresponding to the native | |
| identifier provided in this attribute. Note that the block properties are | |
| assumed to be at the root level, this means that to modify a nested | |
| property you must provide the full root level enclosing property. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:attribute> | |
| </xs:complexType> | |
| </xs:element> | |
| <!-- ============================================================ --> | |
| <!-- TYPES --> | |
| <!-- ============================================================ --> | |
| <!-- Node reference type --> | |
| <xs:simpleType name="node-ref-type"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| This enumeration defines the different types of node references that | |
| can be expressed, it is used by elements expressing a scalar node | |
| reference and should be added to the element tag reference. | |
| </xs:documentation> | |
| </xs:annotation> | |
| <xs:restriction base="xs:string"> | |
| <xs:enumeration value="tag"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The value of the element is a tag native identifier, | |
| this means that the node will be the master node related | |
| to that tag. The node will be resolved and its native identifier | |
| will replace the current element's value. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:enumeration> | |
| <xs:enumeration value="seq"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The value of the element is a tag sequence number, | |
| this means that the node will be the master node related | |
| to that tag. The node will be resolved and its native identifier | |
| will replace the current element's value. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:enumeration> | |
| <xs:enumeration value="term"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The value of the element is a term native identifier, | |
| this means that the node will be the master node related | |
| to that term. The node will be resolved and its native identifier | |
| will replace the current element's value. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:enumeration> | |
| <xs:enumeration value="node"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The value of the element is a node native identifier. | |
| The element value will remain untouched. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:enumeration> | |
| <xs:enumeration value="pid"> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en"> | |
| The value of the element is a node persistent identifier, | |
| the node will be resolved and its native identifier will | |
| replace the current element's value. | |
| </xs:documentation> | |
| </xs:annotation> | |
| </xs:enumeration> | |
| </xs:restriction> | |
| </xs:simpleType> | |
| </xs:schema> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment