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

Deleting any node deletes all node #159

Open
parliament718 opened this issue Dec 29, 2018 · 2 comments
Open

Deleting any node deletes all node #159

parliament718 opened this issue Dec 29, 2018 · 2 comments

Comments

@parliament718
Copy link

parliament718 commented Dec 29, 2018

I know this library is unmaintained but it really really sucks that I cant do a basic delete operation. It keeps deleting all my data no mattter what method of delete I try.

I'm able to retrieve a subset of my graph from rdfstore.js via the following query:

SELECT * { 
    ?subject app:rhymesWith ?object .
    FILTER (?subject = "word" || ?object = "word")
}

However, when I try to delete what I would think is the same subset of triples:

DELETE WHERE {
     ?subject app:rhymesWith ?object .
     FILTER(?subject = "word" || ?object = "word")
}

It deletes all data in my graph. I tried many other methods including the RDF Interface API:

this.store.graph('app:graph', async (err, graph) => {
                const rdf = this.store.rdf;

                 //deleteGraph  here even has the correct number of triples to delete
                let deleteGraph = graph.match(
                    null,
                    rdf.createNamedNode(rdf.resolve("app:rhymesWith")),
                    rdf.createLiteral(word));

                this.store.delete(deleteGraph);
            });

I've even used DELETE DATA to try to delete a single triplet without any pattern matching:

    let data = `"${triple.subject}" app:rhymesWith "${triple.object}"`;
   let query = `DELETE DATA { GRAPH app:graph { ${data} } } `;

    this.store.execute(query);

No matter what I do, any kind of delete attempt deletes all the data. Very upsetting as I have invested a quite bit of time into writing and querying the data, now I cant delete anything and have to rewrite the whole thing in a diff lib. Is there any solution at all?

@madnificent
Copy link

@parliament718 Did you work further on a solution to this problem? We're looking into using rdfstore-js too and data-deletion would be an important feature.

Did you try stepping through the code to see what was wrong, or have you only tried different ways of deleting content?

If you have alternative libraries which allow us to do similar things, I'd like to hear about them too.

@parliament718
Copy link
Author

@madnificent unfortunately no, I did not find any solution nor insight into this bug. Sorry, but if you do please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants