Many-to-Many Relationships

Associative entities are represented differently in various data models

In the Past

A many to many relationship is represented with an associative entity. Experts and non-experts in IT field know that this is one of the most important topics in Entity-Relationship and Relational theory. Seven years ago, when I started my data modeling saga, searching for SQL joins returned numerous results and few of them were on XML data. But I could hardly find any discussion about how a join table is related to the theory of two international data model standards, namely RDF and Topic Maps. A year later, in 2010 W3C started publishing “A Direct Mapping of Relational Data to RDF”. Coincidentally, back in 2009-2010 the NoSQL movement was born and Graph Databases started becoming a hot topic but nodes and edges were shrouded in disorientation for users of relational databases.

In the Present

It is 2017 and in my opinion the situation with associative entities has become darn confusing. Edges of a Property Graph data model are bidirectional but RDF links are unidirectional. A bridge-table of an Entity-Relationship schema has links only at the many side, i.e. we have an intersection of two one-to-many relationships. Foreign keys of a bridge table can be conveyed to RDF objects but for integrity and cardinality constrains you have to use OWL. Topic Maps use bidirectional associations with roles, therefore they are closer to the property graph data model. Each data model has a query language SQL, SPARQL, TMQL, Cypher, OrientDB SQL and GraphQL. There are significant differences among them and you have to understand the model in order to process or store efficiently data.

Epilogue

I took a firm decision to clear a bit this info-glut with a series of articles in associative data modeling written with a hands-on practice style:

  • Part 1/6 is about Entity-Relationship data model
  • Part 2/6 discusses Topic-Map data model
  • Part 3/6 is focusing on Property Graph data model
  • Part 4/6 is explaining RDF Graph data model and Sentences associative data model
  • Part 5/6 is a demonstration of QlikView associative data model
  • Part 6/6 presents R3DM/S3DM associative semiotic hypergraph data modeling perspective

Cross-References

Athanassios I. Hatzis, PhD
Software Engineer - Researcher, Founder/Independent Contractor

Related