Hi all
I guess this should be very basic, but I can’t find a suitable resource for the following question. This mutation describes two sample transactions, where Alice sends 50 to Bob and 100 to Charlie:
{
set
{
_:alice <name> "Alice" .
_:bob <name> "Bob" .
_:charlie <name> "Charlie" .
_:alice <to> _:bob (value="10") .
_:alice <to> _:charlie (value="50") .
}
}
The code works fine when executed in the ratel mutation UI. Now, if I want to add another transaction,
{
set
{
_:bob <to> _:charlie (value="20") .
}
}
and query with
{
debug(func: has(name)) {
uid
expand(_all_)
}
}
I don’t see the anticipated Bob → Charlie transaction.
Same for pydgraph: I could set the first scene with
txn = client.txn()
try:
p = {
'name': 'Alice',
'to': [
{
'name': 'Bob',
'value': '10'
},
{
'name': 'Charlie',
'value': '50'
}
]
}
assigned = txn.mutate(set_obj=p)
txn.commit()
but adding something like
txn = client.txn()
try:
p = {
'name': 'Bob',
'to': [
{
'name': 'Charlie',
'value': '30'
}
]
}
assigned = txn.mutate(set_obj=p)
txn.commit()
or even using the assigned UIDs as
txn = client.txn()
try:
p = {
'name': 0x22,
'to': [
{
'name': 0x21,
'value': '30'
}
]
}
assigned = txn.mutate(set_obj=p)
txn.commit()
does not do the job. In the first example, two new nodes “Bob” and “Charlie” are generated, in the second example the UID is translated into an integer and integer-nodes are generated.
So I am clearly missing out on the correct syntax, could anybody help?
Many thanks!