Triplify NCBI databases external reference list [myexperiment:ncbi_xref_namespace2rdf]
Created: 2009-12-01 03:01:28
Last updated: 2009-12-01 03:03:24
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (2)
Triplify NCBI databases external reference list [myexperiment:ncbi_xref_namespace2rdf] |
Triplify NCBI database external reference [myexperiment:ncbi_xref_namespace2rdf] |
Descriptions (5)
Get NCBI external database list from http://www.ncbi.nlm.nih.gov/projects/collab/db_xref.html
TAG: banff_manifesto, ncbi, xref, bio2rdf, rdf |
|
test values:
bmuri = http://bio2rdf.orf/geneid:15275 |
Get NCBI external database list from http://www.ncbi.nlm.nih.gov/projects/collab/db_xref.html |
test values:
bmuri = http://bio2rdf.org/geneid:15275 |
Dependencies (0)
Processors (9)
Name |
Type |
Description |
ncbi_dbxref_url |
stringconstant |
Valuehttp://www.ncbi.nlm.nih.gov/projects/collab/db_xref.html |
html_tr |
stringconstant |
Value
ncbi_build_ntriples |
beanshell |
Scriptimport java.util.regex.*;
String line, id, desc, url, urlPattern, category, example;
line = "";
namespace = "";
Pattern thePat = Pattern.compile("(?m)/db_xref="(.*?):(.*?)"");
Matcher matcher = thePat.matcher(in);
if (matcher.find()) {
id = matcher.group(1);
example = id + ":" + matcher.group(2);
id = id.toLowerCase();
id = id.replace(" ", "");
namespace = id;
line = line + "\n .";
line = line + "\n .";
line = line + "\n \"bm:ns:"+id+"\" .";
line = line + "\n \""+id+"\" .";
line = line + "\n \""+example+"\" .";
}
thePat = Pattern.compile("(?m)^ (.*?)<");
matcher = thePat.matcher(in);
if (matcher.find()) {
desc = matcher.group(1);
line = line + "\n \""+desc+" [bm:ns:"+id+"]\" .";
line = line + "\n \""+desc+"\" .";
}
thePat = Pattern.compile("(?m)^ \""+url+"\" .";
}
ntriples = line; |
| |
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();
|
Split_string_into_string_list_by_regular_expression |
localworker |
ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = ",";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
|
Get_Web_Page_from_URL |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
NCBI_ntriples |
beanshell |
ScriptString id = "ncbi";
String title = "National Center for Biotechnology Information";
ntriples = "\n .";
ntriples = ntriples + "\n \"bm:ns:"+id+"\" .";
ntriples = ntriples + "\n \"" + title + " [bm:ns:"+id+"]\" .";
ntriples = ntriples + "\n \"" + title + "\" .";
ntriples = ntriples + "\n \""+id+"\" .";
ntriples = ntriples + "\n";
|
Concatenate_two_strings |
localworker |
Scriptoutput = string1 + string2; |
Remove_String_Duplicates |
localworker |
ScriptList strippedlist = new ArrayList();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
if (strippedlist.contains(item) == false) {
strippedlist.add(item);
}
}
|
|
Beanshells (2)
Name |
Description |
Inputs |
Outputs |
ncbi_build_ntriples |
|
in
|
namespace
ntriples
|
NCBI_ntriples |
|
|
ntriples
|
Outputs (3)
Name |
Description |
ncbi_xref_namespace_ntriples |
|
url |
|
namespace_list |
|
Datalinks (11)
Source |
Sink |
Split_string_into_string_list_by_regular_expression:split |
ncbi_build_ntriples:in |
ncbi_build_ntriples:ntriples |
Merge_String_List_to_a_String:stringlist |
html_tr:value |
Split_string_into_string_list_by_regular_expression:regex |
Get_Web_Page_from_URL:contents |
Split_string_into_string_list_by_regular_expression:string |
ncbi_dbxref_url:value |
Get_Web_Page_from_URL:url |
NCBI_ntriples:ntriples |
Concatenate_two_strings:string1 |
Merge_String_List_to_a_String:concatenated |
Concatenate_two_strings:string2 |
ncbi_build_ntriples:namespace |
Remove_String_Duplicates:stringlist |
Concatenate_two_strings:output |
ncbi_xref_namespace_ntriples |
ncbi_dbxref_url:value |
url |
Remove_String_Duplicates:strippedlist |
namespace_list |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
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