@Override public Model removeAll() { getGraph().clear(); return this; }
@Override public Model removeAll() { getGraph().clear(); return this; }
@Override protected Graph emptyGraph() { graph.clear() ; return graph ; }
@Override protected Graph emptyGraph() { graph.clear() ; return graph ; }
@Override public void clear() { base.clear() ; getEventManager().notifyEvent(this, GraphEvents.removeAll ) ; }
/** Clear a graph - this leaves the storage choice and setup in-place */ protected void clearGraph(Target target) { Graph g = target.graph() ; g.getPrefixMapping().clearNsPrefixMap() ; g.clear() ; } }
@SuppressWarnings("deprecation") @Override protected final long writeOutput(Writer writer) { if (this.g.size() == 0) return 0; RDFDataMgr.write(writer, this.g, this.getRdfLanguage()); this.g.clear(); return this.g.size(); }
@Override public void clear() { // Delete all triples in the default graph getDefaultGraph().clear() ; // Now remove the named graphs (but don't clear them - they may be shared). List<Node> gnList = Iter.toList(listGraphNodes()) ; for ( Node gn : gnList ) { removeGraph(gn) ; } }
public void testRemoveAllEvent() { Graph g = getAndRegister( L ); g.clear(); L.assertHas( new Object[] { "someEvent", g, GraphEvents.removeAll } ); }
protected void defaultGraphData(DatasetGraph gStore, Graph data) { Graph g = gStore.getDefaultGraph() ; g.clear() ; GraphUtil.addInto(g, data) ; }
@Override public void clear() { getRawGraph().clear() ; discardState(); rebind(); getEventManager().notifyEvent( this, GraphEvents.removeAll ); }
@Override public void clear() { getRawGraph().clear() ; discardState(); rebind(); getEventManager().notifyEvent( this, GraphEvents.removeAll ); }
@Before public void before() { try { graph.clear() ; } catch (Exception ex) { Log.warn(this, "before() : "+ex.getMessage(), ex) ; // Problem - reset. beforeClass() ; } }
@Test(expected = UnsupportedOperationException.class) public void noClearingDefaultGraph() { emptyDsg().getDefaultGraph().clear(); }
@Test(expected = UnsupportedOperationException.class) public void noClearingANamedGraph() { Node graphName = NodeFactory.createBlankNode(); emptyDsg().getGraph(graphName).clear(); }
public void testRemoveAll( String triples ) { Graph g = getGraph(); graphAdd( g, triples ); g.clear(); assertTrue( g.isEmpty() ); }
public void testRemoveAll( String triples ) { Graph g = getGraph(); graphAdd( g, triples ); g.clear(); assertTrue( g.isEmpty() ); }
protected void namedGraphData(DatasetGraph gStore, Node uri, Graph data) { Graph g = gStore.getGraph(uri) ; if ( g == null ) { gStore.addGraph(uri, GraphFactory.createJenaDefaultGraph()) ; g = gStore.getGraph(uri) ; } else g.clear() ; GraphUtil.addInto(g, data) ; }
@Test public void linkAdd_01() { Graph graph = SSE.parseGraph("(graph (:s :p :o))") ; Node g = SSE.parseNode(":g") ; DatasetGraph dsg = emptyDataset() ; dsg.addGraph(g, graph); graph.clear(); assertTrue(graph.isEmpty()) ; assertTrue(dsg.getGraph(g).isEmpty()) ; }
@Test public void copyAdd_01() { Graph graph = SSE.parseGraph("(graph (:s :p :o))") ; Node g = SSE.parseNode(":g") ; DatasetGraph dsg = emptyDataset() ; dsg.addGraph(g, graph); graph.clear(); assertTrue(graph.isEmpty()) ; assertFalse(dsg.getGraph(g).isEmpty()) ; } }