3 Replies Latest reply on Oct 13, 2008 2:42 AM by alwu-Oracle

    can not create more than one model on one table

    663466
      My table and tablespace, and semnetwork have been created successfully, with following SQL:
      CREATE TABLESPACE MYONTOLOGY_TBS
      DATAFILE 'C:\Oracle\oradata\odb1\myontology_tbs.dat' SIZE 1024M REUSE
      AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED
      SEGMENT SPACE MANAGEMENT AUTO;

      EXECUTE SEM_APIS.CREATE_SEM_NETWORK('MYONTOLOGY_TBS');

      CREATE TABLE MYASSERTIONS
      (
      ID NUMBER NOT NULL,
      ASSERTION MDSYS.SDO_RDF_TRIPLE_S NOT NULL
      )
      TABLESPACE "MYONTOLOGY_TBS";


      Then, I tried to create two models on that table, as following:

      EXECUTE sem_apis.create_sem_model('amodel', 'MYASSERTIONS', 'ASSERTION');
      EXECUTE sem_apis.create_sem_model('bmodel', 'MYASSERTIONS', 'ASSERTION');

      The result was:
      anonymous block completed
      anonymous block completed

      Error starting at line 2 in command:
      EXECUTE sem_apis.create_sem_model('bmodel', 'MYASSERTIONS', 'ASSERTION');
      Error report:
      ORA-13199: Internal error in SDO_RDF.CREATE_RDF_MODEL: SQLERRM=ORA-55300: model bmodel does not exist dss=
      SELECT count("ASSERTION") FROM "MYASSERTIONS"
      ORA-06512: at "MDSYS.MD", line 1723
      ORA-06512: at "MDSYS.MDERR", line 17
      ORA-06512: at "MDSYS.SDO_RDF", line 937
      ORA-06512: at "MDSYS.SDO_RDF", line 972
      ORA-06512: at "MDSYS.RDF_APIS", line 726
      ORA-06512: at line 1
      13199. 00000 - "%s"
      *Cause:    This is an internal error.
      *Action:   Contact Oracle Support Services.


      It seems that more than one model can not coexist on one single table, is that right? And is it means that, if I wanna manage a large number of models, I must create and manage the same large number of table? On my case, I have hundreds of models to handle and thousands of predicates in each on average, I don't think managing hundreds of tables is a good approach, is there another way?
        • 1. Re: can not create more than one model on one table
          alwu-Oracle
          Please don't associate more than 1 model with an application table. We recommend a 1-1 mapping.

          Technically, if there is a need to separate your RDF/OWL data into hundreds of distinct models, then
          you will have to manage corresponding application tables.

          Do you have large amount of data in each model? You mentioned thousands of predicates.
          • 2. Re: can not create more than one model on one table
            663466
            Oracle may think manage metadata of their database is a simple and interesting task, but I don't think so. I believe that manage database metadata should only be oracle's duty, I would never involve even one single line of DDL in my software. So if I can not store multiple model in a single table, or at least a certain number of tables, I have to discard oracle's solution, and build one of myself.
            • 3. Re: can not create more than one model on one table
              alwu-Oracle
              If you don't want any DDL in your code, then you may want to look into Jena Adaptor. With Jena Adaptor, you are dealing with
              simple Java objects, there is no need to invoke create table, create_sem_model, etc.

              Let me know if Jena Adaptor suits your application needs.

              Cheers,

              Zhe Wu (Aka. Alan Wu)