How can one represent foreign key and primary key relationships between documents in MarkLogic like done between tables/records in relational databases?
Asked
Active
Viewed 136 times
1 Answers
3
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.

Dave Cassel
- 8,352
- 20
- 38
-
Thanks for your answer. Can you explain the MarkLogic implementation of one to many relationship like one department has many employees. Also explain how to write and read the connected documents – lsk Aug 10 '18 at 04:09
-
1It sounds like you need to learn about the fundamentals of how MarkLogic (or document store) modeling works. Stack Overflow isn't really the place for that. MarkLogic University offers a Fundamentals self-paced course that would be a good start, with other courses available to follow up: https://mlu.marklogic.com/selfpaced/course/fundamentals/ – Dave Cassel Aug 10 '18 at 12:07
-
I went through all the basic documents of MarkLogic that is available online. Since I’m from a RDBMS background I couldn’t correlate the things with NoSQL. It would be good if you just explain the above business requirement – lsk Aug 10 '18 at 12:41
-
@Isk Just going through all the documents won't help, you need to practice things. Please go through this link, hope this would help you. `https://docs.marklogic.com/guide/semantics/intro` – Dixit Singla Aug 12 '18 at 18:00