marklogic / entity-services

Data modeling and code scaffolding for data integration in MarkLogic
https://docs.marklogic.com/guide/entity-services
Apache License 2.0
7 stars 10 forks source link

Denormalized sub-entities #266

Open grechaw opened 7 years ago

grechaw commented 7 years ago

When putting entity instances into documents, one always chooses one to be the root, and others to embed or denormalize into the document structure.

Entity Services in MarkLogic 9 does not provide this vocabulary, but repeated use of the code generation indicates that it could be automated significantly with this extra concept.

  1. Entry point of a module is known.
  2. Expectations of whether a reference property contains an embedded instance or a reference to an external one.
  3. Refinement of extraction template to require less customization.
grechaw commented 7 years ago

This issue is a proposed design change, but it needs more grounding in scenario to map the capability to an implementation. Probably not for 9.0-3?

jmakeig commented 7 years ago

The other issue is more of an existential one: What is an entity? Is (the concept of) an “address” an entity? If you were the Post Office, maybe, but for many applications an address is a rich piece of data that only exists in the context (i.e. as a sub-property) of something else, like a Person or and Order.

As a Data Architect, I want to be able to define and reuse sub-entities, like Address. For example, in my Order entity the shipTo property is not a string, but a type Address. That “type” definition is defined elsewhere and, like xs:string can be reused by reference in multiple entities.

jmakeig commented 7 years ago
jmakeig commented 7 years ago

“weak” entities (so it matches next time I search)