0

I need to change the name of an individual. I have found that using the getLocalName you manage to print the name, but is it possible to change the name of an existing individual and propagate it over the whole graph?

I have thought on using sameAs, but although it is similar, it is not the same as I don't one the original name to be kept.

Thanks.

jlanza
  • 1,208
  • 3
  • 23
  • 43

1 Answers1

1

To make a change, the app needs to remove all the old statements and add all new statements. There isn't a way to change-in-place a single node in the graph.

There is a helper function for this ResourceUtils.renameResource.

getLocal is a function on the URI of an RDF Term - the resources don't store the namespace/localname, just the URI.

If you are doing this on a large database, it may be better to dump the database to N-Triples, run a text changing script, and reload the database.

AndyS
  • 16,345
  • 17
  • 21
  • I was just waiting the two days to post my answer which btw it was similar to yours ;) What I did was dumping the entities to NTriples and then by using regex I replaced all the IRIs at once. Thanks. – jlanza May 19 '16 at 07:16