Data Refinement Workflow v17
Created: 2012-04-11 10:08:25
Last updated: 2014-12-17 12:51:15
This workflow brings together various sub-workflows in one integrated workflow. This includes,
- Synonym Expansion / Occurrence Retrieval
- BioSTIFF Data Selection Tool
- Google Refine Data Quality
Installation instructions for this workflow can be found here
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (2)
json-simple-1.1.1.jar |
DCWorkflow.jar |
Processors (9)
Name |
Type |
Description |
Select_File |
localworker |
Scriptimport java.awt.CardLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
class FileExtFilter extends FileFilter {
public FileExtFilter(String ext, String label, boolean includeDir) {
this.ext = ext;
this.label = label;
this.includeDir = includeDir;
}
public String getDescription() {
return this.label;
}
public boolean accept(File file) {
if (file.isDirectory() && includeDir) {
return true;
} else {
return file.getName().endsWith(this.ext);
}
}
String ext, label;
boolean includeDir;
}
if (title == void) {
title = null;
}
if ((fileExtensions == void) || (fileExtensions == null)) {
fileExtensions = "";
}
if ((fileExtLabels == void) || (fileExtLabels == null)) {
fileExtLabels = "";
}
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle(title);
String[] fileTypeList = fileExtensions.split(",");
String[] filterLabelList = fileExtLabels.split(",");
if (fileTypeList != null && filterLabelList != null && fileTypeList.length != filterLabelList.length) {
throw new RuntimeException("The list of extensions and file filter labels must be the same length");
}
// create the file filters
for (int i = 0; i < fileTypeList.length; i++) {
FileExtFilter filter = new FileExtFilter(fileTypeList[i], filterLabelList[i], true);
chooser.setFileFilter(filter);
}
chooser.showOpenDialog(null);
File file = chooser.getSelectedFile();
selectedFile = file.getAbsolutePath();
|
title_value |
stringconstant |
ValueChoose input file |
Read_Text_File |
localworker |
ScriptBufferedReader getReader (String fileUrl, String encoding) throws IOException {
InputStreamReader reader;
try {
if (encoding == null) {
reader = new FileReader(fileUrl);
} else {
reader = new InputStreamReader(new FileInputStream(fileUrl),encoding);
}
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
if (encoding == null) {
reader = new InputStreamReader (url.openStream());
} else {
reader = new InputStreamReader (url.openStream(), encoding);
}
}
return new BufferedReader(reader);
}
StringBuffer sb = new StringBuffer(4000);
if (encoding == void) {
encoding = null;
}
BufferedReader in = getReader(fileurl, encoding);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Data_Cleaning_Worklow_Loop |
workflow |
|
Merge_String_List_to_a_String |
localworker |
ScriptString seperatorString = "\n";
if (seperator != void) {
seperatorString = seperator;
}
StringBuffer sb = new StringBuffer();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
sb.append(item);
if (i.hasNext()) {
sb.append(seperatorString);
}
}
concatenated = sb.toString();
|
no_separator |
stringconstant |
Value |
Write_Text_File |
localworker |
ScriptwriteOK = "false";
BufferedWriter out;
if (encoding == void) {
out = new BufferedWriter(new FileWriter(outputFile));
}
else {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
}
out.write(filecontents);
out.flush();
out.close();
writeOK = "true";
|
Select_Output_CSV_File |
localworker |
Scriptimport java.awt.CardLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
class FileExtFilter extends FileFilter {
public FileExtFilter(String ext, String label, boolean includeDir) {
this.ext = ext;
this.label = label;
this.includeDir = includeDir;
}
public String getDescription() {
return this.label;
}
public boolean accept(File file) {
if (file.isDirectory() && includeDir) {
return true;
} else {
return file.getName().endsWith(this.ext);
}
}
String ext, label;
boolean includeDir;
}
if (title == void) {
title = null;
}
if ((fileExtensions == void) || (fileExtensions == null)) {
fileExtensions = "";
}
if ((fileExtLabels == void) || (fileExtLabels == null)) {
fileExtLabels = "";
}
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle(title);
String[] fileTypeList = fileExtensions.split(",");
String[] filterLabelList = fileExtLabels.split(",");
if (fileTypeList != null && filterLabelList != null && fileTypeList.length != filterLabelList.length) {
throw new RuntimeException("The list of extensions and file filter labels must be the same length");
}
// create the file filters
for (int i = 0; i < fileTypeList.length; i++) {
FileExtFilter filter = new FileExtFilter(fileTypeList[i], filterLabelList[i], true);
chooser.setFileFilter(filter);
}
chooser.showOpenDialog(null);
File file = chooser.getSelectedFile();
selectedFile = file.getAbsolutePath();
|
output_filechooser_title |
stringconstant |
ValueChoose Output CSV File |
Beanshells (23)
Name |
Description |
Inputs |
Outputs |
NameStatusConditional |
|
nameStatus
|
synpass_flags
synfail_flags
|
CreateID |
|
name
|
id_param
|
FirstElement_From_XPath |
|
xpath
xmltext
|
nodeVal
|
slw_filter_generator |
|
sciName
|
filter
|
Parse_Data_Upload |
|
jsonStr
|
jsonErr
upload_ok
|
passthrough |
|
csvin
|
csvout
|
Parse_Project |
|
jsonStr
|
jsonErr
projectID
percent
|
GBIF_Agreement_Conditional |
|
copyright_answer
synReqIn
|
synReqOut
|
OccTargetConditional |
|
sciNameList
|
emptyOutputList
gbifList
slwList
|
GBIF_Agreement_Conditional |
|
agreement_answer
sciNameIn
|
sciNameOut
|
trimRESTurlResult |
|
url
|
resultUrl
|
checkDataUpload |
|
status
|
dataUpload_ok
dataUpload_failed
uploadStatus
|
AssignInputOutput |
|
in
|
out
|
SynCheckGUI |
|
synreqres_list
|
out
|
DCDataParser |
|
csvData
|
synonymRequest
incorrectRecords
|
FirstElement_From_XPath |
|
xpath
xmltext
|
nodeVal
|
DC_Choose_Sub_Flow |
|
internalCSVData
|
synExpOccRetCSVData
dataSelCSVData
dataQualCSVData
endWFlowCSVData
endWFlow
csvData
|
Parse_Job |
|
jsonStr
|
jsonErr
jobID
|
Format_Options |
|
jobID
|
options
|
Delete_Data_Options |
|
projectID
|
options
|
Export_Data_Conditional |
|
gref_answer
|
save_true
cancel_true
|
End_Workflow |
|
csvData
|
csv_output
|
Export_Data_Options |
|
projectID
|
options
|
Outputs (3)
Name |
Description |
endWFlow |
|
csv_output |
|
file_write_ok |
|
Datalinks (11)
Source |
Sink |
title_value:value |
Select_File:title |
Select_File:selectedFile |
Read_Text_File:fileurl |
Read_Text_File:filecontents |
Data_Cleaning_Worklow_Loop:internalCSVData |
no_separator:value |
Merge_String_List_to_a_String:seperator |
Data_Cleaning_Worklow_Loop:internalCSVData |
Merge_String_List_to_a_String:stringlist |
Select_Output_CSV_File:selectedFile |
Write_Text_File:outputFile |
Merge_String_List_to_a_String:concatenated |
Write_Text_File:filecontents |
output_filechooser_title:value |
Select_Output_CSV_File:title |
Data_Cleaning_Worklow_Loop:endWFlow |
endWFlow |
Merge_String_List_to_a_String:concatenated |
csv_output |
Write_Text_File:writeOK |
file_write_ok |
Coordinations (1)
Controller |
Target |
Merge_String_List_to_a_String |
Select_Output_CSV_File |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1 (earliest)
(of 17)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (2)
Featured In Packs (1)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (1)
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment