jena-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Seaborne <a...@apache.org>
Subject Re: SPARQL Update on default RDF model
Date Wed, 08 Aug 2012 11:35:10 GMT
On 08/08/12 12:24, Enes Bulut wrote:
> 2012/8/8 Damian Steer <d.steer@bristol.ac.uk>
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 08/08/12 07:51, Enes Bulut wrote:
>>> Hi all,
>>
>>> First I create a default model.
>>>
>>> Model model= new ModelFactory.createDefaultModel(); ...
>>>
>>>
>>> Query string is something like that:
>>>
>>> String queryStr = "PREFIX foaf:  <http://xmlns.com/foaf/0.1/> " +
>>> "WITH <" + "http://example/addresses" +
>>
>> You're trying to update a named graph (WITH), but you only have a
>> default graph. Drop the WITH.
>>
>>> UpdateRequest upReq = UpdateFactory.create(); upReq.add(queryStr);
>>> UpdateAction.execute(upReq, model.getGraph);
>>
>> Damian
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.11 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAlAiOOIACgkQAyLCB+mTtylvqwCglzrXiCkBgCLVbQarLp7rKkoo
>> 83sAoJ9WOYrzCfF0Mg6PQeSjEGDeZyrL
>> =i4Np
>> -----END PGP SIGNATURE-----
>>
>
> Oh, I got it. Thank you.
>

I've fixed the NPE as well (it won't make your update do anything 
sensible and it will not make a visible update to model, it just won't 
NPE) and put a note in the javadoc that working with named graphs needs 
a dataset, not a model.

	Andy

Mime
View raw message