Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete-where transaction fails to delete all matching records #18

Closed
aaj3f opened this issue Jun 14, 2023 · 0 comments · Fixed by fluree/db#539
Closed

Delete-where transaction fails to delete all matching records #18

aaj3f opened this issue Jun 14, 2023 · 0 comments · Fixed by fluree/db#539
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aaj3f
Copy link
Collaborator

aaj3f commented Jun 14, 2023

Description

Encountering a bug when using http-api-gateway to specifically delete all s-p-o triples for any subject with any value on a particular property, e.g.

    "txn": {
        "delete": ["?s", "?p", "?o"],
        "where": [
            ["?s", "schema:description", "?o"],
            ["?s", "?p", "?o"]
        ]
    }

Some of the subjects will get all facts deleted, but some subjects remain in their entirety.

Steps to reproduce:

  1. Create Ledger
{
    "ledger": "delete/error",
    "defaultContext": {
        "id": "@id",
        "type": "@type",
        "ex": "http://example.org/",
        "f": "https://ns.flur.ee/ledger#",
        "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
        "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
        "schema": "http://schema.org/",
        "xsd": "http://www.w3.org/2001/XMLSchema#"
    },
    "txn": [
        {
            "@id": "ex:fluree",
            "@type": "schema:Organization",
            "schema:description": "We ❤️ Data"
        },
        {
            "@id": "ex:w3c",
            "@type": "schema:Organization",
            "schema:description": "We ❤️ Internet"
        },
        {
            "@id": "ex:mosquitos",
            "@type": "ex:Monster",
            "schema:description": "We ❤️ Human Blood"
        }
    ]
}
  1. Submit transaction
{
    "ledger": "delete/error",
    "txn": {
        "delete": ["?s", "?p", "?o"],
        "where": [
            ["?s", "schema:description", "?o"],
            ["?s", "?p", "?o"]
        ]
    }
}
  1. Query subjects w/ any value on schema:description
{
    "ledger": "delete/error",
    "query": {
        "selectDistinct": {"?s": ["*"]},
        "where": [["?s", "schema:description", "?o"]]
    }
}

// =>

[
    {
        "id": "ex:w3c",
        "rdf:type": [
            "schema:Organization"
        ],
        "schema:description": "We ❤️ Internet"
    }
]

More details can be found in this slack thread: https://fluree-internal.slack.com/archives/C04AA19P3FW/p1686774957881859

@aaj3f aaj3f added the bug Something isn't working label Jun 14, 2023
@aaj3f aaj3f added this to the 3.0.0-beta1 milestone Jun 14, 2023
@zonotope zonotope self-assigned this Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants