sail.initialize();
try {
SailConnection sc = sail.getConnection();
try {
sc.begin();
ValueFactory vf = sail.getValueFactory();
sc.addStatement(vf.createURI("http://tinkerpop.com#1"), vf.createURI("http://tinkerpop.com#knows"), vf.createURI("http://tinkerpop.com#3"), vf.createURI("http://tinkerpop.com"));
sc.addStatement(vf.createURI("http://tinkerpop.com#1"), vf.createURI("http://tinkerpop.com#name"), vf.createLiteral("marko"), vf.createURI("http://tinkerpop.com"));
sc.addStatement(vf.createURI("http://tinkerpop.com#3"), vf.createURI("http://tinkerpop.com#name"), vf.createLiteral("josh"), vf.createURI("http://tinkerpop.com"));
CloseableIteration<? extends Statement, SailException> results = sc.getStatements(null, null, null, false);
try {
System.out.println("get statements: ?s ?p ?o ?g");
while (results.hasNext()) {
System.out.println(results.next());
}
} finally {
results.close();
}
System.out.println("\nget statements: http://tinkerpop.com#3 ?p ?o ?g");
results = sc.getStatements(vf.createURI("http://tinkerpop.com#3"), null, null, false);
try {
while (results.hasNext()) {
System.out.println(results.next());
}
} finally {