Revision 59928
Added by Michele Artini over 3 years ago
EnrichOpenairePlugin.java | ||
---|---|---|
48 | 48 |
counters.put("citations", new Counter()); |
49 | 49 |
counters.put("urls", new Counter()); |
50 | 50 |
counters.put("projects", new Counter()); |
51 |
counters.put("dois", new Counter()); |
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
@Override |
... | ... | |
56 | 57 |
log.info("***** Openaire Enrichment - citations : " + counters.get("citations")); |
57 | 58 |
log.info("***** Openaire Enrichment - urls : " + counters.get("urls")); |
58 | 59 |
log.info("***** Openaire Enrichment - projects : " + counters.get("projects")); |
60 |
log.info("***** Openaire Enrichment - dois : " + counters.get("dois")); |
|
59 | 61 |
counters.clear(); |
60 | 62 |
} |
61 | 63 |
|
... | ... | |
65 | 67 |
counters.get("citations").incrementBefore(doc.getCitations().size()); |
66 | 68 |
counters.get("urls").incrementBefore(doc.getUrls().size()); |
67 | 69 |
counters.get("projects").incrementBefore(doc.getProjects().size()); |
70 |
counters.get("dois").incrementBefore(doc.getDois().size()); |
|
68 | 71 |
|
69 | 72 |
try { |
70 | 73 |
final Document docRes = (new SAXReader()).read(new StringReader(response)); |
... | ... | |
77 | 80 |
updateCitations(doc, n); |
78 | 81 |
updateUrls(doc, n); |
79 | 82 |
updateProjects(doc, n); |
83 |
updateDois(doc, n); |
|
80 | 84 |
updateBestRights(doc); |
81 | 85 |
|
82 | 86 |
return true; |
... | ... | |
90 | 94 |
counters.get("citations").incrementAfter(doc.getCitations().size()); |
91 | 95 |
counters.get("urls").incrementAfter(doc.getUrls().size()); |
92 | 96 |
counters.get("projects").incrementAfter(doc.getProjects().size()); |
97 |
counters.get("dois").incrementAfter(doc.getDois().size()); |
|
93 | 98 |
} |
94 | 99 |
|
95 | 100 |
return false; |
... | ... | |
170 | 175 |
} |
171 | 176 |
} |
172 | 177 |
|
178 |
private void updateDois(final MdRecord doc, final Node n) { |
|
179 |
for (final Object od : n.selectNodes(".//pid[@classid='doi']")) { |
|
180 |
final String doi = ((Node) od).getText().trim(); |
|
181 |
if (StringUtils.isNotBlank(doi)) { |
|
182 |
doc.getDois().add(doi); |
|
183 |
} |
|
184 |
} |
|
185 |
} |
|
186 |
|
|
173 | 187 |
private void updateBestRights(final MdRecord doc) { |
174 | 188 |
final Set<String> availables = doc.getUrls().stream().map(MyURL::getRights).map(String::toUpperCase).collect(Collectors.toSet()); |
175 | 189 |
if (availables.contains("OPEN ACCESS")) { |
Also available in: Unified diff
add dois