pid-parser-service/parsers/Googleapis.js

21 lines
569 B
JavaScript

const Entity = require("../model/Entity");
class Googleapis{
parse(pid, item){
let entity = new Entity(pid);
entity.result.source = "googleapis";
entity.result.publisher = null;
entity.result.journal = null;
entity.id = pid;
entity.title = item['volumeInfo']['title']
entity.result.url = item['volumeInfo']['infoLink'];
entity.type = 'publication';
entity.result.date = item['volumeInfo']['publishedDate'].split('-')[0];
entity.result.accessRights = "OPEN";
return entity;
}
}
module.exports = Googleapis;