public void testRR() {
   Statement st = SPO;
   Model m = model;
   ReifiedStatement rs1 = m.createReifiedStatement(aURI, st);
   ReifiedStatement rs2 = m.createReifiedStatement(anotherURI, st);
   m.removeReification(rs1);
   testNotReifying(m, aURI);
   assertTrue("st is still reified", st.isReified());
   m.removeReification(rs2);
   assertFalse("st should no longer be reified", st.isReified());
 }
 /**
  * Leo Bard spotted a problem whereby removing a reified statement from a model with style
  * Standard didn't leave the model empty. Here's a test for it.
  */
 public void testLeosBug() {
   Model A = getModel();
   Statement st = statement(A, "pigs fly south");
   ReifiedStatement rst = st.createReifiedStatement("eh:pointer");
   A.removeReification(rst);
   assertIsoModels(ModelFactory.createDefaultModel(), A);
 }
示例#3
0
 @Override
 public void clear() {
   Model graph = null;
   GraphConnection graphConnection = null;
   try {
     graphConnection = openGraph();
     graph = graphConnection.getGraph();
     graph.enterCriticalSection(Lock.READ);
     graph.removeAll();
     // XXX AT: remove reification quadlets explicitly
     RSIterator it = graph.listReifiedStatements();
     List<ReifiedStatement> rss = new ArrayList<ReifiedStatement>();
     while (it.hasNext()) {
       rss.add(it.nextRS());
     }
     for (ReifiedStatement rs : rss) {
       graph.removeReification(rs);
     }
   } finally {
     if (graph != null) {
       graph.leaveCriticalSection();
     }
     if (graphConnection != null) {
       graphConnection.close();
     }
   }
 }