Problem deleting triple

Hi,

I want to delete a triple with the test:actsOn predicate from an individual identified as http://www.mycompany.com/test#ReplaceBattery having http://www.mycompany.com/resources#Something as subject.

What could be wrong in the query below as no triples gets deleted?

PREFIX test: http://www.mycompany.com/test
DELETE WHERE {
GRAPH http://www.mycompany.com/mygraph
{ http://www.mycompany.com/test#ReplaceBattery test:actsOn http://www.mycompany.com/resources#Something }
}

Thanks,
Johan,

Hi Johan,

Do you see the expected results if you run a SELECT or CONSTRUCT query with the exact same WHERE clause?

Also, via which API or interface do you run the query?

Cheers,
Pavel

Yes I do see the expected result when I issue a select like this:

PREFIX test: http://www.mycompany.com/test#
SELECT ?p ?s
WHERE {
?p test:actsOn ?s
}

Result:
?p : http://www.mycompany.com/test#ReplaceBattery
?s : http://www.mycompany.com/resources#Something

I executed the delete using SnarlAPI and web console of Stardog. Same result.

Kind regards.

But this is a different WHERE clause and there’s now an extra # at the end of the test: prefix IRI. How about this:

PREFIX test: <http://www.mycompany.com/test>

ASK {
GRAPH <http://www.mycompany.com/mygraph>
{ <http://www.mycompany.com/test#ReplaceBattery> test:actsOn <http://www.mycompany.com/resources#Something> }
}

Does this return true?

Best,
Pavel

Yes it does return true. The extra # is indeed part of the prefix. As I have to change the uri’s in order to not disclose anything here, I forgot that character.

Johan,

Usually this kind of problems happen when there’s a mismatch in IRIs somewhere. If ASK with the exact same WHERE returns true then DELETE must delete the triples (well, unless you have something like named graph security preventing updates to that named graph).

We’d need a test case to reproduce the problem to investigate further. I understand you cannot share data but maybe you can share it in the obfuscated form (Stardog can turn all IRIs and literals into md5 hashes).

Best,
Pavel

Pavel,

The issue is fixed. I had 2 issues, a typo in the query generated in my code and the user that executes the query from within my code did not have the correct DELETE grant.

Thanks for the tips above.

Kind regards,

Great, thanks for letting me know.

Best,
Pavel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.