I posted other questions about this problem...But I think that I'm near the solution. I have this code that works ONLY with the loading of "dbpedia.owl". The problem appears when I add the other ontology "yago.nt"...I have "java.lang.OutOfMemoryError: Java heap space" like error...I tried to modified the Xmx value ( I increased it to 2048m)..But I have no result..I don't know what I have to do...Help me please..If you know how to use TDB , could you post the code applied to my code?
OntModel ont=ModelFactory.createOntologyModel();
InputStream in=FileManager.get().open("dbpedia.owl");
InputStream i =FileManager.get().open("yago.nt");
ont.read(in,"");
Model schemaModel = FileManager.get().loadModel("yago.nt");
ont.add(schemaModel); // <---THE ERROR IS HERE
Reasoner r = ReasonerRegistry.getOWLReasoner();
r=r.bindSchema(ont);
OntModelSpec p= OntModelSpec.OWL_DL_MEM;
p.setReasoner(r);
OntModel model=ModelFactory.createOntologyModel(p,ont);
ExtendedIterator s=model.listClasses();
while (s.hasNext())
{
OntClass thisClass = (OntClass) s.next();
System.out.println("Found class: " + thisClass.toString());
}