I am currently working on a project where there is an initial .owl
file that contains the base schema for our ontology. We load this file using the Jena API and perform different manipulations on it, such as adding ontology classes and individuals.
We seek to migrate the system to a triple store meaning that, instead of reading and writing .owl
files all the time, we wish to load the initial .owl
file once and then perform further operations on a server.
I did not quite grasp the concepts explained by the Jena documentation, because they seem to diverge in all directions; what I understood, however, is that we must use Fuseki embedded and Jena TDB for this. I tried the following code (the OntModel
parameter in this case contains the schema for our ontology):
public Store(OntModel model) {
Dataset ds = DatasetFactory.assemble(model);
File dsDir = new File(ClassLoader.getSystemClassLoader().getResource("ds/")
.getFile());
ds.begin(ReadWrite.WRITE);
server = FusekiServer.create().add(dsDir.getAbsolutePath(), ds).build();
}
This gives me the following error: org.apache.jena.sparql.ARQException: No root found for type <http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset>
. Please provide me with some examples of usage.