@Test public void writeAccess() { Graph graph = new SimpleGraph(); Graph graph2 = new SimpleGraph(); BlankNode bnode = new BlankNode() { }; graph2.add(new TripleImpl(bnode, uriRef1, uriRef3)); Graph unionGraph = new UnionGraph(graph, graph2); Assert.assertEquals(1, unionGraph.size()); unionGraph.add(new TripleImpl(uriRef4, uriRef1, uriRef3)); Assert.assertEquals(1, graph.size()); Assert.assertEquals(2, unionGraph.size()); Assert.assertEquals(1, graph2.size()); }
@Override public boolean add(Triple e) { if (baseTripleCollections.length == 0) { throw new RuntimeException("no base graph for adding triples"); } return baseTripleCollections[0].add(e); }
UnionGraph extends AbstractGraph { @Override public boolean add(Triple e) { if (baseTripleCollections.length == 0) { throw new RuntimeException("no base graph for adding triples"); } return baseTripleCollections[0].add(e); } }
UnionGraph extends AbstractGraph { @Override public boolean add(Triple e) { if (baseTripleCollections.length == 0) { throw new RuntimeException("no base graph for adding triples"); } return baseTripleCollections[0].add(e); } UnionGraph(Graph... baseTripleCollections); }
UnionGraph extends AbstractGraph { @Override public boolean add(Triple e) { if (baseTripleCollections.length == 0) { throw new RuntimeException("no base graph for adding triples"); } return baseTripleCollections[0].add(e); } UnionGraph(Graph... baseTripleCollections); @Override int performSize(); @Override Iterator<Triple> performFilter(final BlankNodeOrIRI subject,
                                          final IRI predicate, final RDFTerm object); @Override boolean add(Triple e); @Override boolean remove(Object e); @Override boolean equals(Object obj); @Override int hashCode(); @Override ReadWriteLock getLock(); }
UnionGraph extends AbstractGraph { @Override public boolean add(Triple e) { if (baseTripleCollections.length == 0) { throw new RuntimeException("no base graph for adding triples"); } return baseTripleCollections[0].add(e); } UnionGraph(Graph... baseTripleCollections); @Override int performSize(); @Override Iterator<Triple> performFilter(final BlankNodeOrIRI subject,
                                          final IRI predicate, final RDFTerm object); @Override boolean add(Triple e); @Override boolean remove(Object e); @Override boolean equals(Object obj); @Override int hashCode(); @Override ReadWriteLock getLock();  }