Angela Italiano 2013-10-24 12:04:50 +00:00
parent f22eaeb620
commit 73cd231c2c
4 changed files with 41 additions and 8 deletions

30
pom.xml
View File

@ -47,6 +47,24 @@
<artifactId>common-scope-maps</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.data.spd</groupId>
<artifactId>spd-client-library</artifactId>
@ -106,12 +124,12 @@
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.gcube.core</groupId> -->
<!-- <artifactId>common-fw-clients</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> -->
<!-- <scope>runtime</scope> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.gcube.core</groupId> -->
<!-- <artifactId>common-fw-clients</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> -->
<!-- <scope>runtime</scope> -->
<!-- </dependency> -->
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>

View File

@ -19,6 +19,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.data.spd.model.CommonName;
import org.gcube.data.spd.model.products.TaxonomyItem;
import org.slf4j.Logger;
@ -359,7 +361,17 @@ public class MapDwCA {
* Create hashtable with taxonomy keys
*/
private void getTax(TaxonomyItem tax, Hashtable<String, String> taxa){
if(tax!=null)
if(tax.getRank()!=null && tax.getScientificName()!=null)
taxa.put((tax.getRank()).toLowerCase(), tax.getScientificName());
else
{
AnalysisLogger.getLogger().debug("in DWA generator, tax rank or SN are null");
}
else
{
AnalysisLogger.getLogger().debug("tax is null");
}
//writeLine(tax);
// logger.trace("insert parent " + tax.getId() + " " + tax.getScientificName());
if (tax.getParent()!=null)

View File

@ -158,13 +158,14 @@ public class TaxaProcedure extends StandardLocalExternalAlgorithm {
th1.join();
th2.join();
th3.join();
AnalysisLogger.getLogger().debug("Thread finished");
Vector<TaxonomyItem> taxaList = t1.getTaxaList();
taxaList.addAll(t2.getTaxaList());
taxaList.addAll(t3.getTaxaList());
MapDwCA fileMaker = new MapDwCA(super.config.getPersistencePath());
Iterator<TaxonomyItem> it = taxaList.iterator();
file = fileMaker.createDwCA(it);
AnalysisLogger.getLogger().debug("DWA Created");
insertInTheTableErrors(t1.getErrors());
insertInTheTableErrors(t2.getErrors());
insertInTheTableErrors(t3.getErrors());

View File

@ -72,17 +72,19 @@ public class ThreadExtractionTaxaFromSPD implements Runnable {
while (stream.hasNext()) {
i++;
TaxonomyItem ti = (TaxonomyItem) stream.next();
System.out.println("Inside whiele: "+ti.toString());
AnalysisLogger.getLogger().debug("Inside whiele: "+ti.toString());
taxaList.add(ti);
informations.add(crateRowTable(ti));
}
if(i==0)
{
AnalysisLogger.getLogger().debug(species+" not found.");
errors.add(species+" not found.");
}
} catch (Exception e) {
errors.add("Exception on "+species+" :"+ e.getMessage());
AnalysisLogger.getLogger().debug("Exception on "+species+" :"+ e.getMessage());
e.printStackTrace();
}