AGCloseTripleStore.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGCloseTripleStore {
@param
@throws
public static void main(String[] args) throws AllegroGraphException {
AllegroGraphConnection ags = new AllegroGraphConnection();
try {
ags.enable();
} catch (Exception e) {
throw new AllegroGraphException("Server connection problem.", e);
}
AllegroGraph ts = ags.renew("newstore", AGPaths.TRIPLE_STORES);
System.out.println("New triple store opened with " + ts.numberOfTriples() + " triples.");
System.out.println("Closing the triple store.");
ts.closeTripleStore();
System.out.println("Attempting to get the closed store's triple count.");
try {
ts.numberOfTriples();
} catch (IllegalStateException e) {
System.out.println("Expected Error: " + e.getMessage());
}
System.out.println("Disconnecting from the server.");
ags.disable();
System.out.println("Done.");
}
}
Up |
Next