eiqlibrary
Library
address
writers
sumOfPages
books
internalRequestCount
1
requestCount
someBooks
Book
title
pages
category
authors
Writer
books
firstBook
scifiBooks
name
BookCategory
Drama
Drama
History
History
Art
Art
SciFi
SciFi
<?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="eiqlibrary" nsURI="http:///org/incquery/examples/library/1.0"
    nsPrefix="eiqlib">
  <eClassifiers xsi:type="ecore:EClass" name="Library">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="address" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="writers" upperBound="-1"
        eType="#//Writer" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="sumOfPages" 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/GenModel">
        <details key="get" value="EList&lt;Book> allBooks = getBooks();&#xD;&#xA;int sumOfPages = 0;&#xD;&#xA;for (Book book : allBooks) {&#xD;&#xA;  sumOfPages += book.getPages();&#xD;&#xA;}&#xD;&#xA;return sumOfPages;"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
        eType="#//Book" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="internalRequestCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        transient="true" defaultValueLiteral="1">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="suppressedGetVisibility" value="true"/>
        <details key="suppressedSetVisibility" value="true"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="requestCount" 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/GenModel">
        <details key="get" value="internalRequestCount++;&#xD;&#xA;return internalRequestCount;"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="someBooks" upperBound="-1"
        eType="#//Book" changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="get" value="int count = internalRequestCount;&#xD;&#xA;java.util.List&lt;Book> someBooks = new java.util.ArrayList&lt;Book>();&#xD;&#xA;&#xD;&#xA;Book[] books = getBooks().toArray(new Book[0]);&#xD;&#xA;for (int i = 0; i &lt; books.length; i++) {&#xD;&#xA;    Book book = books[i];&#xD;&#xA;    if(i%count == 0) {&#xD;&#xA;        someBooks.add(book);&#xD;&#xA;    }&#xD;&#xA;}&#xD;&#xA;return org.eclipse.emf.common.util.ECollections.asEList(someBooks);"/>
      </eAnnotations>
    </eStructuralFeatures>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Book">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="category" upperBound="-1"
        eType="#//BookCategory"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="authors" upperBound="-1"
        eType="#//Writer" eOpposite="#//Writer/books"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Writer">
    <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
        eType="#//Book" eOpposite="#//Book/authors"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="firstBook" eType="#//Book"
        changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="get" value="EList&lt;Book> allBooks = getBooks();&#xD;&#xA;if(!allBooks.isEmpty()){&#xD;&#xA;  return allBooks.get(0);&#xD;&#xA;}&#xD;&#xA;return null;"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="scifiBooks" upperBound="-1"
        eType="#//Book" changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="get" value="EList&lt;Book> allBooks = getBooks();&#xD;&#xA;java.util.List&lt;Book> scifiBooks = new java.util.ArrayList&lt;Book>();&#xD;&#xA;for (Book book : allBooks) {&#xD;&#xA;  if(book.getCategory().contains(org.eclipse.incquery.examples.eiqlibrary.BookCategory.SCI_FI)) {&#xD;&#xA;     scifiBooks.add(book);&#xD;&#xA;  }&#xD;&#xA;}&#xD;&#xA;return org.eclipse.emf.common.util.ECollections.asEList(scifiBooks);"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EEnum" name="BookCategory">
    <eLiterals name="Drama"/>
    <eLiterals name="History" value="1"/>
    <eLiterals name="Art" value="2"/>
    <eLiterals name="SciFi" value="3"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"eiqlib","nsURI":"http:///org/incquery/examples/library/1.0","name":"eiqlibrary","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":"Writer","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"instanceClassName":null,"name":"BookCategory","instanceClass":null,"id":4,"serializable":true,"eClass":"EEnum"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"address","changeable":true,"lowerBound":0,"iD":false,"id":5,"derived":false},{"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":"writers","changeable":true,"resolveProxies":true,"lowerBound":0,"id":6,"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":"sumOfPages","changeable":false,"lowerBound":0,"iD":false,"id":7,"derived":true},{"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":"books","changeable":true,"resolveProxies":true,"lowerBound":0,"id":8,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":1,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":"1","unsettable":false,"transient":true,"unique":true,"name":"internalRequestCount","changeable":true,"lowerBound":0,"iD":false,"id":9,"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":"requestCount","changeable":false,"lowerBound":0,"iD":false,"id":10,"derived":true},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":true,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"someBooks","changeable":false,"resolveProxies":true,"lowerBound":0,"id":11,"derived":true},{"id":12,"eClass":"EGenericType"},{"id":13,"eClass":"EGenericType"},{"id":14,"eClass":"EGenericType"},{"id":15,"eClass":"EGenericType"},{"id":16,"eClass":"EGenericType"},{"id":17,"eClass":"EGenericType"},{"id":18,"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":"title","changeable":true,"lowerBound":0,"iD":false,"id":19,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":0,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"pages","changeable":true,"lowerBound":0,"iD":false,"id":20,"derived":false},{"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"category","changeable":true,"lowerBound":0,"iD":false,"id":21,"derived":false},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"authors","changeable":true,"resolveProxies":true,"lowerBound":0,"id":22,"derived":false},{"id":23,"eClass":"EGenericType"},{"id":24,"eClass":"EGenericType"},{"id":25,"eClass":"EGenericType"},{"id":26,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"books","changeable":true,"resolveProxies":true,"lowerBound":0,"id":27,"derived":false},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":true,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"firstBook","changeable":false,"resolveProxies":true,"lowerBound":0,"id":28,"derived":true},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":true,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"scifiBooks","changeable":false,"resolveProxies":true,"lowerBound":0,"id":29,"derived":true},{"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":30,"derived":false},{"id":31,"eClass":"EGenericType"},{"id":32,"eClass":"EGenericType"},{"id":33,"eClass":"EGenericType"},{"id":34,"eClass":"EGenericType"},{"name":"Drama","id":35,"value":0,"literal":"Drama","eClass":"EEnumLiteral"},{"name":"History","id":36,"value":1,"literal":"History","eClass":"EEnumLiteral"},{"name":"Art","id":37,"value":2,"literal":"Art","eClass":"EEnumLiteral"},{"name":"SciFi","id":38,"value":3,"literal":"SciFi","eClass":"EEnumLiteral"}],"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":1,"target":9},{"source":1,"target":10},{"source":1,"target":11},{"source":5,"target":12},{"source":5,"target":1},{"source":6,"target":3},{"source":6,"target":13},{"source":6,"target":1},{"source":13,"target":3},{"source":7,"target":14},{"source":7,"target":1},{"source":8,"target":2},{"source":8,"target":15},{"source":8,"target":1},{"source":15,"target":2},{"source":9,"target":16},{"source":9,"target":1},{"source":10,"target":17},{"source":10,"target":1},{"source":11,"target":2},{"source":11,"target":18},{"source":11,"target":1},{"source":18,"target":2},{"source":2,"target":0},{"source":2,"target":19},{"source":2,"target":20},{"source":2,"target":21},{"source":2,"target":22},{"source":19,"target":23},{"source":19,"target":2},{"source":20,"target":24},{"source":20,"target":2},{"source":21,"target":4},{"source":21,"target":25},{"source":21,"target":2},{"source":25,"target":4},{"source":22,"target":3},{"source":22,"target":26},{"source":22,"target":2},{"source":22,"target":27},{"source":26,"target":3},{"source":3,"target":0},{"source":3,"target":27},{"source":3,"target":28},{"source":3,"target":29},{"source":3,"target":30},{"source":27,"target":2},{"source":27,"target":31},{"source":27,"target":3},{"source":27,"target":22},{"source":31,"target":2},{"source":28,"target":2},{"source":28,"target":32},{"source":28,"target":3},{"source":32,"target":2},{"source":29,"target":2},{"source":29,"target":33},{"source":29,"target":3},{"source":33,"target":2},{"source":30,"target":34},{"source":30,"target":3},{"source":4,"target":0},{"source":4,"target":35},{"source":4,"target":36},{"source":4,"target":37},{"source":4,"target":38},{"source":35,"target":4},{"source":36,"target":4},{"source":37,"target":4},{"source":38,"target":4}],"multigraph":true}