Some RDF/JS compatible libraries like comunica return instances of es6 classes. For those the type guard using hasOwnProperty in isRDFlibObject fails, althought the object has a getter for termType. Therefore Quads containting those objects cannot be imported to an rdflibjs store, although they are compliant to RDF/JS.
Why is the hasOwnProperty check needed, instead of just checking whether obj.termType is present?
Some RDF/JS compatible libraries like comunica return instances of es6 classes. For those the type guard using
hasOwnProperty
inisRDFlibObject
fails, althought the object has a getter fortermType
. Therefore Quads containting those objects cannot be imported to an rdflibjs store, although they are compliant to RDF/JS.Why is the
hasOwnProperty
check needed, instead of just checking whetherobj.termType
is present?Sources: