From 457c07a5225b3d079d2073baefc532818ba1102f Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Wed, 18 Nov 2020 11:56:40 +0100 Subject: [PATCH] added the ignore case for both the constraints --- .../clean/authorpids/constraints/ContainsConstraint.java | 2 +- .../clean/authorpids/constraints/EqualConstraint.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/ContainsConstraint.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/ContainsConstraint.java index 59461c9c7b..9445110d95 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/ContainsConstraint.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/ContainsConstraint.java @@ -17,7 +17,7 @@ public class ContainsConstraint implements Selection, Serializable { @Override public boolean apply(String value) { - return value.contains(param); + return value.contains(param.toLowerCase()); } public String getParam() { diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/EqualConstraint.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/EqualConstraint.java index 7026e11a9e..0ad53d2ee0 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/EqualConstraint.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/authorpids/constraints/EqualConstraint.java @@ -3,6 +3,10 @@ package eu.dnetlib.dhp.oa.graph.clean.authorpids.constraints; import java.io.Serializable; +import org.apache.commons.lang3.StringUtils; + +import py4j.StringUtil; + @ConstraintClass("equals") public class EqualConstraint implements Selection, Serializable { @@ -17,7 +21,9 @@ public class EqualConstraint implements Selection, Serializable { @Override public boolean apply(String value) { - return value.equals(param); + if (StringUtils.isEmpty(value)) + return false; + return value.equalsIgnoreCase(param); } public String getParam() {