Open eroux opened 4 years ago
I'm having the same issue and found here. Can't believe it's an old issue of 4 years without any response (at least clarification)...
(Note that in the current version of rdflib, you can do import { NamedNode } from 'rdflib/lib/tf-types';
to resolve the original issue.)
I understand the reason for having a separete NamedNode
interface, which is to be compatible with the rdf.js specification. However, the defined NamedNode
interface is not compatible with that from @rdfjs/types
, the reference type definition. In particular, it misses the ?
aspect of the equals()
method.
I'm not sure if this is a version issue, as I'm not experienced enough with rdfjs either. But this inconsistency should be resolved to remain compatible.
When doing the following:
I'm getting:
which is a bit bizarre... I believe this comes from the multiple declarations of
NamedNode
, once as an interface here and once as a class here.The interface is the returned type of
rdf.Namespace("http://example.com/")("foo")
as seen here, while the class is what gets exported by therdflib
module here.Effectively there seems to be no valid type for
exfoo
that I could use, as theNamedNode
interface is not exported.Is it possible to export the interfaces, or implement any another appropriate solution?