3 Replies Latest reply on Oct 26, 2016 10:16 PM by alwu-Oracle

    Semantic Indexes Syncronization

    3274437

      Dear all,

       

      I have bunch of indexes that I would like to update only after I insert all my data.

       

      The first index that I have is the full text search. According to this guide if I create and index with sync type manual, I have to perform a SYNC_INDEX statement in order to query using contains. However, performing tests with RDF and full text index does not seem to work this way.

       

      I created an index with MDSYS user like this:

      CREATE INDEX MDSYS.RDF_V$TEXT_IDX ON MDSYS.RDF_VALUE$(VNAME_PREFIX) indextype is ctxsys.context parameters ('lexer rdf_lexer sync (manual)');
      

       

      Then with the semantic model user I created an rdf model:

      EXECUTE SEM_APIS.CREATE_SEM_MODEL('TEST_MAT', 'RDF_DATA', 'TRIPLE');
      

       

      And insert one line:

       INSERT INTO RDF_DATA (TRIPLE) VALUES (SDO_RDF_TRIPLE_S('TEST_MAT', '<http://ex/r1>','<http://ex/p1>', '"Test"'));
      

       

      And right after I query the model with contains:

      SELECT * FROM TABLE(SEM_MATCH( 
      'SELECT * WHERE {?s ?p ?o . FILTER (orardf:textContains(?o, "Test", 1)) }',
      SEM_MODELS('TEST_MAT'),NULL,NULL,NULL));
      

       

      This query returns the triple that I just added, however I was expecting to return anything because I didn't executed the SYNC_INDEX statement.

       

      Question 1: How can I avoid the update of text search index while inserting data?

       

      Furthermore, I also have semantic indexes like PSCM, CPSM and SCPM. With the semantic model user I can execute the following statement:

       

      execute SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TEST_MAT', 'PSCM', 'UNUSABLE'); 
      execute SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TEST_MAT', 'CPSM', 'UNUSABLE');
      execute SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TEST_MAT', 'SCPM', 'UNUSABLE'); 
      

       

      Question 2: Is state UNUSABLE enough to prevent the update of semantic indexes while inserting data?

       

      Finally, I also have datatype indexes like:

       

      CREATE INDEX MDSYS.V$NUMERICIDX ON MDSYS.RDF_VALUE$(
       SEM_APIS.getV$NumericVal(VALUE_TYPE, VNAME_PREFIX, VNAME_SUFFIX, LITERAL_TYPE, LANGUAGE_TYPE));
      

       

      Question 3: Is there a minimum privilege to call sem_apis.alter_datatype_index so I can rebuilt datatype indexes with the semantic model user?

       

      Thanks in advance,

      Elisa.