3 Replies Latest reply on Dec 9, 2007 4:26 AM by Mannamal-Oracle

    Get Triple ID from Table

      I want to get triple id from table in oracle 11g,

      So, I am trying to use the following query

      select t.triple.rdf_t_id from rdf_test t

      but I got ERROR
      ORA-00904: "t"."TRIPLE"."GET_RDF_TRIPLE": invalid identifier

      Please help me out

        • 1. Re: Get Triple ID from Table
          Hi Steven,

          The structure of the type sdo_rdf_triple_s was changed a bit in 11g. The attribute rdf_t_id no longer exists. To see a list of attributes of the type sdo_rdf_triple_s use the 'describe' command:

          SQL> desc mdsys.sdo_rdf_triple_s;

          Note that we generally encourage using methods to access object attributes (instead of directly accessing an attribute) since attribute names can change. (further note that if an application had data in 10g the upgrade process would take care of moving the data to the modified type in 11g).

          If you had wanted to get the triple_id of a given triple, you can use procedure sem_apis.get_triple_id(...). See chapter 3 in the documentation for more details.

          • 2. Re: Get Triple ID from Table
            thank you very much.

            but, In face, I want to know what is the best way to query ontologies with the known subject, property and object.

            such as the following query:

            select a.triple() from TABLE_NAME
            where a.triple.get_subject() = 'SUBJECT_NAME' and
            a.triple.get_property() = 'PROPERTY_NAME' and
            to_char(a.triple.get_object()) = 'OBJECT_NAME';

            can it get the highest performance?

            • 3. Re: Get Triple ID from Table
              Yes, it can get good performance if you build the right indexes. See section 1.8 of the documentation. For the family_rdf_table example used in the documentation, indexes can be built as follows:

              -- Create indexes on the subjects, properties, and objects
              -- in the FAMILY_RDF_DATA table.
              CREATE INDEX family_sub_idx ON family_rdf_data (triple.GET_SUBJECT());
              CREATE INDEX family_prop_idx ON family_rdf_data (triple.GET_PROPERTY());
              CREATE INDEX family_obj_idx ON family_rdf_data (TO_CHAR(triple.GET_OBJECT()));