2 Replies Latest reply on Jun 24, 2008 6:24 PM by Mannamal-Oracle

    Loading data from a file    - originally posted in Spatial forum

      Loading data from a file

      Posted: Jun 23, 2008 10:21 AM      

      i want to load my data to oracle from a rdf file and can consult it later with sparql.
      so, I construct a Jena Model, then I store it using this program, but how can i consult it without loading the file again. thanks

      Oracle oracle = new Oracle(jdbcUrl, user, password);
      // read a data file into a default Jena model.
      Model model = ModelFactory.createDefaultModel();
      InputStream is;
      is = new BufferedInputStream( new FileInputStream(filename));
      model.read(new InputStreamReader(is), "", "");
      ModelOracleSem modelDest = ModelOracleSem.createOracleSemModel(oracle, modelName);
      GraphOracleSem g = new GraphOracleSem(oracle, modelName);
      if (method == 0) {
      psOut.println("start incremental");
      psOut.println("end size " + modelDest.size());
      }else if (method == 1) {
      psOut.println("start batch load");
      ((OracleBulkUpdateHandler) g.getBulkUpdateHandler()).addInBatch(
      GraphUtil.findAll(model.getGraph()), tbs);
      psOut.println("end size " + modelDest.size());
      } else {
      psOut.println("start bulk load");
      ((OracleBulkUpdateHandler) g.getBulkUpdateHandler()).addInBulk(
      GraphUtil.findAll(model.getGraph()), tbs);
      psOut.println("end size " + modelDest.size());