I need to convert data from OWLOntology object(part of OWL api) to Model object(part of Jena Api). My Java program should be able to load owl file and send its content to fuseki server. According to what I read, working with fuseki server via Java program is possible only with Jena Api, that's why I use it.
So I found some example of sending ontologies to fuseki server using Jena api, and modified it to this function :
private static void sendOntologyToFuseki(DatasetAccessor accessor, OWLOntology owlModel){
Model model;
/*
..
conversion from OWLOntology to Model
..
*/
if(accessor != null){
accessor.add(model);
}
}
This function should add new ontologies to fuseki server. Any ideas how to fill missing conversion? Or any other ideas, how to send ontologies to fuseki server using OWL api?
I read solution of this : Sparql query doesn't upadate when insert some data through java code
but purpose of my java program is to send these ontologies incrementally, because it's quite big data and if I load them into local memory, my computer does not manage it.
To avoid such kind of dreadful transformation through i/o streams you can use ONT-API: it implements direct reading of the owl-axioms from the graph without any conversion
The idea is to write to a Java
OutputStream
and pipe this into anInputStream
. A possible implementation could look like this:Alternatively, you could simply use
ByteArrayOutputStream
andByteArrayInputStream
instead of piped streams.