fixed issue on substring

This commit is contained in:
Miriam Baglioni 2020-07-08 12:11:51 +02:00
parent 7fe00cb4fb
commit 1b0b968548
1 changed files with 15 additions and 9 deletions

View File

@ -161,16 +161,22 @@ public class Mapper implements Serializable {
.getContext() .getContext()
.stream() .stream()
.map(c -> { .map(c -> {
if (communities.contains(c.getId()) String community_id = c.getId();
|| communities.contains(c.getId().substring(0, c.getId().indexOf("::")))) { if (community_id.indexOf("::") > 0) {
community_id = community_id.substring(0, community_id.indexOf("::"));
}
if (communities.contains(community_id)) {
// || communities.contains(c.getId().substring(0, c.getId().indexOf("::")))) {
Context context = new Context(); Context context = new Context();
if (!communityMap.containsKey(c.getId())) { context.setCode(community_id);
context.setCode(c.getId().substring(0, c.getId().indexOf("::"))); context.setLabel(communityMap.get(community_id));
context.setLabel(communityMap.get(context.getCode())); // if (!communityMap.containsKey(c.getId())) {
} else { // context.setCode(c.getId().substring(0, c.getId().indexOf("::")));
context.setCode(c.getId()); // context.setLabel(communityMap.get(context.getCode()));
context.setLabel(communityMap.get(c.getId())); // } else {
} // context.setCode(c.getId());
// context.setLabel(communityMap.get(c.getId()));
// }
Optional<List<DataInfo>> dataInfo = Optional.ofNullable(c.getDataInfo()); Optional<List<DataInfo>> dataInfo = Optional.ofNullable(c.getDataInfo());
if (dataInfo.isPresent()) { if (dataInfo.isPresent()) {
List<String> provenance = new ArrayList<>(); List<String> provenance = new ArrayList<>();