Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get Triple ID from Table

609674Nov 21 2007 — edited Dec 8 2007
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

Thanks
Steven

Comments

Mannamal-Oracle
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.

Melli
609674
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?

Steven
Mannamal-Oracle
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()));

Melli
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 5 2008
Added on Nov 21 2007
3 comments
2,532 views