1
0
Fork 0
This commit is contained in:
Miriam Baglioni 2023-04-18 09:53:11 +02:00
parent a2dcb06daf
commit 6cc95c96a2
2 changed files with 32 additions and 1 deletions

View File

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