From 3b1af80883b5bfb660d32587963dcd7ba0f9f917 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Tue, 21 May 2024 13:47:05 +0200 Subject: [PATCH] [graph provision]fixed wf definition, revised serialization of the usage counts measures --- .../utils/XmlSerializationUtils.java | 27 ++++++------------- .../dhp/oa/provision/oozie_app/workflow.xml | 2 +- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlSerializationUtils.java b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlSerializationUtils.java index b4d021b68..fbd647ae4 100644 --- a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlSerializationUtils.java +++ b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/oa/provision/utils/XmlSerializationUtils.java @@ -170,30 +170,19 @@ public class XmlSerializationUtils { return sb.toString(); } - // infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE + // + // public static String usageMeasureAsXmlElement(String name, Measure measure) { - HashSet dsIds = Optional - .ofNullable(measure.getUnit()) - .map( - m -> m - .stream() - .map(KeyValue::getKey) - .collect(Collectors.toCollection(HashSet::new))) - .orElse(new HashSet<>()); - StringBuilder sb = new StringBuilder(); - dsIds.forEach(dsId -> { + for (KeyValue kv : measure.getUnit()) { sb .append("<") - .append(name); - for (KeyValue kv : measure.getUnit()) { - sb.append(" ").append(attr(measure.getId(), kv.getValue())); - } - sb + .append(name) .append(" ") - .append(attr("datasource", dsId)) - .append("/>"); - }); + .append(attr(measure.getId(), kv.getValue())) + .append(attr("datasource", kv.getKey())) + .append(" />"); + } return sb.toString(); } diff --git a/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/oa/provision/oozie_app/workflow.xml b/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/oa/provision/oozie_app/workflow.xml index 1682f2ed5..bca061c20 100644 --- a/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/oa/provision/oozie_app/workflow.xml +++ b/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/oa/provision/oozie_app/workflow.xml @@ -15,8 +15,8 @@ validateXML - should the payload converter validate the XMLs false + should the payload converter validate the XMLs relPartitions