How can one represent foreign key and primary key relationships between documents in MarkLogic like done between tables/records in relational databases?
Connections among entities are represented differently in MarkLogic than they are in relational databases. The common approach in MarkLogic is to represent entities as documents (either XML or JSON) and to connect them using RDF triples. Benefits to this include discoverable relationships and connections to ontologies that provide context to the entity data.
For a more detailed answer, I'll refer you to a blog post I wrote recently: Evolution of Modeling Relationships in MarkLogic.