1 Reply Latest reply: Feb 22, 2012 12:17 PM by alwu-Oracle RSS

    Incremental inferencing failing after delete

    889820
      I have created entailments using both RDFS and owlprime rulebases with incremental inferencing specified as follows:

      begin
      sem_apis.create_entailment(
      index_name_in => 'emp_test_model_idx',
      models_in => SDO_RDF_Models('emp_test_model'),
      rulebases_in => SDO_RDF_Rulebases('owlprime'),
      options => 'INC=T');
      end;

      I have delete a triple, such as:


      delete FROM emp_rdf_data a WHERE
      a.triple.get_subject()='<Man>';

      commit;


      The delete statement appears to be successful with one row deleted. I perform the following query :


      select x from TABLE(SEM_MATCH('(?x rdf:type <Person>)',sem_models('emp_test_model'),
      sem_rulebases('OWLPRIME'),null,null)) order by 1;

      ERROR at line 1:
      ORA-20000: We do not have a valid rules index for this Model-Rulebase
      combination
      ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 1123
      ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 387
      ORA-06512: at line 1


      Now this is the same outcome I have seen previously when I had omitted "INC=T" from
      initial entailment creation and attempted to perform updates to data without rebuilding the associated indexes.
      Is my expectation, that I should be able to perform insertions to the model and subsequent queries should succeed
      without error and more importantly without a requirement to rebuild the entailments, correct?
      Is there anything I am missing to get this working as expected?

      Please provide more details.


      Thanks
      Arul.S
        • 1. Re: Incremental inferencing failing after delete
          alwu-Oracle
          Hi Arul.S,

          What you experienced is expected.

          Oracle's inference engine will only kick in if you invoke create_entailment API.

          Say you have a graph stored in Oracle, did a create_entailment, the status of the inferred
          graph (entailment) became VALID. Now, if you insert a triple, the status of the inferred
          graph became INCOMPLETE. If you delete a triple, then the status became INVALID.
          You can bring the entailment status back to VALID after another call to create_entailment.

          Incremental inference is an optimization that can efficiently update your inferred graph (entailment)
          when there are additions to your data. If there are updates (deletes), then incremental inference will
          not help performance.

          For your use case, if you want to make your query go through, you can set the INVALID flag.

          select x from TABLE(SEM_MATCH('(?x rdf:type <Person>)',sem_models('emp_test_model'),
          sem_rulebases('OWLPRIME'),null,null, 'INVALID')) order by 1;

          Please refer to Section 1.6.1 of the following dev guide for details.
          http://docs.oracle.com/cd/E11882_01/appdev.112/e11828/sdo_rdf_concepts.htm#CIHHEDAC

          Hope it helps,

          Zhe