1<?xml version="1.0" encoding="UTF-8"?>
2<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
5 name="Library" nsURI="http://www.example.org/library" nsPrefix="library">
6
7 <!-- Library: root container for all library entities -->
8 <eClassifiers xsi:type="ecore:EClass" name="Library">
9 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
10 <eStructuralFeatures xsi:type="ecore:EAttribute" name="location" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
11 <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
12 eType="#//Book" containment="true"/>
13 <eStructuralFeatures xsi:type="ecore:EReference" name="authors" upperBound="-1"
14 eType="#//Author" containment="true"/>
15 <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1"
16 eType="#//Category" containment="true"/>
17 <eStructuralFeatures xsi:type="ecore:EReference" name="members" upperBound="-1"
18 eType="#//Member" containment="true"/>
19 <eStructuralFeatures xsi:type="ecore:EReference" name="loans" upperBound="-1"
20 eType="#//Loan" containment="true"/>
21 </eClassifiers>
22
23 <!-- Book: individual book in the library collection -->
24 <eClassifiers xsi:type="ecore:EClass" name="Book">
25 <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
26 <eStructuralFeatures xsi:type="ecore:EAttribute" name="isbn" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
27 <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
28 <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
29 <eStructuralFeatures xsi:type="ecore:EAttribute" name="publicationYear" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
30 <eStructuralFeatures xsi:type="ecore:EAttribute" name="available" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
31 <eStructuralFeatures xsi:type="ecore:EAttribute" name="copies" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
32 <eStructuralFeatures xsi:type="ecore:EReference" name="authors" upperBound="-1"
33 eType="#//Author"/>
34 <eStructuralFeatures xsi:type="ecore:EReference" name="category" eType="#//Category"/>
35 </eClassifiers>
36
37 <!-- Author: writer of one or more books -->
38 <eClassifiers xsi:type="ecore:EClass" name="Author">
39 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
40 <eStructuralFeatures xsi:type="ecore:EAttribute" name="nationality" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
41 <eStructuralFeatures xsi:type="ecore:EAttribute" name="birthYear" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
42 <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
43 eType="#//Book"/>
44 </eClassifiers>
45
46 <!-- Category: classification for books -->
47 <eClassifiers xsi:type="ecore:EClass" name="Category">
48 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
49 <eStructuralFeatures xsi:type="ecore:EAttribute" name="code" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
50 <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
51 <eStructuralFeatures xsi:type="ecore:EReference" name="subcategories" upperBound="-1"
52 eType="#//Category" containment="true"/>
53 <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Category"/>
54 </eClassifiers>
55
56 <!-- Member: library member who borrows books -->
57 <eClassifiers xsi:type="ecore:EClass" name="Member">
58 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
59 <eStructuralFeatures xsi:type="ecore:EAttribute" name="memberId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
60 <eStructuralFeatures xsi:type="ecore:EAttribute" name="membershipYear" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
61 <eStructuralFeatures xsi:type="ecore:EReference" name="borrowed" upperBound="-1"
62 eType="#//Book"/>
63 <eStructuralFeatures xsi:type="ecore:EReference" name="favourites" upperBound="-1"
64 eType="#//Book"/>
65 </eClassifiers>
66
67 <!-- Loan: book loan transaction -->
68 <eClassifiers xsi:type="ecore:EClass" name="Loan">
69 <eStructuralFeatures xsi:type="ecore:EAttribute" name="loanDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
70 <eStructuralFeatures xsi:type="ecore:EAttribute" name="dueDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
71 <eStructuralFeatures xsi:type="ecore:EAttribute" name="returned" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
72 <eStructuralFeatures xsi:type="ecore:EReference" name="member" eType="#//Member"/>
73 <eStructuralFeatures xsi:type="ecore:EReference" name="book" eType="#//Book"/>
74 </eClassifiers>
75</ecore:EPackage>