5 Replies Latest reply on Sep 9, 2009 1:47 PM by alwu-Oracle

    how exactly does graph.performInference() work?

    696067
      So as far as I understand, if a rules index does not exist, calling this function will call a SEM_APIS.CREATE_ENTAILMENT using whatever info it gets from the attachment. I noticed however that when the rulebase specified by the attachment already exists (e.g. it is created manually via SEM_APIS.CREATE_ENTAILMENT in SQLPLUS) the the function will still run. What does it do in the latter case? Does it update the rules index like graph.commitTransaction() or does it do nothing?

      -Alexi
        • 1. Re: how exactly does graph.performInference() work?
          alwu-Oracle
          Hi,

          A call to performInference() invokes create_entailment behind the scene. If the entailment status is COMPLETE, then nothing will happen. If the entailment status is INCOMPLETE, then create_entailment will finish building an inference closure. If the entailment status is INVALID, then create_entailment will start from scratch building a closure.

          So the action of performInference depends on the entailment status. From what you've described, (assume you haven't inserted new triples after the SEM_APIS.CREATE_ENTAILMENT in SQL*PLUS), then nothing will happen.

          Hope it helps,

          Zhe Wu
          1 person found this helpful
          • 2. Re: how exactly does graph.performInference() work?
            696067
            Ok, got it. Thanks.

            -Alexi
            • 3. Re: how exactly does graph.performInference() work?
              696067
              Two followup questions then.
              1) If you make a change to OracleSemModel that causes the Model's status to become Incomplete (i.e. add or remove a statement and then call model.commit()), do the commands graph.performInference() and graph.commitTransaction() do the same thing?

              2) Is there a way to do something like graph.performInference() via the SEM_APIS? Or do I have to call SEM_APIS.CREATE_ENTILMENT every time I add/delete a triple from the model?

              Edited by: alexi on Sep 8, 2009 8:46 PM - Added second question
              • 4. Re: how exactly does graph.performInference() work?
                696067
                Two followup questions then.
                1) If you make a change to OracleSemModel that causes the Model's status to become Incomplete (i.e. add or remove a statement and then call model.commit()), do the commands graph.performInference() and graph.commitTransaction() do the same thing (given that you specify InferenceMaintenanceMode.UPDATE_WHEN_COMMIT in the Attachment creation)?

                2) Is there a way to do something like graph.performInference() via the SEM_APIS? Or do I have to call SEM_APIS.CREATE_ENTILMENT every time I add/delete a triple from the model?
                • 5. Re: how exactly does graph.performInference() work?
                  alwu-Oracle
                  Hi,

                  Answer to 1) is yes.

                  For your second question, "Is there a way to do something like graph.performInference() via the SEM_APIS? Or do I have to call SEM_APIS.CREATE_ENTILMENT every time I add/delete a triple from the model?"

                  SEM_APIS.create_entailment is the API you want to call from SQL to run inference. Whether you need to call that API every time you add/delete a triple
                  is application dependent. You may want to run create_entailment periodically. Note that, Oracle Database release 11.2 has a cool feature called incremental inference maintenance. It can efficiently update the inference closure after a few triples are added. Please see the user manual for details.

                  Hope it helps,

                  Zhe Wu