From 80f4baa412d5fe52be66b6ae2486b365fd75518a Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Wed, 1 Dec 2021 09:28:56 +0100 Subject: [PATCH 1/6] fixed relation label separator --- pom.xml | 2 +- src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d1e829d..172000b 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ scm:git:gitea@code-repo.d4science.org:D-Net/dhp-schemas.git scm:git:gitea@code-repo.d4science.org:D-Net/dhp-schemas.git https://code-repo.d4science.org/D-Net/dhp-schemas/ - dhp-schemas-2.9.23 + dhp-schemas-2.9.24 This module contains common schema classes meant to be used across the dnet-hadoop submodules diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java index bf0eed1..8639d55 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java @@ -181,7 +181,7 @@ public class ModelSupport { * @return */ public static String rel(String relType, String subRelType, String relClass) { - return String.format("%s-%s-%s", relType, subRelType, relClass); + return String.format("%s_%s_%s", relType, subRelType, relClass); } private static final String schemeTemplate = "dnet:%s_%s_relations"; From a69e57eeccc20b1adfef0cd88199e753dd1965b9 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 6 Dec 2021 09:53:15 +0100 Subject: [PATCH 2/6] Added helper method to lookup for inverse relations regardless of the upper/lower case in the relation encoding --- .../eu/dnetlib/dhp/schema/common/ModelSupport.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java index 8639d55..c93a45c 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java @@ -158,6 +158,16 @@ public class ModelSupport { } } + private RelationInverse findInverse(String encoding) { + return ModelSupport.relationInverseMap + .entrySet() + .stream() + .filter(r -> encoding.equalsIgnoreCase(r.getKey())) + .findFirst() + .map(r -> r.getValue()) + .orElseThrow(() -> new IllegalArgumentException("invalid relationship: " + encoding)); + } + /** * Helper method: fina a relation filtering by a relation name * @param relationName From 7bdc99e89da42862d05413102bbf960203b63ac0 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 6 Dec 2021 09:53:55 +0100 Subject: [PATCH 3/6] [maven-release-plugin] prepare release dhp-schemas-2.9.24 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eee9935..40c46a7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ eu.dnetlib.dhp dhp-schemas jar - 2.9.24-SNAPSHOT + 2.9.24 From 3be96a92f9c9d0fa671ac4d37df6e3de2988adf2 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 6 Dec 2021 09:53:58 +0100 Subject: [PATCH 4/6] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 40c46a7..edf73df 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ eu.dnetlib.dhp dhp-schemas jar - 2.9.24 + 2.9.25-SNAPSHOT From 0194a86433da76394672d8cf8907e4ced22d648e Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 6 Dec 2021 10:03:07 +0100 Subject: [PATCH 5/6] Revert to 923c0ff8031f7a1c2e2ea3bf1e4a744810034123 --- pom.xml | 2 +- .../eu/dnetlib/dhp/schema/common/ModelSupport.java | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index edf73df..eee9935 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ eu.dnetlib.dhp dhp-schemas jar - 2.9.25-SNAPSHOT + 2.9.24-SNAPSHOT diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java index c93a45c..8639d55 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java @@ -158,16 +158,6 @@ public class ModelSupport { } } - private RelationInverse findInverse(String encoding) { - return ModelSupport.relationInverseMap - .entrySet() - .stream() - .filter(r -> encoding.equalsIgnoreCase(r.getKey())) - .findFirst() - .map(r -> r.getValue()) - .orElseThrow(() -> new IllegalArgumentException("invalid relationship: " + encoding)); - } - /** * Helper method: fina a relation filtering by a relation name * @param relationName From 8a809a60e29bc6f8f13c3416ba60018eac2e56af Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 6 Dec 2021 10:45:23 +0100 Subject: [PATCH 6/6] Added helper method to lookup for inverse relations regardless of the upper/lower case in the relation encoding --- .../dnetlib/dhp/schema/common/ModelSupport.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java index 8639d55..1aa0d8f 100644 --- a/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java +++ b/src/main/java/eu/dnetlib/dhp/schema/common/ModelSupport.java @@ -158,6 +158,21 @@ public class ModelSupport { } } + /** + * Helper method: lookup relation inverse, given the direct relation encoding (case insensitive) + * @param encoding + * @return the relation inverse descriptor, throws @IllegalArgumentException when not found. + */ + public static RelationInverse findInverse(String encoding) { + return ModelSupport.relationInverseMap + .entrySet() + .stream() + .filter(r -> encoding.equalsIgnoreCase(r.getKey())) + .findFirst() + .map(r -> r.getValue()) + .orElseThrow(() -> new IllegalArgumentException("invalid relationship: " + encoding)); + } + /** * Helper method: fina a relation filtering by a relation name * @param relationName