Book
The book class is a data structure that represents the key attributes of a book. The attributes included in this structure provide essential information about a book, such as the International Standard Book Number (ISBN), edition, page count, genres, series, and other relevant details.
Data structure
| Field | Type | Description | Manadtory | Reference |
|---|---|---|---|---|
| isbn | string | International Standard Book Number (ISBN) | Yes | |
| edition | string | Edition of the book | Yes | |
| pageCount | integer | Number of pages in the book | Yes | |
| genres | array of string | List of genres the book belongs to | No | |
| series | string | Series the book belongs to, if any | No | |
| seriesNumber | integer | Number of the book in the series, if applicable | No | |
| publicationDate | Date | Publication date of the book | Yes | |
| publisher | CDID | Publisher of the book | Yes | Actor |
| dimensions | Dimesion | Object containing width, height, and depth of the book | Yes | |
| weight | Weight | Weight of the book in a given unit (e.g., pounds, grams) | Yes | |
| binding | string | Type of binding for the book (e.g., hardcover, paperback, spiral-bound) | Yes | |
| language | string | Language of the book | Yes | |
| authors | array of authorObject | Array of author objects | Yes | |
| tableOfContents | array of tocObject | Array of objects representing chapters | No |
Author Object
| Field | Type | Description | Manadtory | Reference |
|---|---|---|---|---|
| actor | CDID | Actor that is author of the book | Yes | Actor |
| role | string | Role of the author | Yes |
Table of Content Object
| Field | Type | Description | Manadtory | Reference |
|---|---|---|---|---|
| chapterNumber | integer | Number of chapter within the book | Yes | |
| chapterTitle | string | Chapter title | Yes | |
| startPage | integer | Starting page of a chapter | Yes |
Example
"book":{
"isbn": "9780060935467",
"edition": "1st Perennial Classics edition",
"pageCount": 336,
"genres": ["Fiction", "Literature", "Historical Fiction"],
"series": "",
"seriesNumber": null,
"coverImage": "https://example.com/to-kill-a-mockingbird-cover.jpg",
"publicationDate": "2002-07-05",
"publisher": "8D4E1BF0-FF73-4E7A-8D38-0C231BAA5F5C",
"dimensions": {
"width": "5.31",
"height": "8",
"depth": "0.72",
"unit": "inches"
},
"weight": {
"mass": 0.57,
"unit":"pounds"
},
"binding": "Paperback",
"language": "English",
"authors": [
{
"actor": "A5E5DC14-0DC4-4C7E-8A5D-0BDCDF463FDC",
"role": "author"
}
],
"tableOfContents": [
{
"chapterNumber": 1,
"chapterTitle": "Chapter 1",
"startPage": 3
},
{
"chapterNumber": 2,
"chapterTitle": "Chapter 2",
"startPage": 14
},
{
"chapterNumber": 3,
"chapterTitle": "Chapter 3",
"startPage": 25
}
]
}