/** 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(); }
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(); }
/** 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); }