gem-graph-server/debian/var/models/XMLSchema example (in progr...

198 lines
6.9 KiB
XML

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
<!-- https://www.w3schools.com/xml/el_attribute.asp -->
<!-- use="required" is NOT allowed in attributes declarations-->
<!-- To know : Attribute 'name' Cannot Appear In Element 'element'.-->
<!-- xs:element name="name" type="xs:string"/ -->
<!-- Cos-element-consistent: Error For Type '#AnonType_identitygem-graph-model'.
Multiple Elements With Name 'name', With Different Types, Appear In The Model Group. -->
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="date" type="xs:integer"/> <!--TODO type ? -->
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="lang" type="xs:string"/>
<xs:attribute name="value" type="xs:integer"/> <!--TODO WARNING: It's an integer !-->
<xs:attribute name="owner" type="xs:integer"/>
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="version" type="xs:float"/>
<xs:attribute name="probability" type="xs:integer"/>
<!-- TO EVALUATE Consider using 'group' (?) or NOT -->
<!-- https://www.w3schools.com/xml/schema_complex_indicators.asp -->
<!-- TO EVALUATE Other definitions of an arrow (coord origin + dest,...) -->
<!-- TO EVALUATE Hypercubes pave the space => add a potential dimension 'w':
<xs:attribute name="w" type="xs:integer" default="0"/>-->
<xs:element name="arrow"> <!-- TODO Consider using 'group' : -->
<!-- https://www.w3schools.com/xml/schema_complex_indicators.asp -->
<xs:complexType>
<xs:attribute name="x" type="xs:integer" default="1"/>
<xs:attribute name="y" type="xs:integer" default="0"/>
<xs:attribute name="z" type="xs:integer" default="0"/>
<xs:attribute name="site" type="xs:integer" default="1"/>
<xs:attribute name="weight" type="xs:integer" default="0"/>
</xs:complexType>
</xs:element>
<!-- A state can be connex or not. A connex state is an object.
A transition goes from an origin (state) to a target.
Therefore, element 'State' is used in
- objects definitions,
- initial and produced/computed states declarations,
- origin and target declarations of a transition.
What attributes should always be associated to a state ? -->
<xs:element name="state">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="arrow"/>
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="date" use="required"/>
<xs:attribute ref="author" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="transition">
<xs:complexType>
<xs:sequence minOccurs="2" maxOccurs="2"> <!-- TODO ... Cannot use 'length' -->
<xs:element ref="state"/>
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="date" use="required"/>
<xs:attribute ref="author" use="required"/>
<xs:attribute ref="probability" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="gem-graph-model">
<xs:complexType>
<xs:sequence>
<xs:element name="identity">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="owner" type="xs:integer"/>
<xs:element name="date" type="xs:integer"/>
<xs:element name="version" type="xs:float"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="parameters">
<xs:complexType>
<xs:sequence>
<xs:element name="modelization">
<xs:complexType>
<xs:sequence>
<xs:element name="max_thread">
<xs:complexType>
<xs:attribute ref="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="max_cycles">
<xs:complexType>
<xs:attribute ref="value" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="space">
<xs:complexType>
<xs:sequence>
<xs:element name="dimension">
<xs:complexType>
<xs:attribute ref="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="size">
<xs:complexType>
<xs:attribute ref="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="site_multiplicity">
<xs:complexType>
<xs:attribute ref="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="boundaries">
<xs:complexType>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="date" use="required"/>
<xs:attribute ref="author" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="objects">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="state"/> <!--An object is a connex state -->
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="date" use="required"/>
<xs:attribute ref="author" use="required"/>
</xs:complexType>
</xs:element>
<!--An initial state is made of at least one object -->
<xs:element ref="state"/>
<!--An produced state is made of at least one object -->
<xs:element name="produced_states">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="state"/>
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="date" use="required"/>
<xs:attribute ref="author" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="transitions">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="transition"/>
</xs:sequence>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="date" use="required"/>
<xs:attribute ref="author" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="ref" type="xs:string"/>
<xs:element name="quote" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>