2 Replies Latest reply on Jan 11, 2010 10:17 AM by 735106

    Update Triple RDF - Jena

    735106
      Hello,

      I would like to know if it's possible to update RDF triples stored in database using Jena or by an other way?

      More precisely, in one hand, I would like to load an owl file with Jena and edit some individuals (create, delete, edit properties, etc...). Then save the results in a new OWL file. But how could these modifications can be reflected in my RDF triple table?

      One way would be to store only owl files instead of RDF triples and save a new copy of the owl file or erase the previous one but I'm absolutely not satisfied about that. Indeed, if you erase only one individual (an entity), you have to load the entire file, do your update and then save again.


      It would be nice, if anyone can help me.


      Olivier
        • 1. Re: Update Triple RDF - Jena
          715399
          Hi Olivier,

          Whenever you do data manipulation using the Jena Adaptor APIs (e.g., using performAdd on GraphOracleSem) the changes will be applied to the underlying RDF triples table in the database after you commit.

          Cheers,
          Vladimir
          • 2. Re: Update Triple RDF - Jena
            735106
            Thanks a lot for your very helpful answer.

            I tried Jena Adaptor 2.0 with Oracle Enterprise Edition 11g release 1 and the first example in the jena adaptor readme file:

            Oracle oracle = new Oracle(szJdbcURL, szUser, szPass);
            Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
            model.getGraph().add(Triple.create(
            Node.createURI("http://example.com/John"),
            Node.createURI("http://example.com/fatherOf"),
            Node.createURI("http://example.com/Mary")));
            model.close();
            oracle.dispose();

            I'm using Jena 2.5.6 which is highly recommanded to work with Jena Adaptor 2.0. However, this code results in a NoClassDefFoundError:

            Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/engine/main/OpExecutor

            When I looked into the arq.jar library where this class should be, I didn't find it in version 2.5.6 of Jena but in version 2.5.7 or higher.

            So when I replaced the arq.jar containing the OpExecutor class, the code is correctly executed.

            Do you know anything about that?

            Hope to read you again

            Thanks