How to link nodes of same type together?

Thanks for your reply.
As i understand person and friend fields in your request should be uid type. But what should i do, if id’s wasn’t created by dgraph? This hashes is uint64 from another db.