public RdbToRdf(String dir) throws ClassNotFoundException {

    if (!dir.endsWith("/")) {
      dir = dir + "/";
    }

    File f = new File(dir);

    if (!f.isDirectory()) {
      f.mkdir();
    }

    dir = dir + "TDB/";

    f = new File(dir);

    if (f.isDirectory()) {
      if (f.exists()) {
        String[] myfiles = f.list();
        if (myfiles.length > 0) {
          for (int i = 0; i < myfiles.length; i++) {
            File auxFile = new File(dir + myfiles[i]);
            auxFile.delete();
          }
        }
        f.delete();
      }
    }

    f.mkdir();

    model = TDBFactory.createModel(dir);
    model.setNsPrefix("geo", Constants.NSGEO);
    model.setNsPrefix("xsd", Constants.NSXSD);
  }