1 Reply Latest reply on Sep 16, 2016 8:45 PM by alwu-Oracle

    Correspondence between oracle and xsd data types


      Dear all,


      Is there a way to get the RDF datatype for a given oracle data type before actually generating the triples?


      For instance, the following query returns the Oracle datatypes of given owner/table/column:


      SELECT data_type

      FROM all_tab_columns

      WHERE OWNER = '<owner>'

      AND TABLE_NAME = '<table>'

      AND COLUMN_NAME = '<column>'


      But it is possible to also get the correspondent RDF datatype using only a SQL query like the above one? E.g. NUMBER gives me xsd:decimal


      Thanks in advance,


        • 1. Re: Correspondence between oracle and xsd data types


          We don't have a catalog view to give that information. However, you can find it out quite easily. The following shows a simple example. You can add different typed literals of your choice.


          SQL> create table dt_tpl (triple sdo_rdf_triple_s);

          Table created.


          SQL> exec sem_apis.create_sem_model('dt', 'dt_tpl', 'triple');

          PL/SQL procedure successfully completed.


          SQL> insert into dt_tpl(triple) values(sdo_rdf_triple_s('dt','<urn:s>','<urn:p>','"123"^^xsd:integer'));

          1 row created.


          SQL> set numwidth 20

          SQL> select canon_end_node_id from mdsys.rdfm_dt;





          SQL> select literal_type from mdsys.rdf_value$  where value_id=5886861812983109538;






          Zhe Wu