Created
May 7, 2012 16:55
-
-
Save phlegx/2628950 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void performRollback(String repositoryID, String pdoVersion) { | |
String server = GeneralOperations.getSesameServer(); | |
Repository myRepository = createRepositoryConnection(server, repositoryID); | |
String sparqlQuery = "CONSTRUCT { ?s ?p ?o } WHERE {GRAPH <http://example.com/" + repositoryID + "_" + pdoVersion + ".owl> {?s ?p ?o }}"; | |
try { | |
RepositoryConnection con = myRepository.getConnection(); | |
try { | |
GraphQuery graphResult = con.prepareGraphQuery(QueryLanguage.SPARQL, sparqlPrefixVersioning + sparqlQuery); | |
try { | |
ValueFactory f = myRepository.getValueFactory(); | |
org.openrdf.model.URI context = f.createURI("http://example.com/" + repositoryID + "_" + pdoVersion + ".owl"); | |
GraphQueryResult result = graphResult.evaluate(); | |
con.clear(context); | |
//con.clear(); | |
} | |
finally { | |
graphResult.clearBindings(); | |
} | |
} finally { | |
con.close(); | |
} | |
} catch (Exception ex) { | |
LOG.error("Exception: ", ex); | |
} | |
LOG.debug("END performRollback"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment