NORMA as a graph database modeling tool? #47
Replies: 2 comments 3 replies
-
|
Hi! there is definitively some research going on, but I'm not aware of a complete and out of the box solution (maybe someone else nows more). There are two Master's thesis from 2017 that deal with the topic: Alicia Owen. “Mapping ORM to TGraph”. MA thesis. University of Koblenz-Landau, 2017. Marios Braimniotis. “A Transformation from ORM Conceptual Models to Neo4j Graph Database”. MA thesis. Radboud University Nijmegen, 2017. I was involved in the first one. However, there we used TGraphs, which are a nice fit, as they are schema-based, but sadly this technology is a research prototype and not maintained anymore. Nevertheless, some general concepts should be applicable for more modern graph databases, too. In some other project, we did a manual mapping to a Neo4J database and used Cypher queries to check constraints and derivations - for sure, most of this should be possible to generate automatically. |
Beta Was this translation helpful? Give feedback.
-
|
Hi John, I'm glad you're happy to find that NORMA is still alive and kicking. I'll be the first to admit that I have minimal exposure to graph databases, effectively limited to a couple of hours reading with a focus on potentials for mapping to ORM. My initial impression is that a mapping could be achieved with annotation directly on native ORM elements (object types, fact types and roles). Direct annotation is an important distinction when compared to a relational database, which has a much different structure than an ORM model and cannot be sufficiently customized by marking up ORM elements. Columns are composed of chains of roles, so a fact type or role is frequently associated with multiple columns, making direct ORM markup insufficient for relational mapping. I think the first question to ask is whether the notion of a 'graph database' is sufficiently defined that we can create a sufficient logical representation of a generic graph database that could then be rendered to multiple physical implementations. This is the approach taken with relational mapping, where there are multiple levels of representation: the data in the .ORM file has basic tables, columns and key/ref constraints, this is mapped to a DCIL XML format (adds data types, domains, check constraints), then DDIL XML (a generic XML representation of DDL), then finally RDBMS-specific DDL statements. (You can see all of these intermediate representations as children of the .orm model node in the VS Solution Explorer). The physical implementation is really not even considered until the final rendering step. The question here is whether a similar approach can be taken with a generic logical graph database structure that can be rendered to a specific API/schema as a final step. The costs of adding NORMA features (the cost-scale on this is logarithmic, not linear).
Similar Mapping(This is off topic, but related to the above list). If you look on the https://youtube.com/@ORMSolutions channel you'll see some videos that were done for a recent ESA (European Space Agency) conference. They currently have a large initiative using ORM to (re)model large space systems. Much of the content focuses on work done for what I call the JavaScript Fact Engine (JFE), which is a framework designed to represent an ORM model, along with corresponding back-end generated code to read a model-based JSON query and write a JSON-ized StateChange. The two main objectives are:
The generated code and related analysis pieces are already advanced (I can import any JFE StateChange data to a relational database with a single web method, including changes as large as the import of an entire ORM model to the database), I am still on stage 1 (custom property definitions) in the list above, meaning that I need to manually add JFE custom properties to include fact types and object types in the system. I obviously plan to move this to stage 2 (custom extension and automatic model generation and naming), but it is unlikely I will push it to stage 3 simply because the structure closely mirrors the ORM model itself. To circle back, as this is a JavaScript system, the framework runs outside the browser (NodeJS, etc.). However, while there some relational mappings systems I could attempt to target, the relational database backend is not necessarily preferred in this environment, so having a mapping that can define/read/write alternate systems (graph, document, etc.) would be a welcome enhancement. Cooperation?I'd be happy to do a call on this where we can discuss possible ways to move this forward. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there! I'm really thrilled to see this project has stayed alive and that there is an easily added extension that works in VS 2022! That's a testament to the maintainers for sure, as I know this project goes back a long ways. My career has taken me away from standing up new data models so I only recently started thinking about ORM and NORMA after looking at graph databases and thinking to myself, "this feels like ORM would be a perfect fit"
I am still ramping up on graph databases theory wise, so I don't have a firm grasp on direct concept translations when it comes to edges vs. foreign keys, or how the NORMA schema model might translate, but I was wondering if you are aware of ORM being used to design graph db schemas? I came across some posts by Victor Morgante discussing this that seemed to reinforce the notion.
I would be interested in looking into possibly generating Apache Gremlin API commands that could establish a schema using vertexes, edges, and properties. There are some higher level concepts like labels that I don't think ORM has a representation for - but I've been away from ORM for so long I really don't know. Would be interested to know your thoughts.
Beta Was this translation helpful? Give feedback.
All reactions