Exemple #1
0
  /** Dumps the model in a serialized form in a string */
  public static String dumpModel(Model m, RDFSerializer s)
      throws ModelException, IOException, SerializationException {

    StringWriter w = new StringWriter();
    s.serialize(m, w);
    return w.toString();
  }
Exemple #2
0
  public static void saveModel(Model m, String fileName, RDFSerializer s)
      throws FileNotFoundException, IOException, ModelException, SerializationException {

    //    RandomAccessFile raf = new RandomAccessFile(fileName, "rw");
    //  raf.close();
    //    FileWriter writer = new FileWriter(raf.getFD());
    FileWriter writer = new FileWriter(fileName);
    s.serialize(m, writer);
    writer.close();
  }
Exemple #3
0
 /** Dumps the model in a serialized form. */
 public static void dumpModel(Model m, PrintStream ps, RDFSerializer s)
     throws ModelException, IOException, SerializationException {
   OutputStreamWriter w = new OutputStreamWriter(ps);
   s.serialize(m, w);
 }