1 Reply Latest reply on Jun 1, 2009 1:49 PM by alwu-Oracle

    Options for Loading All Triples into Graph Instance?

    702419
      Greetings,

      I noticed that after creating an GraphOracleSem and then iterating over the triples, it appears that each triple is individually fetched from the server during the iteration -at least this is how I interpret the log lines at the end of this message. So it appears that the triples are not loaded until needed, which I can understand. In my particular case where I do need to review every triple, this is proving to be quite slow (e.g. 100k triplest = 100k SQL queries).

      Is there a way (API or configuration setting) to fetch all triples at once (one SQL transaction) into the client side graph instance?

      thanks!

      -Daniel


      May 29, 2009 8:34:17 PM oracle.spatial.rdf.client.jena.SimpleLog info
      INFO: graphBaseFind: query= SELECT /* TS1243641928431 */ o$RDFVTYP, o$RDFLTYP, o$RDFLANG, o$RDFCLOB, decode(o$RDFVTYP, 'BLN', ('_:'||substr(o,instr(o,'m',4)+1)), o) o FROM TABLE( sdo_rdf_match( '(<_:m38mORABNENC4P0H11H25H28HC45E636ab6cb58E1218926619458E45E434a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> ?o )' , sdo_rdf_models('UBL_CC_CASE_V0_1') , null , null , null ) )
      May 29, 2009 8:34:17 PM oracle.spatial.rdf.client.jena.SimpleLog info
      INFO: graphBaseFind: query= SELECT /* TS1243641928432 */ 1 FROM TABLE( sdo_rdf_match( '(<_:m38mORABNENC4P0H11H25H28HC45E636ab6cb58E1218926619458E45E434a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> )' , sdo_rdf_models('UBL_CC_CASE_V0_1') , null , null , null ) )
      May 29, 2009 8:34:17 PM oracle.spatial.rdf.client.jena.SimpleLog info
      INFO: graphBaseFind: query= SELECT /* TS1243641928433 */ o$RDFVTYP, o$RDFLTYP, o$RDFLANG, o$RDFCLOB, decode(o$RDFVTYP, 'BLN', ('_:'||substr(o,instr(o,'m',4)+1)), o) o FROM TABLE( sdo_rdf_match( '(<_:m38mORABNENC4P0H11H25H28HC45E636ab6cb58E1218926619458E45E4349> <http://www.w3.org/2000/01/rdf-schema#label> ?o )' , sdo_rdf_models('UBL_CC_CASE_V0_1') , null , null , null ) )
      May 29, 2009 8:34:17 PM oracle.spatial.rdf.client.jena.SimpleLog info
      INFO: graphBaseFind: query= SELECT /* TS1243641928434 */ s$RDFVTYP, decode(s$RDFVTYP, 'BLN', ('_:'||substr(s,instr(s,'m',4)+1)), s) s FROM TABLE( sdo_rdf_match( '(?s <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2000/01/rdf-schema#Class> )' , sdo_rdf_models('UBL_CC_CASE_V0_1') , null , null , null ) )
      May 29, 2009 8:34:17 PM oracle.spatial.rdf.client.jena.SimpleLog info
        • 1. Re: Options for Loading All Triples into Graph Instance?
          alwu-Oracle
          Hi,

          What query did you use and what is the Jena Adaptor version?

          It seems that you want to load an Oracle RDF/OWL model into an in-memory Jena model.
          You can take a look at OntologyUtils.createInMemModel(oracle, modelName) API.

          Alternatively, you can try something as follows.

          Model modelOracle = ModelOracleSem.createOracleSemModel(oracle, modelName);
          gr = modelOracle.getGraph();
          model = ModelFactory.createDefaultModel();

          model.add(modelOracle);

          Thanks,

          Zhe