Sesame triplestore loader from a dereferenced URI
Created: 2009-02-19 05:02:34
Last updated: 2009-02-19 05:03:08
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Bio2RDF: Load Sesame triplestore with triples obtained from a dereferenced URI in N3 format. |
Descriptions (0)
Dependencies (0)
Inputs (3)
Name |
Description |
url |
|
repository |
|
ntriples_or_rdfxml |
|
Processors (8)
Name |
Type |
Description |
Sesame_upload_url |
beanshell |
Scriptimport java.net.*;
import java.io.*;
String data = "--";
data += "---------------------------20037128598723\r\n";
data += "Content-Disposition: form-data; name=\"url\"\r\n";
data += "\r\n";
data += url + "\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/uploadURL";
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 |
url_for_test |
stringconstant |
Valuehttp://localhost/murin/murin-results2n3.jsp?id=2&level=6 |
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 url: " + string2; |
ntriples_for_test |
stringconstant |
Valuentriples |
Echo_List |
localworker |
Scriptoutputlist = inputlist; |
Beanshells (4)
Name |
Description |
Inputs |
Outputs |
Sesame_upload_url |
|
url
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 (9)
Source |
Sink |
Echo_List:outputlist |
Sesame_upload_url:url |
ntriples_or_rdfxml |
Sesame_upload_url:input_format |
repository |
Sesame_upload_url:repository |
Sesame_upload_url: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 |
Echo_List:outputlist |
Concatenate_two_strings:string2 |
url |
Echo_List:inputlist |
Concatenate_two_strings:output |
number_of_uploaded_triples |
Uploader
License
All versions of this Workflow are
licensed under:
Version 2 (latest)
(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