5 Replies Latest reply on Jul 6, 2010 1:43 PM by alwu-Oracle

    how to seperate owl inference and user

    782382
      1. Is there a way to seperate inference with "owlprime" and user_defined rulebase?

      for example: Inference(M1+user_defined rules) against the results from(M1+"owlprime")


      2. Can I transfer entailment into model or combine the entailed results with the original model?


      Cause we need to change rules in the user_defined rulebase frequently, and we do not wanna do owlprime inference everytime.

      Thanks!


      Hui
        • 1. Re: how to seperate owl inference and user
          alwu-Oracle
          Hi,

          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.

          Thanks,

          Zhe Wu
          • 2. Re: how to seperate owl inference and user
            782382
            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();
            g.getBulkUpdateHandler().addInBulk(
            GraphUtil.findAll(dbModel.getGraph()), "SYSAUX");

            But it is a little bit slow, is there any other faster way?

            Thanks

            Hui
            • 3. Re: how to seperate owl inference and user
              alwu-Oracle
              Hi,

              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");
              dbModel.write(os, "N-TRIPLE");

              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).

              Cheers,

              Zhe Wu
              • 4. Re: how to seperate owl inference and user
                782382
                Hi

                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

                Hui
                • 5. Re: how to seperate owl inference and user
                  alwu-Oracle
                  Hi,

                  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?

                  Thanks,

                  Zhe Wu