You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not entirely clear why these are created. I am willing to help by writing a PR if you could please explain the reason of those triples to be asserted.
The text was updated successfully, but these errors were encountered:
from rdflib import Literal, Graph as _Graph
class Graph(_Graph):
def __init__(self, *p, **k):
self._offensive = set()
super().__init__(*p, **k)
def add(self, t):
if isinstance(t[0], Literal):
self._offensive.add(t)
# so that it keeps working as usual
return super().add(t)
# could patch __iter__ to filter out the offensive triples.
this is the 'last defense' procedure but there should be some config for this.
Such triples are illegal due to RDF standard, and they break at least some of the storage engines: see RDFLib/rdflib-sqlalchemy#85
The full working example is here: https://gist.github.com/anatoly-scherbakov/ebde3d6b70ddde7f7b3baadb65d8464b
I am not entirely clear why these are created. I am willing to help by writing a PR if you could please explain the reason of those triples to be asserted.
The text was updated successfully, but these errors were encountered: