Search code examples
graphentityvaticle-typeqlvaticle-typedb

How to change the value of an attribute in Grakn


In Grakn, I want to change the value of a name attribute that's attached to an entity.

At the moment I am doing this (see below), which is just deleting the attribute and then inserting a new one to the country entity.

match
$b isa country, has name "Old Name";
$a isa name; 
$a val contains "Old Name";
delete $a;

insert 
$b has name "New Name";

I can't find any documentation on how to actually edit just the value of the attribute.

Any thoughts?


Solution

  • Actually for now, I am not sure you can... I did not find any solution, if you do a match... insert you will add a new ressource and you need to delete the old one. It will not be update. I am sure it is coming in a new feature though ;)

    do not forget to commit your delete transaction. All modification to the graph need to be committed.