}
public void testRelativeWrite()
throws StoreException, RDFParseException, IOException, RDFHandlerException
{
Repository rep1 = new SailRepository(new MemoryStore());
rep1.initialize();
RepositoryConnection con1 = rep1.getConnection();
URL ciaScheme = this.getClass().getResource("/cia-factbook/CIA-onto-enhanced.rdf");
URL ciaFacts = this.getClass().getResource("/cia-factbook/CIA-facts-enhanced.rdf");
con1.add(ciaScheme, ciaScheme.toExternalForm(), RDFFormat.forFileName(ciaScheme.toExternalForm()));
con1.add(ciaFacts, ciaFacts.toExternalForm(), RDFFormat.forFileName(ciaFacts.toExternalForm()));
StringWriter writer = new StringWriter();
RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
rdfWriter.setBaseURI(ciaFacts.toExternalForm());
con1.export(rdfWriter);
long before = con1.size();
con1.close();
Repository rep2 = new SailRepository(new MemoryStore());
rep2.initialize();
RepositoryConnection con2 = rep2.getConnection();
con2.add(new StringReader(writer.toString()), ciaFacts.toExternalForm(),