3 Replies Latest reply on Oct 19, 2006 3:10 PM by Mannamal-Oracle

    SQL*Loader error 350 using SDO_RDF_TRIPLE_S constructor

    437959
      Greetings,
      10g2 on Windows XP
      tablespace and RDF network created successfully
      model and table created successfully

      but sqlldr throws error

      SQL> create table mt_1(id number, triple SDO_RDF_TRIPLE_S);

      Table created.

      SQL> EXECUTE SDO_RDF.CREATE_RDF_MODEL('test_model', 'mt_1', 'triple');

      PL/SQL procedure successfully completed

      LOAD DATA
      INFILE 'mt_data.txt' BADFILE 'mt_data.bad'
      APPEND
      INTO TABLE mt_1
      (
      id SEQUENCE(MAX,1),
      triple COLUMN OBJECT
      (
      SDO_RDF_TRIPLE_S
      (
      'test_model',
      CHAR TERMINATED BY WHITESPACE,
      CHAR TERMINATED BY WHITESPACE,
      CHAR TERMINATED BY '.'
      )
      )
      )


      SQL*Loader: Release 10.2.0.1.0 - Production on Thu Oct 12 09:26:17 2006

      Copyright (c) 1982, 2005, Oracle. All rights reserved.

      SQL*Loader-350: Syntax error at line 10.
      Expecting valid column specification, "," or ")", found "(".
      (
      ^


      I can load the flat file into a staging table with 3 cols of varchar2(4000) using the same CHAR TERMINATED BY .. syntax for each col individually. Then using a PL/SQL procedure that constructs the SDO_RDF_TRIPLE_S objects I can load the triple table mt_1 successfully from the staging table.

      I would like to do this in one step with sqlldr but it fails when I use the constructor, but I see example of loading a COLUMN OBJECT using a constructor (not SDO_RDF_TRIPLE_S however) here
      http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14255/sdo_objload.htm#sthref260

      I have looked without success for threads that address this situation on the Spatial forum and on asktom.
      I have seen the documentation for using Java API or SQL inserts to load triples.
      I have also seen high level documentation from Oracle about using SQL Loader to batch load N-Triples, but no examples of control file syntax for loading from a flat file.

      Any ideas?

      Thanks,

      Peter
        • 1. Re: SQL*Loader error 350 using SDO_RDF_TRIPLE_S constructor
          Mannamal-Oracle
          The arguments of the SDO_RDF_TRIPLE_S constructor do not match the attribute fields. See "Loading Column Objects with User-Defined Constructors" in the Oracle® Database Utilities 10g Release 2 (10.2) (Part Number B14215-01) document to see how such a constructor can be invoked during the load process.

          Here is an example of a control file:

          LOAD DATA
          INFILE 'mt_data.txt' BADFILE 'mt_data.bad'
          APPEND
          INTO TABLE mt_1
          (
          id SEQUENCE(MAX,1),
          subj boundfiller char terminated by whitespace,
          pred boundfiller char terminated by whitespace,
          obj boundfiller char terminated by '.',
          triple expression "sdo_rdf_triple_s('test_model',:SUBJ, :PRED, :OBJ)"
          )


          Please note that the current documented way of loading is using the java batch loader which is on the semantic technologies OTN page. Some other users have used SQL*Loader successfully, though we have not yet internally tested this for large data sets. We plan to do that in the future and I will post recommendations accordingly.

          Melli
          Oracle Semantic Technologies Development Group
          • 2. Re: SQL*Loader error 350 using SDO_RDF_TRIPLE_S constructor
            437959
            Thank you Melli for the sample .ctl file. I was able to use sqlldr to load a triple store using a conventional load. Direct loading is not supported, correct? This is the error I received when using direct=true

            SQL*Loader-951: Error calling once/load initialization
            ORA-26052: Unsupported type 121 for SQL expression on column TRIPLE.

            Peter
            • 3. Re: SQL*Loader error 350 using SDO_RDF_TRIPLE_S constructor
              Mannamal-Oracle
              That is correct, direct load is not supported currently.

              Melli