Whether a dataset contains a graph if there are no triples is not defined; see the specific implementation.
2122232425262728293031
{ // Ensure RIOT loaded. // This is only needed to be sure - touching any ARQ code will load RIOT. // This operation can be called several times. SysRIOT.wireIntoJena() ; DatasetGraph dsg = null ; // Read a TriG file into quad storage in-memory. dsg = RiotLoader.load("data.trig") ; // read some (more) data into a dataset graph.
5354555657585960616263
} @Override protected QueryIterator nextStage(Binding outerBinding) { DatasetGraph ds = getExecContext().getDataset() ; // Is this closed? Iterator<Node> graphNameNodes = makeSources(ds, outerBinding, opGraph.getNode()); // List<Node> x = Iter.toList(graphNameNodes) ; // graphNameNodes = x.iterator() ;
878889909192939495
DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ) ; assertTrue(dsg2.contains(q)) ; dsg2.end() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertTrue(dsg.contains(q)) ; }
107108109110111112113114
DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ) ; assertFalse(dsg2.contains(q)) ; dsg2.end() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertFalse(dsg.contains(q)) ; }
130131132133134135136137138
DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ; assertTrue(dsgR2.contains(q1)) ; assertTrue(dsgR2.contains(q2)) ; dsgR2.end() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertTrue(dsg.contains(q1)) ; assertTrue(dsg.contains(q2)) ; }
152153154155156157158159160
dsgW1.add(q2) ; dsgW1.commit() ; dsgW1.end() ; sConn.forceRecoverFromJournal() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertTrue(dsg.contains(q1)) ; assertTrue(dsg.contains(q2)) ; }
182183184185186187188189
DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ; assertTrue(dsgR2.contains(q)) ; dsgR2.end() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertTrue(dsg.contains(q)) ; }
206207208209210211212213
DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ; assertFalse(dsgR2.contains(q)) ; dsgR2.end() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertFalse(dsg.contains(q)) ; }
238239240241242243244245246
266267268269270271272273274
dsgW3.end() ; assertFalse(dsgR1.contains(q3)) ; dsgR1.end() ; DatasetGraph dsg = sConn.getBaseDataset() ; assertFalse(dsg.contains(q2)) ; assertTrue(dsg.contains(q3)) ; }