001package org.w3.ldp.testsuite.util;
002
003import java.io.ByteArrayInputStream;
004import java.io.ByteArrayOutputStream;
005
006import com.hp.hpl.jena.rdf.model.Model;
007import com.hp.hpl.jena.rdf.model.ModelFactory;
008
009public class RDFModelUtils {
010        
011        public static Model cloneModel(Model model) {
012                Model result = ModelFactory.createDefaultModel();
013                ByteArrayOutputStream out = new ByteArrayOutputStream();
014                model.write(out);
015                ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
016                result.read(in, null);
017                return result;
018        }
019
020}