On 22 Jan 2011, at 14:31, Timo Westkämper <[email protected]> wrote:
> Hi. > Hi Timo, > I am having issues with the following code > > DataSource dataSource = DataSourceImpl.createMem(); > Node subject = Node.createURI(TEST.NS); > Node predicate = Node.createURI(RDFS.label.getId()); > Node object = Node.createAnon(); > dataSource.asDatasetGraph().add(new Quad(Quad.defaultGraphIRI, > subject, predicate, object)); > dataSource.asDatasetGraph().deleteAny(null, subject, null, null); > > The last line throws the following Exception : > > java.lang.NullPointerException > at com.hp.hpl.jena.sparql.core.Quad.isDefaultGraph(Quad.java:87) > at > com.hp.hpl.jena.sparql.core.DatasetGraphCollection.fetchGraph(DatasetGraphCollection.java:75) > at > com.hp.hpl.jena.sparql.core.DatasetGraphCollection.delete(DatasetGraphCollection.java:33) > at > com.hp.hpl.jena.sparql.core.DatasetGraphBase.deleteAny(DatasetGraphBase.java:79) > > Am I using the API wrong? You're using the SPI, not the API (the model / resource stuff). Unlike the API, where you use 'null' to match anything, the SPI uses Node.ANY (hence your issue). Out of interest, why are you using the SPI? Damian
