diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorPlugin.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorPlugin.java index c8ea1c04d..7bcc997d0 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorPlugin.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorPlugin.java @@ -45,9 +45,9 @@ public class BaseCollectorPlugin implements CollectorPlugin { public Stream collect(final ApiDescriptor api, final AggregatorReport report) throws CollectorException { // get path to file final Path filePath = Optional - .ofNullable(api.getBaseUrl()) - .map(Path::new) - .orElseThrow(() -> new CollectorException("missing baseUrl")); + .ofNullable(api.getBaseUrl()) + .map(Path::new) + .orElseThrow(() -> new CollectorException("missing baseUrl")); final String dbUrl = api.getParams().get("dbUrl"); final String dbUser = api.getParams().get("dbUser"); @@ -59,7 +59,9 @@ public class BaseCollectorPlugin implements CollectorPlugin { log.info("dbPassword: {}", "***"); try { - if (!this.fs.exists(filePath)) { throw new CollectorException("path does not exist: " + filePath); } + if (!this.fs.exists(filePath)) { + throw new CollectorException("path does not exist: " + filePath); + } } catch (final Throwable e) { throw new CollectorException(e); } @@ -69,19 +71,20 @@ public class BaseCollectorPlugin implements CollectorPlugin { final Iterator iterator = new BaseCollectorIterator(this.fs, filePath, report); final Spliterator spliterator = Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED); return StreamSupport - .stream(spliterator, false) - .filter(doc -> filterXml(doc, acceptedOpendoarIds, report)); + .stream(spliterator, false) + .filter(doc -> filterXml(doc, acceptedOpendoarIds, report)); } private Set findAcceptedOpendoarIds(final String dbUrl, final String dbUser, final String dbPassword) - throws CollectorException { + throws CollectorException { final Set accepted = new HashSet<>(); try (final DbClient dbClient = new DbClient(dbUrl, dbUser, dbPassword)) { final String sql = IOUtils - .toString(BaseAnalyzerJob.class - .getResourceAsStream("/eu/dnetlib/dhp/collection/plugin/base/sql/opendoar-accepted.sql")); + .toString( + BaseAnalyzerJob.class + .getResourceAsStream("/eu/dnetlib/dhp/collection/plugin/base/sql/opendoar-accepted.sql")); dbClient.processResults(sql, row -> { try { @@ -106,7 +109,10 @@ public class BaseCollectorPlugin implements CollectorPlugin { private boolean filterXml(final String xml, final Set acceptedOpendoarIds, final AggregatorReport report) { try { - final String id = DocumentHelper.parseText(xml).valueOf("//*[local-name()='collection']/@opendoar_id").trim(); + final String id = DocumentHelper + .parseText(xml) + .valueOf("//*[local-name()='collection']/@opendoar_id") + .trim(); return (StringUtils.isNotBlank(id) && acceptedOpendoarIds.contains("opendoar____::" + id.trim())); } catch (final DocumentException e) { log.error("Error parsing document", e); diff --git a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/xml/base-types.vocabulary.xml b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/xml/base-types.vocabulary.xml new file mode 100644 index 000000000..ecbb07241 --- /dev/null +++ b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/xml/base-types.vocabulary.xml @@ -0,0 +1,180 @@ + +
+ + + + + +
+ + + base:normalized_types + base:normalized_types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + String + +
+ + \ No newline at end of file diff --git a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/tr/base-2-oaf.xml b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/xml/base2oaf.transformationRule.xml similarity index 97% rename from dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/tr/base-2-oaf.xml rename to dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/xml/base2oaf.transformationRule.xml index fa57bb4d7..415ea1636 100644 --- a/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/tr/base-2-oaf.xml +++ b/dhp-workflows/dhp-aggregation/src/main/resources/eu/dnetlib/dhp/collection/plugin/base/xml/base2oaf.transformationRule.xml @@ -58,6 +58,9 @@ base_dc:link (I used dc:identifier) --> + + + @@ -100,11 +103,15 @@ base_dc:link (I used dc:identifier) + + + + @@ -202,8 +209,8 @@ base_dc:link (I used dc:identifier) - - + +