pt.ua.bioinformatics.coeus.data.connect
Class CSVFactory

java.lang.Object
  extended by pt.ua.bioinformatics.coeus.data.connect.CSVFactory
All Implemented Interfaces:
ResourceFactory

public class CSVFactory
extends java.lang.Object
implements ResourceFactory

Data factory for transforming CSV data into RDF items using generic Triplify.


Constructor Summary
CSVFactory(Resource r)
           
 
Method Summary
static au.com.bytecode.opencsv.CSVReader getReader()
           
 Resource getRes()
           
 void read()
          Reads CSV data according to Resource information.
 boolean save()
          Updates the resource coeus:built property once the resource finished building.
static void setReader(au.com.bytecode.opencsv.CSVReader reader)
           
 void setRes(Resource res)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVFactory

public CSVFactory(Resource r)
Method Detail

getReader

public static au.com.bytecode.opencsv.CSVReader getReader()

setReader

public static void setReader(au.com.bytecode.opencsv.CSVReader reader)

getRes

public Resource getRes()

setRes

public void setRes(Resource res)

read

public void read()
Reads CSV data according to Resource information.

Workflow

  1. Check if resource is starter/extends
  2. Load CSV resource into URL and to CSVReader
  3. Start Triplify with factory Resource
  4. Get data for Item key into Triplify
  5. Load data for each InheritedResource property into Triplify hashmap based on CSV columns
  6. Itemize single item

Specified by:
read in interface ResourceFactory

save

public boolean save()
Updates the resource coeus:built property once the resource finished building.

Specified by:
save in interface ResourceFactory
Returns:
success of the operation