The endpoint avatar/update/set allows to update avatar by setting only the specified properties (data properties from ontologies, or label properties) or relationships. The others are not modified and they keep their value.
In the following examples, prop:*
are defined labels with property type
suppose you create avatar :
{
"_iri": "http://www.example.com/avatars/obj4",
"_label": [
"tag:red"
],
"prop:size" : 10,
"prop:name" : "cool"
}
you get the UUID (XXXXX) of the avatar, that you can use to identify the avatar at the update endpoint.
applying update/set/XXXXX
{
"prop:size" : 55,
"prop:weight" : 95
}
After update, the avatar is now :
{
"_iri": "http://www.example.com/avatars/obj4",
"_label": [
"tag:red"
],
"prop:size" : 55,
"prop:weight" : 95,
"prop:name" : "cool"
}
The relationships updates work in the same way, if the relation already exists, it will be update otherwise it will be created. you can not create twice relationships with same label, it will raise error conflict.
Suppose you create an avatar with :
{
"_uuid": "XXXXX",
"_iri": "http://www.example.com/avatars/obj5",
"_label": [
"tag:blue"
],
"_outE": [
{
"_label": "rel:like",
"_targetIRI": "http://www.example.com/phil/testrel/obj4",
"prop:size" : 55
}
]
}
you get the UUID (YYYYY) of the avatar and UUID (ZZZZZ) of the relationship, that you can use to identify the avatar at the update endpoint.
applying update/set/XXXXX
{
"_outE": [
{
"_id" : "ZZZZZ",
"prop:size" : 10.5
}
]
}
is equivlent to
{
"_outE": [
{
"_label": "rel:like",
"_targetIRI": "http://www.example.com/phil/testrel/obj4",
"prop:size" : 10.5
}
]
}
the result should be an avatar
{
"_uuid": "YYYYY",
"_iri": "http://www.example.com/avatars/obj5",
"_label": [
"tag:blue"
],
"_outE": [
{
"_id" : "ZZZZZ",
"_label": "rel:like",
"_targetIRI": "http://www.example.com/phil/testrel/obj4",
"prop:size" : 10.5
}
]
}