Reputation: 2068
Using Jena API I created an OntModel
and printed it as a file. Now I would like to load it into Virtuoso.
I successfully done it using Virtuoso Conductor web manager but I would like to do the same directly using java API, for instance loading from the generated file or directly from the created OntModel
. Is this possible? I have not found anything about it.
Upvotes: 0
Views: 366
Reputation: 166
You can do it via the Dataset interface. For that you need to add the Jena Provider and Virtuoso JDBC Driver libraries to your project first. Then you can connect to your Virtuoso instance and add the model:
VirtDataset ds = new VirtDataset("localhost:1111", "dba", "dba");
ds.addNamedModel("http://example.com", model);
You could also use the Graph Store Protocol with DatasetAccessor / DatasetAccessorFactory, the RDFConnection interface or the SPARQL endpoint directly by using UpdateRequest / UpdateFactory.
Upvotes: 1