Built synthetic FAIR guidelines that needed to get through rules of the data archives guidelines.

This commit is contained in:
pispis 2022-12-08 15:53:29 +02:00
parent 101421094b
commit 674a8ca833
9 changed files with 212 additions and 199 deletions

View File

@ -16,7 +16,7 @@ public final class StandardResult implements Guideline.Result {
private final Status status;
private final int score;
private StandardResult(int score, Status status, List<String> warnings, List<String> errors, String internalError) {
public StandardResult(int score, Status status, List<String> warnings, List<String> errors, String internalError) {
this.status = status;
this.score = score;
this.warnings = warnings;

View File

@ -88,7 +88,7 @@ public final class F2_01M extends AbstractOpenAireProfile {
private static final int MAX_SCORE = GUIDELINES.stream().map(Guideline::getWeight).reduce(0, Integer::sum);
public F2_01M() {
super("F2_01M Guideline for the OpenAIRE FAIR Guidelines for Data Repositories Profile v4");
super("Rich metadata is provided to allow discovery");
}
@Override

View File

@ -53,7 +53,7 @@ public final class F3_01M extends AbstractOpenAireProfile {
private static final int MAX_SCORE = GUIDELINES.stream().map(Guideline::getWeight).reduce(0, Integer::sum);
public F3_01M() {
super("F3_01M Guideline for the OpenAIRE FAIR Guidelines for Data Repositories Profile v4");
super("Metadata includes the identifier for the data");
}
@Override

View File

@ -1,5 +1,6 @@
package eu.dnetlib.validator2.validation.guideline.openaire;
//import com.google.gson.Gson;
import eu.dnetlib.validator2.engine.Status;
import eu.dnetlib.validator2.validation.XMLApplicationProfile;
import eu.dnetlib.validator2.validation.guideline.*;
@ -9,8 +10,7 @@ import org.w3c.dom.Document;
import java.util.*;
import java.util.stream.Collectors;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE_TO_N;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.*;
public final class FAIR_Data_GuidelinesProfile extends AbstractOpenAireProfile {
@ -289,80 +289,80 @@ public final class FAIR_Data_GuidelinesProfile extends AbstractOpenAireProfile {
}
// TODO this goes to FAIRProfile
class MetadataCompleteness extends AbstractGuideline<Document> {
public MetadataCompleteness() {
super("MetadataCompleteness", 40);
}
@Override
public Result validate(String id, Document t) {
DataArchiveGuidelinesV2Profile profile = new DataArchiveGuidelinesV2Profile();
// <></>ODO: iterate over results and build one Guideline.Result
try {
// System.out.println("Processing MetadataCompleteness...");
XMLApplicationProfile.ValidationResult res = profile.validate(id, t);
Map<String, Result> results = res.results();
int MaxScoreMetadataCompleteness = (int) ((res.score()*getWeight())/100);
// System.out.println("Max score DataValidator(%): " + res.score());
// System.out.println("Weight FAIRG: " + getWeight());
// System.out.println("Max score MetadataCompleteness: " + MaxScoreMetadataCompleteness);
// System.out.println("\n\n\n\n");
// for (Map.Entry entry : results.entrySet()) {
// System.out.println(entry.getKey() + " = " + entry.getValue());
//// TODO this goes to FAIRProfile
//class MetadataCompleteness extends AbstractGuideline<Document> {
//
// public MetadataCompleteness() {
// super("MetadataCompleteness", 40);
// }
//
// @Override
// public Result validate(String id, Document t) {
// DataArchiveGuidelinesV2Profile profile = new DataArchiveGuidelinesV2Profile();
//
// // <></>ODO: iterate over results and build one Guideline.Result
// try {
//// System.out.println("Processing MetadataCompleteness...");
// XMLApplicationProfile.ValidationResult res = profile.validate(id, t);
// Map<String, Result> results = res.results();
// int MaxScoreMetadataCompleteness = (int) ((res.score()*getWeight())/100);
//
//// System.out.println("Max score DataValidator(%): " + res.score());
//// System.out.println("Weight FAIRG: " + getWeight());
//// System.out.println("Max score MetadataCompleteness: " + MaxScoreMetadataCompleteness);
//// System.out.println("\n\n\n\n");
//
//// for (Map.Entry entry : results.entrySet()) {
//// System.out.println(entry.getKey() + " = " + entry.getValue());
//// }
//// System.out.println(score);
// return getResult(MaxScoreMetadataCompleteness);
//
//// System.out.println(tempp.status() + " - " + tempp.score());
//// String printout = results.entrySet().stream().
//// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
//// System.out.println(printout);
//
//// System.out.println("\n\n\n\n");
// } catch (Exception e) {
// System.out.println(e.getMessage());
// System.out.println(e);
// e.printStackTrace();
// }
//
// return null;
// }
//
// private static Result getResult(int score) {
// String aa;
// aa = (score > 0) ? "SUCCESS" : "FAILURE";
// return new Result() {
// @Override
// public int score() {
// return score;
// }
// System.out.println(score);
return getResult(MaxScoreMetadataCompleteness);
// System.out.println(tempp.status() + " - " + tempp.score());
// String printout = results.entrySet().stream().
// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
// System.out.println(printout);
// System.out.println("\n\n\n\n");
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
e.printStackTrace();
}
return null;
}
private static Result getResult(int score) {
String aa;
aa = (score > 0) ? "SUCCESS" : "FAILURE";
return new Result() {
@Override
public int score() {
return score;
}
@Override
public Status status() {
// return null;
return Status.valueOf(aa);
}
@Override
public Iterable<String> warnings() { return null; }
@Override
public Iterable<String> errors() {
return null;
}
@Override
public String internalError() {
return null;
}
};
}
}
//
// @Override
// public Status status() {
//// return null;
// return Status.valueOf(aa);
// }
//
// @Override
// public Iterable<String> warnings() { return null; }
//
// @Override
// public Iterable<String> errors() {
// return null;
// }
//
// @Override
// public String internalError() {
// return null;
// }
// };
// }
//}
class F2_01M_SPEC extends AbstractGuideline<Document> {
@ -374,39 +374,47 @@ class F2_01M_SPEC extends AbstractGuideline<Document> {
public Result validate(String id, Document t) {
F2_01M profile = new F2_01M();
// <></>ODO: iterate over results and build one Guideline.Result
// TODO: iterate over results and build one Guideline.Result
try {
System.out.println("\nRich metadata is provided to allow discovery");
XMLApplicationProfile.ValidationResult res_F = profile.validate(id, t);
Map<String, Result> results = res_F.results();
int MaxScoreF2_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
// Get actual score and not (%) to incorporate to FAIR score
final int MaxScoreF2_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
// System.out.println("Max score DataValidator(%): " + res_F.score());
// System.out.println("Weight FAIRG: " + getWeight());
// System.out.println("Max score F2_01M_SPEC: " + MaxScoreF2_01M_SPEC);
// System.out.println("\n\n\n\n");
for (Map.Entry entry : results.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
ArrayList<String> warnings2 = new ArrayList<>();
ArrayList<String> errors2 = new ArrayList<>();
int score = 0;
for (Map.Entry entry : res_F.results().entrySet()) {
if (res_F.results().get(entry.getKey()).warnings().toString().length() > 2) {
warnings2.add(res_F.results().get(entry.getKey()).warnings().toString());
}
if (res_F.results().get(entry.getKey()).errors().toString().length() > 2) {
errors2.add(res_F.results().get(entry.getKey()).errors().toString());
}
if (entry.getValue().toString().contains("SUCCESS")) {
score += 2;
}
}
return getResult(MaxScoreF2_01M_SPEC);
// System.out.println(tempp.status() + " - " + tempp.score());
// String printout = results.entrySet().stream().
// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
// System.out.println(printout);
// System.out.println("\n\n\n\n");
final Result ress = getResult(warnings2, errors2, score);
return new StandardResult(ress.score(), ress.status(), (List<String>) ress.warnings(), (List<String>) ress.errors(), ress.internalError());
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
e.printStackTrace();}
return null;
e.printStackTrace();
return null;
}
}
private static Result getResult(int score) {
String aa;
aa = (score > 0) ? "SUCCESS" : "FAILURE";
private static Result getResult(ArrayList<String> warnings2, ArrayList<String> errors2, int score) {
return new Result() {
@Override
public int score() {
@ -415,18 +423,17 @@ class F2_01M_SPEC extends AbstractGuideline<Document> {
@Override
public Status status() {
// return null;
return Status.valueOf(aa);
return Status.valueOf((score > 0) ? "SUCCESS" : "FAILURE");
}
@Override
public Iterable<String> warnings() {
return null;
return warnings2;
}
@Override
public Iterable<String> errors() {
return null;
return errors2;
}
@Override
@ -445,9 +452,9 @@ class F3_01M_SPEC extends AbstractGuideline<Document> {
public Result validate(String id, Document t) {
F3_01M profile = new F3_01M();
// <></>ODO: iterate over results and build one Guideline.Result
// TODO: iterate over results and build one Guideline.Result
try {
System.out.println("\nMetadata includes the identifier for the data");
// System.out.println("\nMetadata includes the identifier for the data");
XMLApplicationProfile.ValidationResult res_F = profile.validate(id, t);
Map<String, Result> results = res_F.results();
// int MaxScoreF3_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
@ -460,32 +467,30 @@ class F3_01M_SPEC extends AbstractGuideline<Document> {
MaxScoreF3_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
}
// System.out.println("% score DataValidator: " + res_F.score());
// System.out.println("Weight FAIRG: " + getWeight());
// System.out.println("Max score F3_01M_SPEC: " + MaxScoreF3_01M_SPEC);
// System.out.println("\n\n\n\n");
for (Map.Entry entry : results.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
ArrayList<String> warnings2 = new ArrayList<>();
ArrayList<String> errors2 = new ArrayList<>();
for (Map.Entry entry : res_F.results().entrySet()) {
if (res_F.results().get(entry.getKey()).warnings().toString().length() > 2) {
warnings2.add(res_F.results().get(entry.getKey()).warnings().toString());
}
if (res_F.results().get(entry.getKey()).errors().toString().length() > 2) {
errors2.add(res_F.results().get(entry.getKey()).errors().toString());
}
}
return getResult(MaxScoreF3_01M_SPEC);
// System.out.println(tempp.status() + " - " + tempp.score());
// String printout = results.entrySet().stream().
// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
// System.out.println(printout);
// System.out.println("\n\n\n\n");
final Result ress = getResult(warnings2, errors2, MaxScoreF3_01M_SPEC);
return new StandardResult(ress.score(), ress.status(), (List<String>) ress.warnings(), (List<String>) ress.errors(), ress.internalError());
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
e.printStackTrace();
return null;
}
return null;
}
private static Result getResult(ArrayList<String> warnings2, ArrayList<String> errors2, int score) {
private static Result getResult(int score) {
String aa;
aa = (score > 0) ? "SUCCESS" : "FAILURE";
return new Result() {
@Override
public int score() {
@ -494,18 +499,17 @@ class F3_01M_SPEC extends AbstractGuideline<Document> {
@Override
public Status status() {
// return null;
return Status.valueOf(aa);
return Status.valueOf((score > 0) ? "SUCCESS" : "FAILURE");
}
@Override
public Iterable<String> warnings() {
return null;
return warnings2;
}
@Override
public Iterable<String> errors() {
return null;
return errors2;
}
@Override
@ -524,9 +528,9 @@ class I2_01M_SPEC extends AbstractGuideline<Document> {
public Result validate(String id, Document t) {
I2_01M profile = new I2_01M();
// <></>ODO: iterate over results and build one Guideline.Result
// TODO: iterate over results and build one Guideline.Result
try {
System.out.println("\nMetadata uses FAIR-compliant vocabularies");
// System.out.println("\nMetadata uses FAIR-compliant vocabularies");
XMLApplicationProfile.ValidationResult res_F = profile.validate(id, t);
Map<String, Result> results = res_F.results();
// int MaxScoreI2_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
@ -539,21 +543,21 @@ class I2_01M_SPEC extends AbstractGuideline<Document> {
MaxScoreI2_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
}
// System.out.println("% score DataValidator: " + res_F.score());
// System.out.println("Weight FAIRG: " + getWeight());
// System.out.println("Max score I2_01M_SPEC: " + MaxScoreI2_01M_SPEC);
// System.out.println("\n\n\n\n");
for (Map.Entry entry : results.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
ArrayList<String> warnings2 = new ArrayList<>();
ArrayList<String> errors2 = new ArrayList<>();
for (Map.Entry entry : res_F.results().entrySet()) {
if (res_F.results().get(entry.getKey()).warnings().toString().length() > 2) {
warnings2.add(res_F.results().get(entry.getKey()).warnings().toString());
}
if (res_F.results().get(entry.getKey()).errors().toString().length() > 2) {
errors2.add(res_F.results().get(entry.getKey()).errors().toString());
}
}
return getResult(MaxScoreI2_01M_SPEC);
// System.out.println(tempp.status() + " - " + tempp.score());
// String printout = results.entrySet().stream().
// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
// System.out.println(printout);
// System.out.println("\n\n\n\n");
final Result ress = getResult(warnings2, errors2, MaxScoreI2_01M_SPEC);
return new StandardResult(ress.score(), ress.status(), (List<String>) ress.warnings(), (List<String>) ress.errors(), ress.internalError());
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
@ -562,9 +566,8 @@ class I2_01M_SPEC extends AbstractGuideline<Document> {
return null;
}
private static Result getResult(int score) {
String aa;
aa = (score > 0) ? "SUCCESS" : "FAILURE";
private static Result getResult(ArrayList<String> warnings2, ArrayList<String> errors2, int score) {
return new Result() {
@Override
public int score() {
@ -573,18 +576,17 @@ class I2_01M_SPEC extends AbstractGuideline<Document> {
@Override
public Status status() {
return null;
// return Status.valueOf(aa);
return Status.valueOf((score > 0) ? "SUCCESS" : "FAILURE");
}
@Override
public Iterable<String> warnings() {
return null;
return warnings2;
}
@Override
public Iterable<String> errors() {
return null;
return errors2;
}
@Override
@ -603,28 +605,32 @@ class R1_01M_SPEC extends AbstractGuideline<Document> {
public Result validate(String id, Document t) {
R1_01M profile = new R1_01M();
// <></>ODO: iterate over results and build one Guideline.Result
// TODO: iterate over results and build one Guideline.Result
try {
System.out.println("\nPlurality of accurate and relevant attributes are provided to allow reuse");
// System.out.println("\nPlurality of accurate and relevant attributes are provided to allow reuse");
XMLApplicationProfile.ValidationResult res_F = profile.validate(id, t);
Map<String, Result> results = res_F.results();
int MaxScoreR1_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
// System.out.println("% score DataValidator: " + res_F.score());
// System.out.println("Weight FAIRG: " + getWeight());
// System.out.println("Max score R1_01M_SPEC: " + MaxScoreR1_01M_SPEC);
// System.out.println("\n\n\n\n");
for (Map.Entry entry : results.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
ArrayList<String> warnings2 = new ArrayList<>();
ArrayList<String> errors2 = new ArrayList<>();
int score = 0;
for (Map.Entry entry : res_F.results().entrySet()) {
if (res_F.results().get(entry.getKey()).warnings().toString().length() > 2) {
warnings2.add(res_F.results().get(entry.getKey()).warnings().toString());
}
if (res_F.results().get(entry.getKey()).errors().toString().length() > 2) {
errors2.add(res_F.results().get(entry.getKey()).errors().toString());
}
if (entry.getValue().toString().contains("SUCCESS")) {
score += 3;
}
}
return getResult(MaxScoreR1_01M_SPEC);
// System.out.println(tempp.status() + " - " + tempp.score());
// String printout = results.entrySet().stream().
// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
// System.out.println(printout);
// System.out.println("\n\n\n\n");
final Result ress = getResult(warnings2, errors2, score);
return new StandardResult(ress.score(), ress.status(), (List<String>) ress.warnings(), (List<String>) ress.errors(), ress.internalError());
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
@ -633,8 +639,8 @@ class R1_01M_SPEC extends AbstractGuideline<Document> {
return null;
}
private static Result getResult(int score) {
String aa = (score > 0) ? "SUCCESS" : "FAILURE";
private static Result getResult(ArrayList<String> warnings2, ArrayList<String> errors2, int score) {
return new Result() {
@Override
public int score() {
@ -643,18 +649,17 @@ class R1_01M_SPEC extends AbstractGuideline<Document> {
@Override
public Status status() {
return null;
// return Status.valueOf(aa);
return Status.valueOf((score > 0) ? "SUCCESS" : "FAILURE");
}
@Override
public Iterable<String> warnings() {
return null;
return warnings2;
}
@Override
public Iterable<String> errors() {
return null;
return errors2;
}
@Override
@ -673,28 +678,33 @@ class R1_2_01M_SPEC extends AbstractGuideline<Document> {
public Result validate(String id, Document t) {
R1_2_01M profile = new R1_2_01M();
// <></>ODO: iterate over results and build one Guideline.Result
// TODO: iterate over results and build one Guideline.Result
try {
System.out.println("\nMetadata includes provenance information according to a cross-community language");
// System.out.println("\nMetadata includes provenance information according to a cross-community language");
XMLApplicationProfile.ValidationResult res_F = profile.validate(id, t);
Map<String, Result> results = res_F.results();
int MaxScoreR1_2_01M_SPEC = (int) ((res_F.score()*getWeight())/100);
// System.out.println("% score DataValidator: " + res_F.score());
// System.out.println("Weight FAIRG: " + getWeight());
// System.out.println("Max score R1_2_01M_SPEC: " + MaxScoreR1_2_01M_SPEC);
// System.out.println("\n\n\n\n");
for (Map.Entry entry : results.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
ArrayList<String> warnings2 = new ArrayList<>();
ArrayList<String> errors2 = new ArrayList<>();
int score = 0;
for (Map.Entry entry : res_F.results().entrySet()) {
if (res_F.results().get(entry.getKey()).warnings().toString().length() > 2) {
warnings2.add(res_F.results().get(entry.getKey()).warnings().toString());
}
if (res_F.results().get(entry.getKey()).errors().toString().length() > 2) {
errors2.add(res_F.results().get(entry.getKey()).errors().toString());
}
if (entry.getValue().toString().contains("SUCCESS")) {
score += 3;
}
}
return getResult(MaxScoreR1_2_01M_SPEC);
// System.out.println(tempp.status() + " - " + tempp.score());
// String printout = results.entrySet().stream().
// map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
// System.out.println(printout);
// System.out.println("\n\n\n\n");
final Result ress = getResult(warnings2, errors2, score);
return new StandardResult(ress.score(), ress.status(), (List<String>) ress.warnings(), (List<String>) ress.errors(), ress.internalError());
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
@ -703,9 +713,8 @@ class R1_2_01M_SPEC extends AbstractGuideline<Document> {
return null;
}
private static Result getResult(int score) {
String aa;
aa = (score > 0) ? "SUCCESS" : "FAILURE";
private static Result getResult(ArrayList<String> warnings2, ArrayList<String> errors2, int score) {
return new Result() {
@Override
public int score() {
@ -714,18 +723,17 @@ class R1_2_01M_SPEC extends AbstractGuideline<Document> {
@Override
public Status status() {
// return null;
return Status.valueOf(aa);
return Status.valueOf((score > 0) ? "SUCCESS" : "FAILURE");
}
@Override
public Iterable<String> warnings() {
return null;
return warnings2;
}
@Override
public Iterable<String> errors() {
return null;
return errors2;
}
@Override

View File

@ -43,7 +43,7 @@ public final class I2_01M extends AbstractOpenAireProfile {
private static final int MAX_SCORE = GUIDELINES.stream().map(Guideline::getWeight).reduce(0, Integer::sum);
public I2_01M() {
super("I2_01M Guideline for the OpenAIRE FAIR Guidelines for Data Repositories Profile v4");
super("Metadata uses FAIR-compliant vocabularies");
}
@Override

View File

@ -59,7 +59,7 @@ public final class R1_01M extends AbstractOpenAireProfile {
private static final int MAX_SCORE = GUIDELINES.stream().map(Guideline::getWeight).reduce(0, Integer::sum);
public R1_01M() {
super("F2_01M Guideline for the OpenAIRE FAIR Guidelines for Data Repositories Profile v4");
super("Plurality of accurate and relevant attributes are provided to allow reuse");
}
@Override

View File

@ -102,7 +102,7 @@ public final class R1_2_01M extends AbstractOpenAireProfile {
private static final int MAX_SCORE = GUIDELINES.stream().map(Guideline::getWeight).reduce(0, Integer::sum);
public R1_2_01M() {
super("R1_2_01M Guideline for the OpenAIRE FAIR Guidelines for Data Repositories Profile v4");
super("Metadata includes provenance information according to a cross-community language");
}
@Override

View File

@ -14,9 +14,9 @@ import java.util.stream.Collectors;
public class Test {
private static final String[] FILES = new String[] {
"src/test/resources/openaireguidelinesV3/dia.library.tuc.gr/Record_21811.xml",
"src/test/resources/openaireguidelinesV3/cris.vtt.fi/01.xml",
"src/test/resources/openaireguidelinesV3/cris.vtt.fi/02.xml",
// "src/test/resources/openaireguidelinesV3/dia.library.tuc.gr/Record_21811.xml",
// "src/test/resources/openaireguidelinesV3/cris.vtt.fi/01.xml",
// "src/test/resources/openaireguidelinesV3/cris.vtt.fi/02.xml",
"src/test/resources/openaireguidelinesV3/cris.vtt.fi/03.xml"
};

View File

@ -1,7 +1,9 @@
package eu.dnetlib.validator2.engine;
//import com.google.gson.Gson;
import eu.dnetlib.validator2.validation.XMLApplicationProfile;
import eu.dnetlib.validator2.validation.guideline.Guideline;
import eu.dnetlib.validator2.validation.guideline.StandardResult;
import eu.dnetlib.validator2.validation.guideline.openaire.FAIR_Data_GuidelinesProfile;
import groovy.xml.DOMBuilder;
import org.w3c.dom.Document;
@ -30,24 +32,27 @@ public class Test_FAIR {
for (String file : FILES) {
try {
System.out.println("Processing " + file);
// Document doc = DOMBuilder.parse(new FileReader(file), false, true, true);
Document doc = DOMBuilder.parse(new FileReader(file), false, true, true);
XMLApplicationProfile.ValidationResult result = profile.validate(file, doc);
scorePerDoc.put(file, result.score());
Map<String, Guideline.Result> results = result.results();
for (Map.Entry entry : results.entrySet()) {
if (!entry.getValue().toString().contains("eu.dnetlib.validator2")) {
// System.out.println(result.results().get(entry.getKey().toString()));
// System.out.println(entry.getValue().getClass() + ": ");
//// if (!entry.getValue().toString().contains("eu.dnetlib.validator2")) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
//// }
}
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(e);
e.printStackTrace();
}
System.out.println("\n\n\n\n");
// System.out.println("\n\n\n\n");
}
System.out.println("\n\n\n\n");
// System.out.println("\n\n\n\n");
String printout = scorePerDoc.entrySet().stream().
map(entry -> entry.getValue() + ": " + entry.getKey()).collect(Collectors.joining("\n"));
System.out.println(printout);