1 Reply Latest reply on Jun 8, 2009 2:05 PM by alwu-Oracle

    Help inserting triples with Oracle Jena adaptor - is CONSTUCT supported?

      I've been attempting to add triples to my Oracle RDF model using execConstruct but nothing appears to be happening.

      Here's a sample of the SPARQL I'm passing to this call:

      <http://nais.gcsd.harris.com/destination/SectorHouston> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://iis.harris.com/discovery#Destination> .
      }WHERE {}

      I don't understand why the WHERE clause is required, but I got syntax errors when I tried to leave it off. The command runs and doesn't throw an exception, but there's no effect on the tables in Oracle. I thought maybe it was a transaction thing, so I added a .close call on my graph, but that didn't help.

      Is "CONSTRUCT" supported by the adapter?

      What's the recommended way to insert triples? I see an "add" and a "performAdd". Not sure if there's a difference, except that "performAdd" looks to be propietary while "add" is implemnting a Jena inteface.

      I'll also have some objects that are quite long, does the adapter handle storing these as clobs automatically?
        • 1. Re: Help inserting triples with Oracle Jena adaptor - is CONSTUCT supported?
          A straightforward way to add a few triples is like this:

          sub = Node.createURI("http://example.com/John");
          pred = Node.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
          obj = Node.createURI("http://xmlns.com/foaf/0.1/Person");
          triple = Triple.create(sub, pred, obj);

          And Yes long literals are supported.

          If you have many triples to be inserted, please take a look at the OracleBulkUpdateHandler class.

          CONSTRUCT is supported by Jena Adaptor. However, it is not meant to insert triples to Oracle RDF model.
          Rather, it is used to return you a RDF graph (Jena model, not an instance of OracleModelSem) based on the query template.
          Please refer to