If you want to represent this in Keto right now, you'd have to add the corresponding tuples for each book explicitly.
With userset-rewrites, which we are working on currently, you can in the future define rules for "traversing" or "deriving" relations, e.g., when all books are contained in a library, then you can define a service account on that library, and tell the system that all library service accounts have access to all contained books.
But either with or without userset-rewrites, if there is no direct or indirect relation between the authenticated subject (in this case the service account) and the object (the book), then there is no access.