@Test
public void testApplyRule() {
Model m = RDF2Go.getModelFactory().createModel();
m.open();
Map<String, URI> nsMap = new HashMap<String, URI>();
nsMap.put("rdf", new URIImpl(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
String LOCAL = "http://example.com#";
nsMap.put("", new URIImpl(LOCAL));
URI a = new URIImpl(LOCAL + "a");
URI b = new URIImpl(LOCAL + "b");
URI c = new URIImpl(LOCAL + "c");
m.addStatement(a, b, c);
m.addStatement(a, RDF.type, c);
log.debug("Before");
m.dump();
String constructRemove = "?x a " + c.toSPARQL();
String constructAdd = "?x a " + b.toSPARQL();
String where = constructRemove;
SearchRemoveAddRule.searchAndReplace(m, nsMap, where, constructRemove,
constructAdd);