company
Company
department
Department
employee
numberOfEmployees
ageSumOfEmployees
NamedElement
name
Person
firstName
fullName
age
supervisor
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="company" nsURI="http://www.example.org/company" nsPrefix="company">
  <eAnnotations source="http://www.eclipse.org/OCL/Import">
    <details key="ecore" value="http://www.eclipse.org/emf/2002/Ecore"/>
  </eAnnotations>
  <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
    <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
  </eAnnotations>
  <eClassifiers xsi:type="ecore:EClass" name="Company" eSuperTypes="#//NamedElement">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="NoDepartmentMoreThanTwiceNumberOfEmployeesThanAnother"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="NoDepartmentMoreThanTwiceNumberOfEmployeesThanAnother" value="self.department->forAll(d1 | &#xA;--&#x9;&#x9;&#x9;self.department->forAll(d2 | d1.numberOfEmployees &lt;= d2.numberOfEmployees * 2)&#xA;&#x9;&#x9;&#x9;self.department->forAll(d2 | d1.employee->size() &lt;= d2.employee->size() * 2)&#xA;&#x9;&#x9;)"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="department" upperBound="-1"
        eType="#//Department" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Department" eSuperTypes="#//NamedElement">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="AtLeastTwoEmployees"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="AtLeastTwoEmployees" value="&#xA;--&#x9;&#x9;&#x9;self.employee->iterate(p: Person; sum:Integer =0 | sum + 1) >= 2;&#xA;&#x9;&#x9;&#x9;self.employee->size() >= 2"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="employee" upperBound="-1"
        eType="#//Person" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="numberOfEmployees" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="derivation" value="self.employee->size()"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="ageSumOfEmployees" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="derivation" value="self.employee->iterate(p; sum:Integer = 0 | sum + p.age)"/>
      </eAnnotations>
    </eStructuralFeatures>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="NamedElement">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Person" eSuperTypes="#//NamedElement">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="AllEmployeesMustBeAdults PersonCannotBeSupervisorOfHimHerself"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="AllEmployeesMustBeAdults" value="self.age >= 18"/>
      <details key="PersonCannotBeSupervisorOfHimHerself" value="self &lt;> self.supervisor"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="fullName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
        changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="derivation" value="self.firstName.concat(' ').concat(self.name)"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="age" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="supervisor" eType="#//Person"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"company","nsURI":"http://www.example.org/company","name":"company","id":0,"eClass":"EPackage"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Company","instanceClass":null,"abstract":false,"id":1,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Department","instanceClass":null,"abstract":false,"id":2,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"NamedElement","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Person","instanceClass":null,"abstract":false,"id":4,"interface":false,"eClass":"EClass"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"department","changeable":true,"resolveProxies":true,"lowerBound":0,"id":5,"derived":false},{"id":6,"eClass":"EGenericType"},{"id":7,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"employee","changeable":true,"resolveProxies":true,"lowerBound":0,"id":8,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":0,"volatile":true,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"numberOfEmployees","changeable":false,"lowerBound":0,"iD":false,"id":9,"derived":true},{"ordered":true,"upperBound":1,"defaultValue":0,"volatile":true,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"ageSumOfEmployees","changeable":false,"lowerBound":0,"iD":false,"id":10,"derived":true},{"id":11,"eClass":"EGenericType"},{"id":12,"eClass":"EGenericType"},{"id":13,"eClass":"EGenericType"},{"id":14,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":0,"iD":false,"id":15,"derived":false},{"id":16,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"firstName","changeable":true,"lowerBound":0,"iD":false,"id":17,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":true,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"fullName","changeable":false,"lowerBound":0,"iD":false,"id":18,"derived":true},{"ordered":true,"upperBound":1,"defaultValue":0,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"age","changeable":true,"lowerBound":0,"iD":false,"id":19,"derived":false},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"supervisor","changeable":true,"resolveProxies":true,"lowerBound":0,"id":20,"derived":false},{"id":21,"eClass":"EGenericType"},{"id":22,"eClass":"EGenericType"},{"id":23,"eClass":"EGenericType"},{"id":24,"eClass":"EGenericType"},{"id":25,"eClass":"EGenericType"}],"links":[{"source":0,"target":1},{"source":0,"target":2},{"source":0,"target":3},{"source":0,"target":4},{"source":1,"target":0},{"source":1,"target":3},{"source":1,"target":5},{"source":1,"target":6},{"source":5,"target":2},{"source":5,"target":7},{"source":5,"target":1},{"source":7,"target":2},{"source":6,"target":3},{"source":2,"target":0},{"source":2,"target":3},{"source":2,"target":8},{"source":2,"target":9},{"source":2,"target":10},{"source":2,"target":11},{"source":8,"target":4},{"source":8,"target":12},{"source":8,"target":2},{"source":12,"target":4},{"source":9,"target":13},{"source":9,"target":2},{"source":10,"target":14},{"source":10,"target":2},{"source":11,"target":3},{"source":3,"target":0},{"source":3,"target":15},{"source":15,"target":16},{"source":15,"target":3},{"source":4,"target":0},{"source":4,"target":3},{"source":4,"target":17},{"source":4,"target":18},{"source":4,"target":19},{"source":4,"target":20},{"source":4,"target":21},{"source":17,"target":22},{"source":17,"target":4},{"source":18,"target":23},{"source":18,"target":4},{"source":19,"target":24},{"source":19,"target":4},{"source":20,"target":4},{"source":20,"target":25},{"source":20,"target":4},{"source":25,"target":4},{"source":21,"target":3}],"multigraph":true}