6 Replies Latest reply on Aug 14, 2007 3:53 PM by Mannamal-Oracle

    How to reference XMLTYPE Coloumns in Oracle Database with RDF

    566769
      Hi there!

      First i want to say you do a great job out there!

      And here is my Question:

      I stored XML Documents inside the Database as XMLTYPE Columns in Tables. Now i want to reference parts of these Documents with RDF. That means, there is a node in the document stored in a table and want to add RDF metadata for this node. What's the best way to do that? Use the Oracle virtual file system, to publish the documents and do the references as a URL? Maybe i want to add RDF Data to specific Tables, is there a way to do that? Which possibilities exists to link with RDF inside a Database?

      Any Ideas are welcome! :)

      Best regards,

      Axel
        • 1. Re: How to reference XMLTYPE Coloumns in Oracle Database with RDF
          Mannamal-Oracle
          Hi Axel,

          Thanks for the compliments!

          RDF data can be linked with data in the database by creating a column in a table that is of type SDO_RDF_TRIPLE_S. This is the triple type, and columns in a table can be defined to be of that type. This column can be added to a table that has other data, or in a new table that is linked to other tables, perhaps using a foreign key. A <subject, predicate, object> triple can be inserted into this triple column (the triple is eventually stored in the internal semantic store, but this is transparent to the user).

          If the node in the XML document has multiple triples associated with it, perhaps a table with an SDO_RDF_TRIPLE_S column and a column to link each row to the table containing the XMLTYPE column can be created. An additional column can help identify a specific node in the XML document. I presume the application can create URLs that might be necessary for the RDF metadata.

          Let me know if this does not answer your question.

          Melli
          • 2. Re: How to reference XMLTYPE Coloumns in Oracle Database with RDF
            566769
            Hi Melli,

            your answer helped me very much. Thanks for that!

            Now, i am doing some testing with rdf - models in my database and tried the examples from the manual. I get problems when i try to execute the first query on the family model:

            SELECT m
            FROM TABLE(SDO_RDF_MATCH(
            '(?m rdf:type :Male)',
            SDO_RDF_Models('family'),
            null,
            SDO_RDF_Aliases(SDO_RDF_Alias('','http://www.example.org/family/')),
            null));

            Then i get an ORA-29531 error. I found out nothing for this error together with 'rdf'.

            Do you have any suggestions, what the problem could be?

            Thanks for your help,

            Axel
            • 3. Re: How to reference XMLTYPE Coloumns in Oracle Database with RDF
              Mannamal-Oracle
              Hmmm.... ORA-29531 error indicates that a java class was not found. If the RDF feature is installed there is no reason why that should happen. What version of Oracle are you using? Did the install go through cleanly? Was the Oracle Spatial option installed? You can verify this by checking 'select sdo_version from dual' and seeing what you get.

              Melli
              • 4. Re: How to reference XMLTYPE Coloumns in Oracle Database with RDF
                566769
                As far as i know there were no problems during the install. But maybe i have overlooked something. I installed the Patch from the Software Section. Maybe something was going wrong with that.

                My SDO_VERSION is: 10.2.0.1.0.

                Do you know a way to reinstall the (maybe) broken Parts?

                Axel
                • 5. Re: How to reference XMLTYPE Coloumns in Oracle Database with RDF
                  566769
                  Mhhh... maybe i haven't installed the spatial option. The Database descriptor says:

                  Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options

                  Does this include the spatial option?

                  regards,

                  Axel
                  • 6. Re: How to reference XMLTYPE Coloumns in Oracle Database with RDF
                    Mannamal-Oracle
                    Let us try and resolve this offline. Could you write to me at melliyal <dot> annamalai <at> oracle <dot> com I will post a summary of the resolution once we figure out the problem.

                    Melli