<?xml version="1.0" encoding="UTF-8"?>
<!--
  ****************************************************************
ERmodel_v1.2/instances/catalogue/src/conceptualModels/2RegularHypergraph.xml 
****************************************************************

Copyright 2016, 2107 Cyprotex Discovery Ltd.

This file is part of the the ERmodel suite of models and transforms.

The ERmodel suite is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ERmodel suite is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************
-->
<entity_model xmlns="http://www.entitymodelling.org/ERmodel"
              xmlns:xs="http://www.w3.org/2001/XMLSchema"
              xmlns:era="http://www.entitymodelling.org/ERmodel"
              xmlns:er-js="http://www.entitymodelling.org/ERmodel/javascript">
   <defaults>
      <et_width>2.2</et_width>
   </defaults>
   <entity_type>
      <name>D</name>
      <presentation>
         <x>0.1</x>
         <y>0.3</y>
         <h>1.75</h>
      </presentation>
      <attribute>
         <name>d0</name>
         <type>
            <string/>
         </type>
         <identifying/>
      </attribute>
      <elementName>D</elementName>
      <mangleName>D</mangleName>
      <parentType/>
      <attribute>
         <name>d1</name>
         <type>
            <string/>
         </type>
      </attribute>
      <attribute>
         <name>d2</name>
         <type>
            <string/>
         </type>
      </attribute>
      <attribute>
         <name>c0</name>
         <typeOfOrigin>C</typeOfOrigin>
         <attrOfOrigin>c0</attrOfOrigin>
         <type>
            <string/>
         </type>
         <optional/>
         <implementationOf>
            <rel>f</rel>
            <destattr>c0</destattr>
            <typeOfOrigin>C</typeOfOrigin>
            <attrOfOrigin>c0</attrOfOrigin>
         </implementationOf>
         <description>
           This is the 'c0' attribute
              of the related `f C' (a foreign key
           to relationship 
           `f' : 
            ----&gt; C).
			</description>
      </attribute>
      <reference>
         <id>R1</id>
         <name>f</name>
         <type>C</type>
         <cardinality>
            <ZeroOrOne/>
         </cardinality>
         <diagram>
            <path>
               <align>
                  <ToSrc/>
               </align>
               <label>
                  <position>
                     <Upside/>
                  </position>
                  <yAdjustment>-0.05</yAdjustment>
               </label>
               <id>
                  <label>
                     <position>
                        <Downside/>
                     </position>
                     <xAdjustment>-0.15</xAdjustment>
                  </label>
               </id>
            </path>
         </diagram>
         <xpath_is_defined>c0</xpath_is_defined>
         <xpath_foreign_key>c0</xpath_foreign_key>
         <xpath_typecheck>self::C</xpath_typecheck>
         <xpath_evaluate>key('C', c0)</xpath_evaluate>
      </reference>
      <xpath_type_classifier>D</xpath_type_classifier>
      <xpath_qualified_type_classifier/>
      <xpath_parent_entity>..</xpath_parent_entity>
      <xpath_typecheck>self::D</xpath_typecheck>
      <xpath_primary_key>d0</xpath_primary_key>
   </entity_type>
   <entity_type>
      <name>C</name>
      <presentation>
         <rightOf>D</rightOf>
         <x>1.5</x>
         <h>1.75</h>
      </presentation>
      <attribute>
         <name>c0</name>
         <type>
            <string/>
         </type>
         <identifying/>
      </attribute>
      <elementName>C</elementName>
      <mangleName>C</mangleName>
      <parentType/>
      <attribute>
         <name>c1</name>
         <type>
            <string/>
         </type>
         <optional/>
      </attribute>
      <attribute>
         <name>c2</name>
         <type>
            <string/>
         </type>
         <optional/>
      </attribute>
      <attribute>
         <name>b0</name>
         <typeOfOrigin>B</typeOfOrigin>
         <attrOfOrigin>b0</attrOfOrigin>
         <type>
            <string/>
         </type>
         <implementationOf>
            <rel>g</rel>
            <destattr>b0</destattr>
            <typeOfOrigin>B</typeOfOrigin>
            <attrOfOrigin>b0</attrOfOrigin>
         </implementationOf>
         <description>
           This is the 'b0' attribute
              of the related `g B' (a foreign key
           to relationship 
           `g' : 
            ----&gt; B).
			</description>
      </attribute>
      <reference>
         <id>R2</id>
         <name>g</name>
         <type>B</type>
         <cardinality>
            <ExactlyOne/>
         </cardinality>
         <diagram>
            <path>
               <align>
                  <ToSrc/>
               </align>
               <label>
                  <position>
                     <Upside/>
                  </position>
                  <yAdjustment>-0.05</yAdjustment>
               </label>
               <id>
                  <label>
                     <position>
                        <Downside/>
                     </position>
                     <xAdjustment>-0.15</xAdjustment>
                  </label>
               </id>
            </path>
         </diagram>
         <xpath_is_defined>b0</xpath_is_defined>
         <xpath_foreign_key>b0</xpath_foreign_key>
         <xpath_typecheck>self::B</xpath_typecheck>
         <xpath_evaluate>key('B', b0)</xpath_evaluate>
      </reference>
      <xpath_type_classifier>C</xpath_type_classifier>
      <xpath_qualified_type_classifier/>
      <xpath_parent_entity>..</xpath_parent_entity>
      <xpath_typecheck>self::C</xpath_typecheck>
      <xpath_primary_key>c0</xpath_primary_key>
   </entity_type>
   <entity_type>
      <name>B</name>
      <presentation>
         <rightOf>C</rightOf>
         <x>1.5</x>
         <h>1.75</h>
      </presentation>
      <attribute>
         <name>b0</name>
         <type>
            <string/>
         </type>
         <identifying/>
      </attribute>
      <elementName>B</elementName>
      <mangleName>B</mangleName>
      <parentType/>
      <attribute>
         <name>b1</name>
         <type>
            <string/>
         </type>
         <optional/>
      </attribute>
      <attribute>
         <name>b2</name>
         <type>
            <string/>
         </type>
         <optional/>
      </attribute>
      <attribute>
         <name>a0</name>
         <typeOfOrigin>A</typeOfOrigin>
         <attrOfOrigin>a0</attrOfOrigin>
         <type>
            <string/>
         </type>
         <implementationOf>
            <rel>h</rel>
            <destattr>a0</destattr>
            <typeOfOrigin>A</typeOfOrigin>
            <attrOfOrigin>a0</attrOfOrigin>
         </implementationOf>
         <description>
           This is the 'a0' attribute
              of the related `h A' (a foreign key
           to relationship 
           `h' : 
            ----&gt; A).
			</description>
      </attribute>
      <reference>
         <id>R3</id>
         <name>h</name>
         <type>A</type>
         <cardinality>
            <ExactlyOne/>
         </cardinality>
         <diagram>
            <path>
               <align>
                  <ToSrc/>
               </align>
               <label>
                  <position>
                     <Upside/>
                  </position>
                  <yAdjustment>-0.05</yAdjustment>
               </label>
               <id>
                  <label>
                     <position>
                        <Downside/>
                     </position>
                     <xAdjustment>-0.15</xAdjustment>
                  </label>
               </id>
            </path>
         </diagram>
         <xpath_is_defined>a0</xpath_is_defined>
         <xpath_foreign_key>a0</xpath_foreign_key>
         <xpath_typecheck>self::A</xpath_typecheck>
         <xpath_evaluate>key('A', a0)</xpath_evaluate>
      </reference>
      <xpath_type_classifier>B</xpath_type_classifier>
      <xpath_qualified_type_classifier/>
      <xpath_parent_entity>..</xpath_parent_entity>
      <xpath_typecheck>self::B</xpath_typecheck>
      <xpath_primary_key>b0</xpath_primary_key>
   </entity_type>
   <entity_type>
      <name>A</name>
      <presentation>
         <rightOf>B</rightOf>
         <x>1.5</x>
         <h>1.75</h>
      </presentation>
      <attribute>
         <name>a0</name>
         <type>
            <string/>
         </type>
         <identifying/>
      </attribute>
      <elementName>A</elementName>
      <mangleName>A</mangleName>
      <parentType/>
      <attribute>
         <name>a1</name>
         <type>
            <string/>
         </type>
         <optional/>
      </attribute>
      <attribute>
         <name>a2</name>
         <type>
            <string/>
         </type>
         <optional/>
      </attribute>
      <xpath_type_classifier>A</xpath_type_classifier>
      <xpath_qualified_type_classifier/>
      <xpath_parent_entity>..</xpath_parent_entity>
      <xpath_typecheck>self::A</xpath_typecheck>
      <xpath_primary_key>a0</xpath_primary_key>
   </entity_type>
</entity_model>
