1 Reply Latest reply on Oct 27, 2016 3:53 PM by alwu-Oracle

    OWL Inferencing

    3274437

      Dear all,

       

      I'm trying to generate inferred triples using user-defined rules as explained in this example here.

       

      However when I execute the following step:

      EXECUTE sem_apis.create_entailment('owltst2_idx', sem_models('owltst'),
        sem_rulebases('OWLPRIME','USER_RULEBASE'), 
        SEM_APIS.REACH_CLOSURE, null, 'USER_RULES=T');
      

       

      It raises the following error:

      ORA-13199: Failed in DDL_same_rdf_indexes call:ORA-13199: Failed in index addition call:ORA-00955: name is already being used by existing object code=PCSM dss=
            CREATE INDEX "RDF_IDX_PCSM_1207"
              ON "RDF#1207#1" 
              (P_VALUE_ID,CANON_END_NODE_ID,START_NODE_ID,MODEL_ID) COMPRESS 2 PARALLEL 1  NOLOGGING   tablespace "RDF_USERS" ORA-06512: em "MDSYS.SDO_RDF_INTERNAL", line 18090ORA-06512: em "MDSYS.MD", line 1723
      ORA-06512: em "MDSYS.MDERR", line 17
      ORA-06512: em "MDSYS.SDO_RDF_INTERNAL", line 18094
      ORA-06512: em "MDSYS.SDO_RDF_INTERNAL", line 19620
      ORA-06512: em "MDSYS.SDO_SEM_INF_INTERNAL", line 16453
      ORA-06512: em "MDSYS.SDO_SEM_INFERENCE", line 302
      ORA-06512: em "MDSYS.SDO_SEM_INFERENCE", line 352
      ORA-06512: em "MDSYS.RDF_APIS", line 126
      ORA-06512: em line 1
      13199. 00000 -  "%s"
      *Cause:    This is an internal error.
      *Action:   Contact Oracle Support Services.
      

       

      I saw that this PCSM is created by default when a model is created...

       

      Additionally, I saw that I would have to execute the following query to also access the inferred triples:

      SELECT s,p,o FROM table(SEM_MATCH('(?s ?p ?o)', SEM_MODELS('OWLTST'),
        SEM_RULEBASES('OWLPRIME','USER_RULEBASE'), null, null ));
      

       

      So, I'm guessing the inferred triples are not materialized into the model? Is there a way to do that?

       

      Or It would be better to simply execute the following query to materialize the uncle property into model OWLTST?

      INSERT INTO owltst (TRIPLE)     
      SELECT SDO_RDF_TRIPLE_S('owltst', subj$rdfterm, pred$rdfterm,obj$rdfterm)
      FROM TABLE(SEM_MATCH( 
      ' CONSTRUCT { ?x <http://example.com/rel/uncleOf> ?z } 
        WHERE { ?x <http://example.com/rel/brotherOf> ?y . ?y <http://example.com/rel/fatherOf> ?z }',
      SEM_MODELS('owltst'),NULL,NULL,NULL));
      

       

      Thanks in advance,

      Elisa.

        • 1. Re: OWL Inferencing
          alwu-Oracle

          Hi Elisa,

           

          This is very strange. The forward-chaining process generates a temporary working table to hold newly discovered relationships and tries to create indices on that table. Somehow, the table already has the indices.

           

          Can you please drop the entailment (with sem_apis.drop_entailment API) and re-try?

           

          And Oracle's inference engine puts inferred triples in a separate partition (from the original RDF model). This provides a clean separation.

           

          Thanks,


          Zhe Wu