tutorial
Library
name
books
loans
members
Book
isAvailable
loans
name
copies
library
Member
name
library
Loan
book
member
<?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="tutorial" nsURI="http://www.eclipse.org/mdt/ocl/oclinecore/tutorial"
    nsPrefix="tut">
  <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="Library">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="books" ordered="false"
        upperBound="-1" eType="#//Book" containment="true" eOpposite="#//Book/library"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="loans" ordered="false"
        upperBound="-1" eType="#//Loan" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="members" ordered="false"
        upperBound="-1" eType="#//Member" containment="true" eOpposite="#//Member/library"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Book">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="SufficientCopies"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="SufficientCopies" value="library.loans->select((book = self))->size() &lt;= copies"/>
      <details key="SufficientCopies$message" value="'Not enough copies'"/>
    </eAnnotations>
    <eOperations name="isAvailable" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="loans->size() &lt; copies"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="loans" ordered="false"
        upperBound="-1" eType="#//Loan" volatile="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="derivation" value="library.loans->select(book = self)"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="copies" ordered="false"
        lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigInteger"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="library" ordered="false"
        lowerBound="1" eType="#//Library" eOpposite="#//Library/books"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Member">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="library" ordered="false"
        lowerBound="1" eType="#//Library" eOpposite="#//Library/members"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Loan">
    <eStructuralFeatures xsi:type="ecore:EReference" name="book" ordered="false" lowerBound="1"
        eType="#//Book"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="member" ordered="false"
        lowerBound="1" eType="#//Member"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"tut","nsURI":"http://www.eclipse.org/mdt/ocl/oclinecore/tutorial","name":"tutorial","id":0,"eClass":"EPackage"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Library","instanceClass":null,"abstract":false,"id":1,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Book","instanceClass":null,"abstract":false,"id":2,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Member","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Loan","instanceClass":null,"abstract":false,"id":4,"interface":false,"eClass":"EClass"},{"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":1,"iD":false,"id":5,"derived":false},{"container":false,"ordered":false,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"books","changeable":true,"resolveProxies":true,"lowerBound":0,"id":6,"derived":false},{"container":false,"ordered":false,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"loans","changeable":true,"resolveProxies":true,"lowerBound":0,"id":7,"derived":false},{"container":false,"ordered":false,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"members","changeable":true,"resolveProxies":true,"lowerBound":0,"id":8,"derived":false},{"id":9,"eClass":"EGenericType"},{"id":10,"eClass":"EGenericType"},{"container":true,"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"library","changeable":true,"resolveProxies":true,"lowerBound":1,"id":11,"derived":false},{"id":12,"eClass":"EGenericType"},{"id":13,"eClass":"EGenericType"},{"container":true,"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"library","changeable":true,"resolveProxies":true,"lowerBound":1,"id":14,"derived":false},{"ordered":false,"upperBound":1,"unique":true,"name":"isAvailable","lowerBound":0,"id":15,"many":false,"required":false,"eClass":"EOperation"},{"container":false,"ordered":false,"upperBound":-1,"defaultValue":null,"volatile":true,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"loans","changeable":true,"resolveProxies":true,"lowerBound":0,"id":16,"derived":true},{"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":1,"iD":false,"id":17,"derived":false},{"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"copies","changeable":true,"lowerBound":1,"iD":false,"id":18,"derived":false},{"id":19,"eClass":"EGenericType"},{"id":20,"eClass":"EGenericType"},{"id":21,"eClass":"EGenericType"},{"id":22,"eClass":"EGenericType"},{"id":23,"eClass":"EGenericType"},{"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":1,"iD":false,"id":24,"derived":false},{"id":25,"eClass":"EGenericType"},{"id":26,"eClass":"EGenericType"},{"container":false,"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"book","changeable":true,"resolveProxies":true,"lowerBound":1,"id":27,"derived":false},{"container":false,"ordered":false,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"member","changeable":true,"resolveProxies":true,"lowerBound":1,"id":28,"derived":false},{"id":29,"eClass":"EGenericType"},{"id":30,"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":5},{"source":1,"target":6},{"source":1,"target":7},{"source":1,"target":8},{"source":5,"target":9},{"source":5,"target":1},{"source":6,"target":2},{"source":6,"target":10},{"source":6,"target":1},{"source":6,"target":11},{"source":10,"target":2},{"source":7,"target":4},{"source":7,"target":12},{"source":7,"target":1},{"source":12,"target":4},{"source":8,"target":3},{"source":8,"target":13},{"source":8,"target":1},{"source":8,"target":14},{"source":13,"target":3},{"source":2,"target":0},{"source":2,"target":15},{"source":2,"target":16},{"source":2,"target":17},{"source":2,"target":18},{"source":2,"target":11},{"source":15,"target":19},{"source":15,"target":2},{"source":16,"target":4},{"source":16,"target":20},{"source":16,"target":2},{"source":20,"target":4},{"source":17,"target":21},{"source":17,"target":2},{"source":18,"target":22},{"source":18,"target":2},{"source":11,"target":1},{"source":11,"target":23},{"source":11,"target":2},{"source":11,"target":6},{"source":23,"target":1},{"source":3,"target":0},{"source":3,"target":24},{"source":3,"target":14},{"source":24,"target":25},{"source":24,"target":3},{"source":14,"target":1},{"source":14,"target":26},{"source":14,"target":3},{"source":14,"target":8},{"source":26,"target":1},{"source":4,"target":0},{"source":4,"target":27},{"source":4,"target":28},{"source":27,"target":2},{"source":27,"target":29},{"source":27,"target":4},{"source":29,"target":2},{"source":28,"target":3},{"source":28,"target":30},{"source":28,"target":4},{"source":30,"target":3}],"multigraph":true}