I am using Stardog to store a bunch of triples that come from different sources. I use Jena to collect and merge the data in a single Jena graph. All these triples are part of ABoxes.
I am not sure Stardog will require that the TBox is also merged with the ABox graphs. I supposed it does because otherwise I cannot see how Stardog will do reasoning over the data. I have not seen any option to store and use the TBox apart as in some others triple stores. Do I need to include the TBox in the Jena graph or is there a way to store the TBox in another Stardog database so when querying the database of ABoxes it is taken into consideration too?
I am considering options to load the Jena graph (varies between 1 and 7 million triples) into Stardog:
- One of the options I don't really like is to write the graph into a file and execute the client to load it into Stardog. One the data is in a Jena graph, I would prefer a direct solution.
- Another option is to load the triples one by one (example of stardog sparql insert query in java), which I dislike for potential inefficiency.
Is there any elegant way to load the whole graph from Jena?
EDIT
Attempt of code based on the example in the distribution:
Server aServer = Stardog.buildServer()
.bind(new InetSocketAddress("10.0.0.1", 5820))
.start();
AdminConnection aAdminConnection = AdminConnectionConfiguration.toServer("...").credentials("admin", "admin").connect();
if (aAdminConnection.list().contains("test")) {
aAdminConnection.drop("test");
}
Connection aConn = aAdminConnection.memory("test").create(file).connect();
Model aModel = SDJenaFactory.createModel(aConn);
EDIT 2: Corrected some bits of my code.
Additional information in the Stardog documentation