This content has been marked as final. Show 5 replies
There is a way. Basically, you can finish OWLPrime inference first. Then you read out all triples (asserted and inferred) and store them into a new model. This new model can serve as a basis for your user-defined rules inference. This step can be done using Jena Adapter.
An assumption has to be made here though. I guess we are assuming that the user-defined rules inference will not trigger new inference for OWLPrime.
yes, actually, I have tried this way:
I created a new model first:
ModelOracleSem dbModelnew = ModelOracleSem.createOracleSemModel( oracle, "newmodel" );
Then I add all the triples and entailments into it:
GraphOracleSem g = dbModelnew.getGraph();
But it is a little bit slow, is there any other faster way?
What is the performance on that one? Are you using the same Oracle connection to do both read and write? If that is the case, you may
want to establish a new Oracle instance and use that for write (dbModelnew). Make sure there is no triple in dbModelnew.
An alternative is to serialize dbModel into an NTRIPLE file. e.g.
OutputStream os = new FileOutputStream("./my.nt");
Once the serialization is done, you can use the usual bulk loading for a file with the addInBulk API.
With this approach, you only need one db connection (Oracle object).
The new model size is 115300. It takes about 23 seconds to finish the storage.
Thank you for your advice. I have tried the both alternatives, the performance is almost the same.
Oracle supports incremental inference which is very nice. But it does not support incremental inference with user-defined rule.
Is there any way that we could re-use the results after (owlprime+user_defined) inference?
Thanks a lot
Your loading speed is around 18M per hour. What kind of I/O do you have? Do you have multiple disks (or SSDs, or SAN)?
If there is no addition to the ontology (TBox or ABox), then existing inferred results will be re-used. If there
is a deletion, then existing inferred results are removed first.
What kind of user defined rules do you have?