Triplify UniProt database external reference [myexperiment:uniprot_xref_namespace2rdf]
Created: 2009-12-01 04:08:08
Last updated: 2009-12-01 04:09:39
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Triplify UniProt database external reference [myexperiment:uniprot_xref_namespace2rdf] |
Descriptions (6)
Get UniProt external database list from http://www.ncbi.nlm.nih.gov/projects/collab/db_xref.html
TAG: banff_manifesto, ncbi, xref, bio2rdf, rdf
http://www.uniprot.org/docs/dbxref.txt |
http://www.uniprot.org/docs/dbxref.txt |
test values:
bmuri = http://bio2rdf.orf/geneid:15275 |
Get UniProt external database list from http://www.uniprot.org/docs/dbxref.txt
TAG: banff_manifesto, uniprot, xref, bio2rdf, rdf
|
|
test values:
bmuri = http://bio2rdf.org/geneid:15275 |
Dependencies (0)
Processors (8)
Name |
Type |
Description |
uniprot_dbxref_url |
stringconstant |
Valuehttp://www.uniprot.org/docs/dbxref.txt |
AC_begin |
stringconstant |
ValueAC : DB- |
uniprot_build_ntriples |
beanshell |
Scriptimport java.util.regex.*;
String line, id, desc, url, urlPattern, category;
line = "";
namespace = "";
Pattern thePat = Pattern.compile("(?m)^Abbrev: (.*)$");
Matcher matcher = thePat.matcher(in);
if (matcher.find()) {
id = matcher.group(1);
id = id.toLowerCase();
namespace = id;
line = line + "\n .";
line = line + "\n .";
line = line + "\n \"bm:ns:"+id+"\" .";
line = line + "\n \""+id+"\" .";
}
thePat = Pattern.compile("(?m)^Name : (.*)$");
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)^Server: (.*)$");
matcher = thePat.matcher(in);
if (matcher.find()) {
url = matcher.group(1);
line = line + "\n \""+url+"\" .";
}
thePat = Pattern.compile("(?m)^Db_URL: (.*)$");
matcher = thePat.matcher(in);
if (matcher.find()) {
urlPattern = matcher.group(1);
line = line + "\n \"http://"+urlPattern+"\" .";
}
thePat = Pattern.compile("(?m)^Cat : (.*)$");
matcher = thePat.matcher(in);
if (matcher.find()) {
category = matcher.group(1);
line = line + "\n .";
}
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();
|
UniProt_ntriples |
beanshell |
ScriptString id = "uniprot";
String title = "Universal Protein Resource";
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; |
Beanshells (2)
Name |
Description |
Inputs |
Outputs |
uniprot_build_ntriples |
|
in
|
namespace
ntriples
|
UniProt_ntriples |
|
|
ntriples
|
Outputs (3)
Name |
Description |
uniprot_xref_namespace_ntriples |
|
namespace_list |
|
url |
|
Datalinks (10)
Source |
Sink |
Split_string_into_string_list_by_regular_expression:split |
uniprot_build_ntriples:in |
Concatenate_two_strings:output |
Merge_String_List_to_a_String:stringlist |
AC_begin: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 |
uniprot_dbxref_url:value |
Get_Web_Page_from_URL:url |
UniProt_ntriples:ntriples |
Concatenate_two_strings:string1 |
uniprot_build_ntriples:ntriples |
Concatenate_two_strings:string2 |
Merge_String_List_to_a_String:concatenated |
uniprot_xref_namespace_ntriples |
uniprot_build_ntriples:namespace |
namespace_list |
uniprot_dbxref_url:value |
url |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1 (earliest)
(of 2)
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