for(org.openrdf.model.Statement stmt : stmts) {
this.valueFactory.createStatement(stmt.getSubject(), stmt.getPredicate(),
stmt.getObject(), openrdfContextURI);
}
} catch(RepositoryException e) {
throw new ModelRuntimeException(e);
}
} else {
// copy statements directly from Repository to Repository,
// without using RDF2Go-specific wrappers
org.openrdf.model.URI context = repositoryModel.getOpenRDFContextURI();
RepositoryResult<org.openrdf.model.Statement> statements = null;
try {
statements = repositoryModel.connection.getStatements(null, null, null, false,
context);
// doesn't hurt to explicitly add them to the right context
while (statements.hasNext()) {
org.openrdf.model.Statement stmt = statements.next();
this.connection.add(
this.valueFactory.createStatement(stmt.getSubject(),
stmt.getPredicate(), stmt.getObject(), openrdfContextURI),
openrdfContextURI);
}
} catch(RepositoryException e) {
throw new ModelRuntimeException(e);
} finally {
if(statements != null) {
try {
statements.close();
} catch(RepositoryException e) {
throw new ModelRuntimeException(e);
}
}
}
}
} else {