Thanks All, all comments is appreciated. regards, Dhomas Hatta Fudholi
________________________________________ From: Stefan Scheffler [[email protected]] Sent: Monday, July 16, 2012 7:13 PM To: [email protected] Subject: Re: Rename Properties in Jena API? On 16.07.2012 09:52, Dave Reynolds wrote: > On 16/07/12 08:45, Ian Dickinson wrote: >> Hi Dhomas, >> On 16/07/12 02:48, DHOMAS HATTA FUDHOLI wrote: >>> Hi All, >>> >>> Is there any method in Jena API to rename ObjectProperty or >>> DatatypeProperty? >>> >>> I could find only the way to rename Resource, maybe Class, using >>> renameResource() method in ResourceUtils class. >>> >>> Thanks in advance for any advise. >> If you look at the Java class hierarchy, all of the ObjectProperty, >> DatatypeProperty, OntClass, etc are also subclasses of Resource. This >> conforms to the RDF semantics, in which a property is a special kind of >> resource which plays a particular role in the RDF graph. So in summary: >> use renameResource() to rename any kind of resource in a Jena model, >> including an ObjectProperty. > > I don't think, so the code for renameResource does not rename usages > in the predicate position. Unless that's changed recently (my local > copy is out of date). > > Dave Hi Thomas. I think it is very difficult to rename resources and especially properties in a rdf-graph, because if you do this you have to refresh all entities within the store. One simple way would be to run over all resources, delete the statement with the old property and add a new statement with the new property. But on large complex graphs, this will be very slow. Maybe it is an alternative to change the property and reload the data. Greetings Stefan -- Stefan Scheffler Avantgarde Labs GmbH Löbauer Straße 19, 01099 Dresden Telefon: + 49 (0) 351 21590834 Email: [email protected]
