From: Jonathan H. <hen...@ya...> - 2005-05-02 15:29:06
|
Problem: I want the mimic Update and Delete functionality present in SQL. For example, imagine an RDFS class that has a multiple cardinality property - like FOAF:knows. If George knows 10 people and I want to remove 5 of them based on a search - i would do an RDQL query first and then pass the results to the remove function called 5 times in a loop. (inefficient, but I am not aware of another solution) Removing single statement seems trivial enough. Update seems to be less friendly. If 5 out of George's 10 friend's phone numbers have all changed this would be easy if I do the same as above using replace: foreach (rdqlqueryresult) { replace($friend, FOAF:hasphone, ?anyoldPhoneNumberY, $newphonenumber) } The problem is when ?anyoldPhoneNumber is also a multiple cardinality item. In this case I need to know the the previous result I want to replace. foreach (rdqlqueryresult) { replace($friend, FOAF:hasphone, $specificPhoneNumber, $newphonenumber) } So this all seems a bit hackish. But generally is this the way I should proceed to get the update and delete functionality? |