From 6cc95c96a2ba6fb37b502e34ec7059eb0c6cbef5 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 18 Apr 2023 09:53:11 +0200 Subject: [PATCH] - --- .../dhp/bulktag/community/ResultTagger.java | 12 +++++++++++ .../dhp/bulktag/eosc/SparkEoscTag.java | 21 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java index 31bb8d530..98a64ab2f 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java @@ -67,6 +67,18 @@ public class ResultTagger implements Serializable { return result; } + //Execute the EOSCTag for the services + switch (result.getResulttype().getClassid()){ + case PUBLICATION_RESULTTYPE_CLASSID: + break; + case SOFTWARE_RESULTTYPE_CLASSID: + break; + case DATASET_RESULTTYPE_CLASSID: + break; + case ORP_RESULTTYPE_CLASSID: + break; + } + // communities contains all the communities to be added as context for the result final Set communities = new HashSet<>(); diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java index c131399cc..d249af5a7 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java @@ -71,6 +71,25 @@ public class SparkEoscTag { } + public static R tagForSoftware(Result s){ + if (containsCriteriaNotebook(s)) { + if (!Optional.ofNullable(s.getEoscifguidelines()).isPresent()) + s.setEoscifguidelines(new ArrayList<>()); + addEIG( + s.getEoscifguidelines(), EOSC_JUPYTER_NOTEBOOK, EOSC_JUPYTER_NOTEBOOK, "", + COMPLIES_WITH); + + } + if (containsCriteriaGalaxy(s)) { + if (!Optional.ofNullable(s.getEoscifguidelines()).isPresent()) + s.setEoscifguidelines(new ArrayList<>()); + + addEIG( + s.getEoscifguidelines(), EOSC_GALAXY_WORKFLOW, EOSC_GALAXY_WORKFLOW, "", COMPLIES_WITH); + } + return s; + } + private static void execEoscTag(SparkSession spark, String inputPath, String workingPath) { readPath(spark, inputPath + "/software", Software.class) @@ -190,7 +209,7 @@ public class SparkEoscTag { .orElse(false); } - private static boolean containsCriteriaNotebook(Software s) { + private static boolean containsCriteriaNotebook(R s) { if (!Optional.ofNullable(s.getSubject()).isPresent()) return false; if (s.getSubject().stream().anyMatch(sbj -> sbj.getValue().toLowerCase().contains("jupyter")))