blazegraph / database

Blazegraph High Performance Graph Database
GNU General Public License v2.0
872 stars 170 forks source link

RDF-star triple delete not working as required by W3C #225

Closed includingThis closed 2 years ago

includingThis commented 2 years ago

Hi, while trying to use Blazegraph's RDF-star implementation (which is called RDR) we're running into issues.

W3C description of RDF-star behaviour: Any triple may be deleted singularly as each triple "lives independently". https://www.w3.org/2021/12/rdf-star.html#delete-data

Our issue:

Using W3C example data:

PREFIX : http://www.example.org/ INSERT DATA { :bob :age 23 . :alice :claims << :bob :age 23 >> . }

Try to delete "star triple" as follows:

PREFIX : http://www.example.org/ DELETE DATA { :alice :claims << :bob :age 23 >> . }

Not working: triple not deleted! No error shown.

Try to delete "inner triple" as follows:

PREFIX : http://www.example.org/ DELETE DATA { :bob :age 23 . }

This works as normal.

Crazy workaround - delete both triples:

PREFIX : http://www.example.org/ DELETE DATA { :bob :age 23 . :alice :claims << :bob :age 23 >> . }

This works but is bullshit: not W3C conform and super risky to delete stuff you actually want to keep...

includingThis commented 2 years ago

I tried this with different namespace types which can be set in the Blazegraph web GUI and I found no differences in behaviour. Including one type for RDR...

hartig commented 2 years ago

Just some clarification: What is called RDR in the Blazegraph documentation is an implementation of an approach called RDF and SPARQL, which was first defined in the following document: http://arxiv.org/abs/1406.3399 Later, these definitions evolved into the RDF-star community spec that you refer to (https://www.w3.org/2021/12/rdf-star.html). When working on the spec, the community group decided to change the following aspect of the approach. In the original RDF definitions, embedded triples (i.e., the ones that are in the subject or object of other triples) are considered as asserted and, thus, visible in queries. In contrast, in RDF-star (as defined in the community spec), an embedded triple (now called quoted triple) is not considered as asserted (unless the triple has also been added explicitly). A consequence of this change from RDF to RDF-star is that the semantics of data manipulation statements (INSERT and DELETE) for SPARQL* Update (https://blog.liu.se/olafhartig/documents/sparql-update/) is different from the corresponding semantics in SPARQL-star Update (https://www.w3.org/2021/12/rdf-star.html#insert-data). What you are observing is probably an effect of these differences because Blazegraph has not yet been updated to support RDF-star and SPARQL-star as defined in the community spec.

includingThis commented 2 years ago

@hartig thank you very much. This might very well be the perfect answer for this issue. Yes, Blazegraph's description refers to RDF and hasn't been updated for about 2 years. Because of this I already suspected that it might not be fully implemented RDF-star. Yet, this is striking news for me that this detail changed between RDF and RDF-star. Good to know ;-)

Our conclusion most certainly will be to move away from Blazegraph as this adds to the main concern that this (once great) OpenSource project for its lack of updates might be slowly fading away into retirement.