Don't use set union in appending nodes to Term?
Created by: dchandekstark
The use case is I want to append nodes to a term only if they are not isomorphic (RDF::Isomorphic) with an existing node. The <<
append method in Term uses set union on two Arrays, which relies on eql?
and hash
for comparison. It would be convenient if the method filtered out values using include?
, which uses ==
for comparison, and so is more safely overridden in a Resource class (I think).
Another possibility I suppose is to fork how appending behaves based on whether the Resource class implements RDF::Isomorphic and/or an explicit option is given (isomorphic: true
or something) in the property definition.
I am able to work around this (I would not call it a bug), but I'm asking the question to see what folks think.