Skip to main content

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

FieldTypeDescriptionManadtoryReference
isbnstringInternational Standard Book Number (ISBN)Yes
editionstringEdition of the bookYes
pageCountintegerNumber of pages in the bookYes
genresarray of stringList of genres the book belongs toNo
seriesstringSeries the book belongs to, if anyNo
seriesNumberintegerNumber of the book in the series, if applicableNo
publicationDateDatePublication date of the bookYes
publisherCDIDPublisher of the bookYesActor
dimensionsDimesionObject containing width, height, and depth of the bookYes
weightWeightWeight of the book in a given unit (e.g., pounds, grams)Yes
bindingstringType of binding for the book (e.g., hardcover, paperback, spiral-bound)Yes
languagestringLanguage of the bookYes
authorsarray of authorObjectArray of author objectsYes
tableOfContentsarray of tocObjectArray of objects representing chaptersNo

Author Object

FieldTypeDescriptionManadtoryReference
actorCDIDActor that is author of the bookYesActor
rolestringRole of the authorYes

Table of Content Object

FieldTypeDescriptionManadtoryReference
chapterNumberintegerNumber of chapter within the bookYes
chapterTitlestringChapter titleYes
startPageintegerStarting page of a chapterYes

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
}
]
}