From cf6b8845271705e066f2b7a466f30d304ea19d90 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 7 Oct 2021 12:26:23 +0200 Subject: [PATCH] Fixed Bionym Local empty value error --- .../transducers/bionym/utils/YasmeenFileTools.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/dataanalysis/executor/nodes/transducers/bionym/utils/YasmeenFileTools.java b/src/main/java/org/gcube/dataanalysis/executor/nodes/transducers/bionym/utils/YasmeenFileTools.java index c12fb8c..5b4a1ce 100644 --- a/src/main/java/org/gcube/dataanalysis/executor/nodes/transducers/bionym/utils/YasmeenFileTools.java +++ b/src/main/java/org/gcube/dataanalysis/executor/nodes/transducers/bionym/utils/YasmeenFileTools.java @@ -52,11 +52,18 @@ public class YasmeenFileTools { int i=0; // SOURCE_DATASOURCE_ID SOURCE_ID SOURCE_DATA PRE_PARSED_SOURCE_DATA PARSED_SCIENTIFIC_NAME PARSED_AUTHORITY PARSER POST_PARSED_SCIENTIFIC_NAME POST_PARSED_AUTHORITY MATCHING_SCORE TARGET_DATA_SOURCE TARGET_DATA_ID TARGET_DATA_SCIENTIFIC_NAME TARGET_DATA_AUTHORITY TARGET_DATA_KINGDOM TARGET_DATA_PHYLUM TARGET_DATA_CLASS TARGET_DATA_ORDER TARGET_DATA_FAMILY TARGET_DATA_GENUS TARGET_DATA_SPECIES TARGET_DATA_VERNACULAR_NAMES while (line!=null){ - AnalysisLogger.getLogger().debug("Yasmeen Output line:"+line); + AnalysisLogger.getLogger().debug("Yasmeen Output line: "+line); List tokens = Transformations.parseCVSString(line, ";"); if (tokens.size()>0){ + Double d=new Double(0); + try { + d=Double.parseDouble(tokens.get(9)); + } catch (Exception e) { + AnalysisLogger.getLogger().debug("Invalid value: "+tokens.get(9)); + } + output.addEntry(i,tokens.get(2),tokens.get(7),tokens.get(8), - Double.parseDouble(tokens.get(9)),tokens.get(10),tokens.get(11),tokens.get(12),tokens.get(13),null); + d,tokens.get(10),tokens.get(11),tokens.get(12),tokens.get(13),null); } line = br.readLine(); i++;