Bio2RDF: Sesame triplestore loader from triples
Created: 2009-02-19 07:00:03
Last updated: 2009-02-19 07:25:39
No description has been set
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Bio2RDF: Load Sesame triplestore with triples in N3 format. |
Descriptions (0)
Dependencies (0)
Inputs (3)
Name |
Description |
triples |
|
repository |
|
bmuri |
|
Processors (8)
Name |
Type |
Description |
Sesame_upload_triples |
beanshell |
Scriptimport java.net.*;
import java.io.*;
String data = "--";
data += "---------------------------20037128598723\r\n";
data += "Content-Disposition: form-data; name=\"data\"\r\n";
data += "\r\n";
data += triples + "\r\n";
data += "--";
data += "---------------------------20037128598723\r\n";
data += "Content-Disposition: form-data; name=\"repository\"\r\n";
data += "\r\n";
data += repository + "\r\n";
data += "--";
data += "---------------------------20037128598723\r\n";
data += "Content-Disposition: form-data; name=\"dataFormat\"\r\n";
data += "\r\n";
data += input_format + "\r\n";
data += "--";
data += "---------------------------20037128598723";
data += "--";
System.out.println(data.length());
System.out.println(data);
// Create a socket to the host
String hostname = "localhost";
int port = 80;
InetAddress addr = InetAddress.getByName(hostname);
Socket socket = new Socket(addr, port);
// Send header
String path = "/sesame/servlets/uploadData";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF8"));
wr.write("POST "+path+" HTTP/1.0\r\n");
wr.write("Content-Type: multipart/form-data; boundary=---------------------------20037128598723\r\n");
wr.write("Content-Length:"+data.length()+"\r\n");
wr.write("\r\n");
wr.write(data);
wr.flush();
// Get response
BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
StringBuffer buf = new StringBuffer();
String line;
while ((line = rd.readLine()) != null) {
buf.append(line);
}
wr.close();
rd.close();
html = buf.toString();
|
repository_for_test |
stringconstant |
Valuemem-rdf-db |
ntriples |
stringconstant |
Valuentriples |
Split_string_into_string_list |
beanshell |
ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = "<";
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
|
Filter_list_of_strings_extracting_msg |
beanshell |
Scriptimport java.util.regex.*;
filteredlist = new ArrayList();
Pattern thePat = Pattern.compile("msg>Processed(.*)");
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
filteredlist.add(matcher.group(1));
}
}
|
Concatenate_two_strings |
beanshell |
Scriptoutput = string1 + " from bmuri: " + string2; |
triples_for_test |
stringconstant |
Value . . . . . . . . . . |
bmuri_for_test |
stringconstant |
Valuebm:uri:bind:322398 |
Beanshells (4)
Name |
Description |
Inputs |
Outputs |
Sesame_upload_triples |
|
triples
repository
input_format
|
html
|
Split_string_into_string_list |
|
string
|
split
|
Filter_list_of_strings_extracting_msg |
|
stringlist
|
filteredlist
|
Concatenate_two_strings |
|
string1
string2
|
output
|
Outputs (1)
Name |
Description |
number_of_uploaded_triples |
|
Datalinks (8)
Source |
Sink |
ntriples:value |
Sesame_upload_triples:input_format |
triples |
Sesame_upload_triples:triples |
repository |
Sesame_upload_triples:repository |
Sesame_upload_triples:html |
Split_string_into_string_list:string |
Split_string_into_string_list:split |
Filter_list_of_strings_extracting_msg:stringlist |
Filter_list_of_strings_extracting_msg:filteredlist |
Concatenate_two_strings:string1 |
bmuri |
Concatenate_two_strings:string2 |
Concatenate_two_strings:output |
number_of_uploaded_triples |
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