[stats wf] indicators across stats dbs & updates in the org ids #248

Closed
dimitris.pierrakos wants to merge 1742 commits from beta into beta2master_sept_2022
2 changed files with 32 additions and 1 deletions
Showing only changes of commit 6cc95c96a2 - Show all commits

View File

@ -67,6 +67,18 @@ public class ResultTagger implements Serializable {
return result; 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 // communities contains all the communities to be added as context for the result
final Set<String> communities = new HashSet<>(); final Set<String> communities = new HashSet<>();

View File

@ -71,6 +71,25 @@ public class SparkEoscTag {
} }
public static <R extends Result> 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) { private static void execEoscTag(SparkSession spark, String inputPath, String workingPath) {
readPath(spark, inputPath + "/software", Software.class) readPath(spark, inputPath + "/software", Software.class)
@ -190,7 +209,7 @@ public class SparkEoscTag {
.orElse(false); .orElse(false);
} }
private static boolean containsCriteriaNotebook(Software s) { private static <R extends Result> boolean containsCriteriaNotebook(R s) {
if (!Optional.ofNullable(s.getSubject()).isPresent()) if (!Optional.ofNullable(s.getSubject()).isPresent())
return false; return false;
if (s.getSubject().stream().anyMatch(sbj -> sbj.getValue().toLowerCase().contains("jupyter"))) if (s.getSubject().stream().anyMatch(sbj -> sbj.getValue().toLowerCase().contains("jupyter")))