<?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">
  <absolute>
    <composition>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <type>department</type>
    </composition>
    <composition>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <type>location</type>
    </composition>
    <composition>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <type>string</type>
    </composition>
    <composition>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <type>date</type>
    </composition>
    <composition>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <type>number</type>
    </composition>
  </absolute>

  <entity_type>
    <name>department</name>
    <presentation>
      <x>1.7</x>
      <y>1.0</y>
      <h>2.0</h>
      <w>2.0</w>
    </presentation>
    <composition>
      <type>employee</type>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <identifying/>
    </composition>
    <reference>
      <name>location</name>
      <type>location</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <diagram>
        <path>
          <align>
            <ToDest/>
          </align>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>headOfDept</name>
      <type>employee</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <inverse>isHeadOf</inverse>
      <diagram>
        <path>
          <srcsign>-1</srcsign>
          <destsign>-1</destsign>
          <destattach>0.25</destattach>
          <hstep>
            <absdim>
              <src>-0.3</src>
            </absdim>
          </hstep>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>deptCode</name>
      <type>string</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <align>
            <ToSrc/>
          </align>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>name</name>
      <type>string</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <diagram>
        <path>
          <align>
            <ToSrc/>
          </align>
        </path>
      </diagram>
    </reference>
  </entity_type>
  <entity_type>
    <name>location</name>
    <presentation>
      <rightOf>department</rightOf>
      <x>2.0</x>
      <h>1.0</h>
      <w>2.0</w>
    </presentation>

    <reference>
      <name>name</name>
      <type>string</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <align>
            <ToSrc/>
          </align>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
        </path>
      </diagram>
    </reference>
  </entity_type>
  <entity_type>
    <name>employee</name>
    <presentation>
      <below>department</below>
      <x>1.0</x>
      <h>3.0</h>
      <w>4.5</w>
    </presentation>
    <composition>
      <type>telephone</type>
      <cardinality>
        <ZeroOneOrMore/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <align>
            <ToDest/>
          </align>
        </path>
      </diagram>
    </composition>
    <composition>
      <type>package</type>
      <cardinality>
        <OneOrMore/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <align>
            <ToDest/>
          </align>
        </path>
      </diagram>
    </composition>
    <composition>
      <type>review</type>
      <cardinality>
        <ZeroOneOrMore/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <srcattach>0.9</srcattach>
        </path>
      </diagram>
    </composition>

    <reference>
      <name>isHeadOf</name>
      <type>department</type>
      <cardinality>
        <ZeroOrOne/>
      </cardinality>
      <inverseOf>headOfDept</inverseOf>
    </reference>
    <reference>
      <name>manager</name>
      <type>employee</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <inverse>managerOf</inverse>
      <diagram>
        <path>
          <srcsign>-1</srcsign>
          <destsign>-1</destsign>
          <srcattach>0.5</srcattach>
          <destattach>0.75</destattach>
          <hstep>
            <absdim>
              <src>-1.2</src>
            </absdim>
          </hstep>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
          <inverse>
            <label>
              <position>
                <Downside/>
              </position>
            </label>
          </inverse>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>managerOf</name>
      <type>employee</type>
      <cardinality>
        <ZeroOneOrMore/>
      </cardinality>
      <inverseOf>manager</inverseOf>
    </reference>


    <reference>
      <name>empCode</name>
      <type>string</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <srcattach>0.2</srcattach>
          <destattach>0.6</destattach>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>name</name>
      <type>string</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <diagram>
        <path>
          <srcattach>0.4</srcattach>
          <destattach>0.78</destattach>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>startDate</name>
      <type>date</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <diagram>
        <path>
          <srcattach>0.6</srcattach>
          <!--<destattach>0.25</destattach>-->
          <align>
            <ToSrc/>
          </align>
          <label>
            <position>
              <Upside/>
            </position>
          </label>
        </path>
      </diagram>
    </reference>
  </entity_type>
  <group>
    <presentation>
      <below>employee</below>
    </presentation>
    <entity_type>
      <name>telephone</name>
      <presentation>
        <x>-1.0</x>
        <y>0.5</y>
      </presentation>
      <entity_type>
        <name>home</name>
      </entity_type>
      <entity_type>
        <name>work</name>
        <presentation>
          <below>home</below>
        </presentation>
      </entity_type>
      <entity_type>
        <name>mobile</name>
        <presentation>
          <below>work</below>
        </presentation>
      </entity_type>

      <reference>
        <name>number</name>
        <type>string</type>
        <cardinality>
          <ExactlyOne/>
        </cardinality>
        <identifying/>
        <diagram>
          <path>
            <srcattach>0.2</srcattach>
            <destattach>0.9</destattach>
            <label>
              <position>
                <Upside/>
              </position>
            </label>
          </path>
        </diagram>
      </reference>
    </entity_type>

    <entity_type>
      <name>package</name>
      <presentation>
        <rightOf>telephone</rightOf>
        <x>0.85</x>
        <y>1.5</y>
        <h>2.0</h>
        <w>1.75</w>
      </presentation>
      <reference>
        <name>from</name>
        <type>date</type>
        <cardinality>
          <ExactlyOne/>
        </cardinality>
        <identifying/>
        <diagram>
          <path>
            <destattach>0.6</destattach>
            <label>
              <position>
                <Upside/>
              </position>
            </label>
          </path>
        </diagram>
      </reference>
      <reference>
        <name>to</name>
        <type>date</type>
        <diagram>
          <path>
            <destattach>0.766</destattach>
            <label>
              <position>
                <Upside/>
              </position>
            </label>
          </path>
        </diagram>
      </reference>
      <reference>
        <name>annualSalary</name>
        <type>number</type>
        <cardinality>
          <ExactlyOne/>
        </cardinality>
        <diagram>
          <path>
            <destattach>0.5</destattach>
          </path>
        </diagram>
      </reference>
    </entity_type>
  </group>

  <entity_type>
    <name>review</name>
    <presentation>
      <rightOf>package</rightOf>
      <x>0.6</x>
      <y>-1.85</y>
      <h>1.3</h>
      <w>1.25</w>
    </presentation>
    <reference>
      <name>reviewBy</name>
      <type>employee</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <diagram>
        <path>
          <srcsign>1</srcsign>
          <srcarmlen>0.15</srcarmlen>
          <srcattach>0.33</srcattach>
          <destattach>0.8</destattach>
          <hstep>
            <absdim>
              <src>1.0</src>
            </absdim>
          </hstep>
          <label><position><Upside/></position></label>
        </path>
      </diagram>
    </reference>
    <reference>
      <name>on</name>
      <type>date</type>
      <cardinality>
        <ExactlyOne/>
      </cardinality>
      <identifying/>
      <diagram>
        <path>
          <srcattach>0.6</srcattach>
          <srcarmlen>1.0</srcarmlen>
          <destattach>0.5</destattach>
        </path>
      </diagram>
    </reference>
  </entity_type>

  <entity_type>
    <name>string</name>
    <presentation>
      <rightOf>location</rightOf>
      <x>2.5</x>
      <h>3.3</h>
    </presentation>
    <universal/>
  </entity_type>
  <entity_type>
    <name>date</name>
    <presentation>
      <below>string</below>
      <x>2.0</x>
      <y>1.0</y>
      <h>3.0</h>
    </presentation>
    <universal/>
  </entity_type>
  <entity_type>
    <name>number</name>
    <presentation>
      <below>date</below>
      <x>2.0</x>
      <h>2.0</h>
    </presentation>
    <universal/>
  </entity_type>
</entity_model>
