Add entity function

Similar to the Datomic function with the same name.