Hi,
I am looking into a solution to automatically load triples into our triples
store. We use jena to convert our data into triples. Our current workflow is
that we dump the triples in a file (e.g. content.ttl) after which this file is
loaded through the isql command line:
"DB.DBA.TTLP_MT (file_to_string_output
('wpContent_v0.0.73237_20140115.ttl'), '', 'http://rdf.wikipathways.org'); “
Loading the file takes minutes, but it still requires some manual steps. I
would very much like to make both the authoring and the subsequent loading in
the triple store a automatic process.
I have tried the following in java:
InputStream in = new FileInputStream(args[1]);
InputStream in = new
FileInputStream("wpContent_v0.0.73237_20140115.ttl");
String url ="jdbc:virtuoso://localhost:4444";
/* STEP 1 */
VirtGraph wpGraph = new VirtGraph
("http://rdf.wikipathways.org/", url, “dba", “<dba-pw>");
wpGraph.clear();
VirtuosoUpdateRequest vur =
VirtuosoUpdateFactory.read(in,wpGraph);
vur.exec();
or loading them triple by triple:
VirtGraph wpGraph = new VirtGraph
("http://rdf.wikipathways.org/", url, “dba", “<dba-pw>");
//wpGraph.getTransactionHandler().begin();
wpGraph.clear();
StmtIterator iter = model.listStatements();
while (iter.hasNext()) {
Statement stmt = iter.nextStatement(); // get
next statement
wpGraph.add(new Triple(stmt.getSubject().asNode(),
stmt.getPredicate().asNode(), stmt.getObject().asNode()));
System.out.println( stmt.getSubject()+" -
"+stmt.getPredicate()+" - "+stmt.getObject());
}
Both of these approached work, they only take hours to proceed.
Can I get the minutes needed for loading through the isql command line in an
automated pipeline process? Can I trigger the DB.DBA.TTLP_MT through java or a
shell script?
Any guidance is much appreciated
Kind regards,
Andra Waagmeester
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users