-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 26/06/12 09:20, Andy Seaborne wrote: > On 26/06/12 01:30, [email protected] wrote: >> How can I assign an URI to a blank node? The Resource class only >> provides getURI() or getId() methods, but the URI can't be set. >> Do I have to create a new Resource, copy all properties and >> delete the original node? >> > > Yes, you create a new resource. Resources are immutable - you > can't modify them after creation.
You can use ResourceUtils.renameResource(oldResource, uri) [1] to achieve the same effect. Behind the scenes this removes old statements using oldResource and makes new ones with uri. Damian [1] <http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/util/ResourceUtils.html> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/pfYgACgkQAyLCB+mTtyldTQCgsEH+RrgHeXhntyRjKw+M/JoD eoIAoM4CbsZoSZjrmD9AQAgEaJghmcdB =548K -----END PGP SIGNATURE-----
