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
Libraries can choose to have API functions that accept RDFJS Terms as well as some other types of objects. For these cases, it may be useful to define a static property on Term to distinguish Term objects from others.
While testing for a truthy .termType might seem sufficient, it is arguably not semantically robust enough. Perhaps defining a static boolean .isRDFJSTerm property on Term would enable universal duck typing?
The text was updated successfully, but these errors were encountered:
It's definitely good to have this discussion: the spec should define a test whether something is a Term.
I think that we can manage with existing properties though, such as indeed termType. (If termType doesn't do the trick, than the odds are that .isRDFJSTerm also won't do.)
Libraries can choose to have API functions that accept RDFJS Terms as well as some other types of objects. For these cases, it may be useful to define a static property on
Term
to distinguish Term objects from others.While testing for a truthy
.termType
might seem sufficient, it is arguably not semantically robust enough. Perhaps defining a static boolean.isRDFJSTerm
property on Term would enable universal duck typing?The text was updated successfully, but these errors were encountered: