Const
Test if a value is an instance of a given relation type.
Mirrors Obj.instanceOf but only accepts Type.AnyRelation — use Obj.instanceOf for objects and Type.isType for Type.Type entities.
Obj.instanceOf
Type.AnyRelation
Type.isType
Type.Type
const isEmployedBy = Relation.instanceOf(EmployedBy);if (isEmployedBy(relation)) { // relation is EmployedBy} Copy
const isEmployedBy = Relation.instanceOf(EmployedBy);if (isEmployedBy(relation)) { // relation is EmployedBy}
O(1) type-URI comparison with a typename fallback; no schema validation.
Test if a value is an instance of a given relation type.
Mirrors
Obj.instanceOfbut only acceptsType.AnyRelation— useObj.instanceOffor objects andType.isTypeforType.Typeentities.