internetarchive / internetarchive/openlibrary

Add json-ld to work/books pages

Open
#4,182 3 comments 0 reactions 0 assignees View on GitHub
Lead: @cdrini Needs: Review Priority: 3 Theme: Distribution Type: Feature Request
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

json-ld let's us represent things which we simply can't with inline microdoata (like a ReadAction: https://developers.google.com/search/docs/data-types/book#readaction-potentialaction ).

### Describe the problem that you'd like solved
Here's an example of what we should add to this book: https://openlibrary.org/books/OL9875731M/Dark_heritage
(Perhaps at `https://openlibrary.org/books/OL9875731M.jsonld` as well?)

```json
{
"@context": "http://schema.org/",
"@type": "Book",
"@id": "https://openlibrary.org/works/OL2959355W",
"url": "https://openlibrary.org/works/OL2959355W/Dark_heritage",
"name": "Dark heritage",
"author": [
"https://openlibrary.org/authors/OL451969A"
],
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.64",
"bestRating": "5",
"ratingCount": "11"
},

"workExample": [
{
"@type": "Book",
"@id": "https://openlibrary.org/books/OL9875731M",
"isbn": "9780373115112",
"bookFormat": "http://schema.org/Paperback",
"inLanguage": "en",
"image": [
"https://covers.openlibrary.org/b/id/10519739-L.jpg"
],
"datePublished": "1992",
"sameAs": [
"https://www.worldcat.org/oclc/26493730",
"https://www.librarything.com/work/682860",
"https://www.goodreads.com/book/show/2078113"
],
"identifier": [
{
"@type": "PropertyValue",
"propertyID": "OCLC_NUMBER",
"value": "26493730"
}
],
"potentialAction": {
"@type": "BorrowAction",
"lender": {
"@type": "LibrarySystem",
"@id": "https://archive.org/"
},
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://archive.org/details/darkheritage00darc",
"actionPlatform": [
"http://schema.org/DesktopWebPlatform",
"http://schema.org/AndroidPlatform",
"http://schema.org/IOSPlatform"
]
}
}
}
]
}
```

### Proposal & Constraints

### Additional context
- See: https://developers.google.com/search/docs/data-types/book
- https://schema.org/Book

### Stakeholders

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.