}
protected JSONObject jsonBook(Map<String, Map<String, Collection<String>>> triples, String resource, String serverAddress){
Map<String, Collection<String>> value = triples.get(resource);
Book book = MbbTypes.getBook(value, triples);
JSONObject object = new JSONObject();
object.put("type", "Book");
object.put("id", resource);
object.put("uri", resource);
if(book != null){
object.put("bookType", book.getBookType());
object.put("label", book.getTitle());
object.put("abstract", book.getAbstr());
JSONArray authors = new JSONArray();
if(book.getAuthors() != null)
for(Person author : book.getAuthors())
authors.add(author.getName());
object.put("creator", authors);
JSONArray keywords = new JSONArray();
if(book.getKeywords() != null)
keywords.addAll(book.getKeywords());
object.put("keywords", keywords);
this.addProperties(object, book.getOtherProperties());
String coverFile = (book.getCover() != null)?book.getCover():"image/def_cover_page.jpg";
object.put("cover", serverAddress+"servlet/showImage?from=cover&file="+coverFile+"&type="+((book.getCoverMime()!=null)?book.getCoverMime():"image/jpg")+"&w=50");
}
return object;