Open dpetran opened 7 months ago
After discussing with Ben, we're going to go with option 3.
Relevant comments & examples provided by @Jackamus29 in this thread: https://fluree-internal.slack.com/archives/C04AA19P3FW/p1706296205125759?thread_ts=1706294773.772209&cid=C04AA19P3FW
Here's another case may be fixed when this ticket is resolved:
Description
delete
+where
doesn't work if @vocab
is present.
Steps to Reproduce
Create ledger with data
{
"ledger": "vocab-test",
"@context": {
"@vocab": "https://flur.ee/"
},
"insert": [
{
"@id": "freddy",
"@type": "Yeti",
"name": "Freddy"
}
]
}
Delete subject
{
"ledger": "vocab-test",
"@context": {
"@vocab": "https://flur.ee/"
},
"where": {
"@id": "freddy",
"?p": "?o"
},
"delete": {
"@id": "freddy",
"?p": "?o"
}
}
History query shows no retractions
{
"from": "vocab-test",
"commit-details": true,
"t": {
"at": "latest"
},
"@context": {
"@vocab": "https://flur.ee/",
"f": "https://ns.flur.ee/ledger#"
}
}
and query shows the subject
{
"from": "vocab-test",
"select": {
"freddy": [
"*"
]
}
}
=>
[
{
"@id": "freddy",
"@type": "https://flur.ee/Yeti",
"https://flur.ee/name": "Freddy"
}
]
When a transaction has a context that defines
@base
and@vocab
, variables within the the insert and delete clauses get erroneously expanded:We need to avoid expanding these variables so they can be parsed correctly.
Here are three possible approaches:
json-ld/expand
aware of variables so it can skip expanding them@base
json-ld/expand
at all, manually traverse the tree and callexpand-iri
where we want it (like how we do where-clause parsing)json-ld/expand
cannot handle variable symbols either, with the same possible solutions.