AGDeleteTriples.java
package com.franz.agbase.examples;
import com.franz.agbase.*;
public class AGDeleteTriples {
@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("deletetriples", AGPaths.TRIPLE_STORES);
ts.registerNamespace("ex","http://example.org/");
ts.addStatement("!ex:a","!ex:p", "!ex:b");
ts.addStatement("!ex:b","!ex:p", "!ex:c");
ts.addStatement("!ex:p","!rdf:type", "!owl:TransitiveProperty");
TriplesIterator it = ts.getStatements(false,null,null,null);
AGUtils.showTriples("Showing all triples:",it);
ts.removeStatements(null, "!rdf:type", "!owl:TransitiveProperty");
it = ts.getStatements(false,null,null,null);
System.out.println("Remaining triples:");
AGUtils.showTriples(it);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next