2 Replies Latest reply on Dec 22, 2014 7:44 AM by shifu.zheng

    Why I can't create index on RDF data table

    shifu.zheng

      When I was trying to create index on RDF data table, it always say table or view does not exist. I created the RDF model using java codes:

              Oracle oracle = new Oracle("jdbc:oracle:thin:@localhost:1521:orcl", "system", "123");

              GraphOracleSem graph = new GraphOracleSem(oracle, "test2");


      And used the following commands in sqlplus to create index:

       

      SQL>

      SELECT DISTINCT OWNER, OBJECT_NAME

        FROM DBA_OBJECTS

      WHERE OBJECT_TYPE = 'TABLE'

        4  AND OBJECT_NAME like '%TEST2%';

       

       

      OWNER

      --------------------------------------------------------------------------------

      OBJECT_NAME

      --------------------------------------------------------------------------------

      SYSTEM

      TEST2_NS

       

      SYSTEM

      RDFB_TEST2

       

      SYSTEM

      TEST2_TPL

       

       

      OWNER

      --------------------------------------------------------------------------------

      OBJECT_NAME

      --------------------------------------------------------------------------------

      SYSTEM

      RDFC_TEST2

       


      SQL> connect system as sysdba

      Enter password:

      Connected.

      SQL>

      SQL>

      SQL> select * from TEST2_TPL;

      select * from TEST2_TPL

                    *

      ERROR at line 1:

      ORA-00942: table or view does not exist

       

      SQL> CREATE INDEX test2_sub_idx ON TEST2_TPL (triple.GET_SUBJECT());

      CREATE INDEX test2_sub_idx ON TEST2_TPL (triple.GET_SUBJECT())

                                    *

      ERROR at line 1:

      ORA-00942: table or view does not exist

        • 1. Re: Why I can't create index on RDF data table
          alwu-Oracle

          Hi Shifu,

           

          It is not recommended to use SYS or SYSTEM schema to store/manage RDF graph data.

          Can you please try the following from a SQL*Plus terminal?

           

          SQL> conn system/welcome1

          Connected.

          SQL>

          SQL>

          SQL> create user graphuser identified by graphuser;

           

          User created.

           

          SQL> grant connect, resource, unlimited tablespace to graphuser;

           

          Grant succeeded.

           

          SQL> conn graphuser/graphuser

          Connected.

          SQL> create table graph_tpl (triple sdo_rdf_triple_s) compress;

           

          Table created.

           

          SQL> exec sem_apis.create_sem_model('graph', 'graph_tpl', 'triple');

           

          PL/SQL procedure successfully completed.

           

          SQL> insert into graph_tpl values(sdo_rdf_triple_s('graph','<urn:s>','<urn:p>','<urn:o>'));

           

          1 row created.

           

          SQL> select count(1) from mdsys.rdfm_graph;

           

               1

           

          Can you see the same output?

           

          Thanks,


          Zhe Wu

          • 2. Re: Why I can't create index on RDF data table
            shifu.zheng

            Hi alwu,

             

            Yes, I can see the same output after inputting your sql commands. So, I loaded my data again using the user, and I can create

             

            Thank you very much for your help!

             

            Regards,

            Shifu Zheng