XML Schema States OK and Transitions first approach !

This commit is contained in:
Jean Sirmai 2021-09-20 11:25:27 +02:00
parent b70a940f36
commit 29fbf905d2
Signed by untrusted user who does not match committer: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 66 additions and 10 deletions

View File

@ -64,9 +64,36 @@
</state>
<produced_states id="a computed state" date="00000" author="THE MATRIX (you know it...)">
<produced_states id="a computed state" date="000" author="THE MATRIX (you know it...)">
</produced_states>
<transitions></transitions>
<transitions id="how many ?" date="000" author="THE SUPER MATRIX (you did'not know it ? Did you ?...)">
<transition id="0" date="1629830000" author="Jean Sirmai" probability="1"> <!-- moves a dimer to east-->
<state id="initial transition state" date="0" author="Jean Sirmai">
<arrow x="0" y="0" z="0" site="1" weight="1"/>
<arrow x="1" y="0" z="0" site="0" weight="1"/> <!-- a dimer is identified-->
<!-- the local space origin is its "west" particule-->
<arrow x="2" y="0" z="0" site="1" weight="0"/> <!-- the east location next this dimer is empty-->
<arrow x="3" y="0" z="0" site="0" weight="0"/> <!-- In this very simple model, I do not need to check this condition-->
</state>
<state id="final transition state" date="0" author="Jean Sirmai"> <!-- Therefore I can (and I want to) move it to its next east location-->
<arrow x="0" y="0" z="0" site="1" weight="0"/>
<arrow x="1" y="0" z="0" site="0" weight="0"/> <!-- The identified dimer no more exists ( :-(( -->
<arrow x="1" y="0" z="0" site="1" weight="1"/>
<arrow x="2" y="0" z="0" site="0" weight="1"/> <!-- Happily, it is now rebuilt at its east location ( ;-))-->
</state>
</transition>
</transitions>
<ref></ref>
<quote></quote>
</gem-graph-model>

View File

@ -8,12 +8,15 @@
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="date" type="xs:integer"/> <!--TODO type ? -->
<xs:attribute name="name" type="xs:string"/> <!--TODO pas clair, ce truc... -->
<xs:attribute name="lang" type="xs:string"/>
<xs:attribute name="value" type="xs:integer"/> <!--TODO WARNING: It's an integer !-->
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="version" type="xs:float"/>
<xs:attribute name="owner_id" type="xs:integer"/>
<xs:attribute name="probability" type="xs:integer"/>
<xs:element name="arrow">
<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"/>
@ -23,7 +26,8 @@
</xs:complexType>
</xs:element>
<xs:element name="state"> <!-- A connex state is an object. -->
<!-- A state can be connex or not. A connex state is an object. -->
<xs:element name="state">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="arrow"/>
@ -34,6 +38,18 @@
</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>
@ -146,9 +162,22 @@
</xs:complexType>
</xs:element>
<xs:element name="transitions" type="xs:string"/>
<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>

View File

@ -62,6 +62,7 @@
<!-- Saved space description (saved states) -->
<savestates id="test" date="1629830000" author="Jean Sirmai">
<space id="test" date="1629830000" author="Jean Sirmai">
</space>
@ -95,8 +96,7 @@
<ref id="Best reference!" date="1629830000" author="Jean Sirmai" lang="fr">
https://www.a-lec.org
</ref>
<quote id="Best quote" date="1629830000" author="Jean Sirmai" lang="fr">
This is a quote.
</quote>
<quote>This is a quote.</quote>
</gem-graph-model>