diff --git a/rdflib/term.py b/rdflib/term.py index d49f8117a..eb7ba69cc 100644 --- a/rdflib/term.py +++ b/rdflib/term.py @@ -269,6 +269,14 @@ class IdentifiedNode(Identifier): __slots__ = () + def __hash__(self) -> int: + return super().__hash__() + + def __eq__(self, other: Any) -> bool: + if isinstance(other, IdentifiedNode): + return self.n3() == other.n3() # compare the N3 notation and not the string representation + return super().__eq__(other) + def n3(self, namespace_manager: NamespaceManager | None = None) -> str: raise NotImplementedError()