<?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">
  <presentation>
    <diagram>
      <deltah>0.5</deltah>
    </diagram>
  </presentation>
  <entity_type>
    <name>department</name>
    <presentation>
      <x>3.0</x>
      <y>0.1</y>
      <deltaw>0.2</deltaw>
    </presentation>
    <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
      <name>departmentId</name>
      <type>
        <string/>
      </type>
      <identifying/>
    </attribute>
    <composition>
      <id>D1</id>
      <type>student</type>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <identifying/>
      <inverse>within</inverse>
      <diagram>
        <path>
          <inverse>
            <label>
              <position>
                <Left/>
              </position>
            </label>
          </inverse>
        </path>
      </diagram>
    </composition>
    <composition>
      <id>D2</id>
      <type>professor</type>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <identifying/>
      <inverse>within</inverse>
      <diagram>
        <path/>
      </diagram>
    </composition>
  </entity_type>
  <group>
    <presentation>
      <below>department</below>
      <y>0.9</y>
    </presentation>
    <entity_type>
      <name>student</name>
      <dependency>
        <name>within</name>
      </dependency>
      <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
        <name>departmentId</name>
        <type>
          <string/>
        </type>
        <identifying/>
        <implementationOf>
          <rel>within</rel>
          <origin>departmentId</origin>
          <destattr>departmentId</destattr>
        </implementationOf>
        <implementationOf>
          <rel>advised_by</rel>
          <origin>departmentId</origin>
          <destattr>departmentId</destattr>
        </implementationOf>       
      </attribute>
      <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
        <name>studentNoInDept</name>
        <type>
          <string/>
        </type>
        <identifying/>
      </attribute>
      <!--
         <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
            <name>advisiorDeptId</name>
            <type>
               <string/>
            </type>
         <implementationOf>
               <rel>advised_by</rel>
               <origin>departmentId</origin>
               <destattr>departmentId</destattr>
            </implementationOf>
         </attribute>
         -->
      <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
        <name>advisorNo</name>
        <type>
          <string/>
        </type>
        <implementationOf>
          <rel>advised_by</rel>
          <origin>profNoInDept</origin>
          <destattr>profNoInDept</destattr>
        </implementationOf>        
      </attribute>
      <reference>
        <name>advised_by</name>
        <type>professor</type>
        <id>R1</id>
        <cardinality>
          <ExactlyOne/>
        </cardinality>
        <diagram>
          <path>
            <align>
              <ToSrc/>
            </align>
            <label>
              <name>
                <Split/>
              </name>
              <position>
                <Upside/>
              </position>
            </label>
            <id>
              <label>
                <position>
                  <Downside/>
                </position>
              </label>
            </id>
          </path>
        </diagram>
      </reference>
      <presentation>
        <name>
          <Split/>
        </name>
        <deltaw>0.2</deltaw>
      </presentation>
    </entity_type>
    <entity_type>
      <name>professor</name>
      <presentation>
        <rightOf>student</rightOf>
        <x>1.5</x>
        <deltaw>0.2</deltaw>
      </presentation>
      <dependency>
        <name>within</name>
      </dependency>
      <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
        <name>departmentId</name>
        <type>
          <string/>
        </type>
        <identifying/>
        <implementationOf>
          <rel>within</rel>
          <origin>departmentId</origin>
          <destattr>departmentId</destattr>
        </implementationOf>
      </attribute>
      <attribute xmlns:era="http://www.entitymodelling.org/ERmodel">
        <name>profNoInDept</name>
        <type>
          <string/>
        </type>
        <identifying/>
      </attribute>
    </entity_type>
  </group>
</entity_model>