In a scenario where an insert statement depends on ?bindings populated from a where solution result, it makes sense that the insert statement would be dropped if no ?bindings were generated.
However currently, if an insert statement is independent of any bindings from a where result set, the insert statement still appears to be dropped.
For example, the following transaction:
{
"@context": "https://ns.flur.ee",
"ledger": "insert-delete-bug",
"where": [["ex:andrew", "schema:description", "?o"]],
"delete": {
"@id": "ex:andrew",
"schema:description": "?o"
},
"insert": [
{
"@id": "ex:andrew",
"schema:description": "He's great. The core team *definitely* doesn't resent him for all the bug tickets he creates."
}
]
}
Obviously the delete statement depends on the result of ?o, and so reasonably if no data matching ["ex:andrew", "schema:description", "?o"] exists, then no delete instructions should follow.
However the insert statement is independent of any ?bindings being produced from the result of the where execution, and we should expect the insert statement to execute regardless. Currently, however, it does not.
Recreation steps
NOTE: One part of the create transaction seems unnecessary, but currently we can't query for a property in the where clause if the property hasn't yet been instantiated with some data in a previous transaction, hence the need to include a random node with a schema:description value.
Create txn:
{
"@context": "https://ns.flur.ee",
"ledger": "insert-delete-bug",
"insert": [
{
"@id": "ex:andrew",
"schema:name": "Andrew"
},
{
"@id": "ex:random",
"schema:description": "Unfortunately I need to have added the property, 'schema:description' already for the next transaction to work... we should change that eventually."
}
]
}
Buggy transaction that drops insert:
{
"@context": "https://ns.flur.ee",
"ledger": "insert-delete-bug",
"where": [["ex:andrew", "schema:description", "?o"]],
"delete": {
"@id": "ex:andrew",
"schema:description": "?o"
},
"insert": [
{
"@id": "ex:andrew",
"schema:description": "He's great. The core team *definitely* doesn't resent him for all the bug tickets he creates."
}
]
}
Description
In a scenario where an
insert
statement depends on?bindings
populated from awhere
solution result, it makes sense that theinsert
statement would be dropped if no?bindings
were generated.However currently, if an
insert
statement is independent of any bindings from awhere
result set, theinsert
statement still appears to be dropped.For example, the following transaction:
Obviously the
delete
statement depends on the result of?o
, and so reasonably if no data matching["ex:andrew", "schema:description", "?o"]
exists, then nodelete
instructions should follow.However the
insert
statement is independent of any?bindings
being produced from the result of thewhere
execution, and we should expect theinsert
statement to execute regardless. Currently, however, it does not.Recreation steps
Create txn:
Buggy transaction that drops
insert
: