Hi.

Same problem with Node.ANY :

        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(Node.ANY, subject, Node.ANY, Node.ANY);

I am using the SPI, since the lower level integration seems to be enough. I am writing Jean support for another RDF abstraction layer, the stuff of the higher level API is not needed.

Br,
Timo Westkämper

On 01/22/2011 09:25 PM, Damian Steer wrote:

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

Reply via email to