-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for References in Map values #799
Comments
Can you please elaborate this issue? |
@kailash360 I've extended the issue description above with a high-level description. This is quite a big piece of work that touches many parts of the stack. I recommend decomposing it into phases. |
Hi @mttrbrts . I've been looking into this issue and would like to take it up. |
Hi there. I have a doubt. I was looking through the parser.pegjs file and came across this grammar definition for - This includes handling of the relationship property syntax. Also, I think the parser should be able to parse relationship properties in the current state. To verify this, I tried testing the parser on the online version of peggy. I tested it using this model.
which contains the new syntax. The input was parsed successfully. Am I correct in assuming that the parser does not require any changes to support the new syntax? |
You're right @apoorvsxna. The It looks like you're right, the parsing logic appears to already be there. The next step if to extend the introspection API to validate the AST JSON that parsing produces. |
I've made some changes in the metamodel and validation and am now able to compile models containing map values that have the relationship property syntax. |
Hi @apoorvsxna If you are just parsing the cto model to get JSON AST, (if you man compiling = parsing). I don't believe that's going to change. |
@sanketshevkar I am referring to compiling using I compiled these to Java, and the result was identical, apart from the package name of course. Model (containing the new relationship map value syntax) -
Generated code (same for both models- with/without relationship map value)-
In order to represent |
I think this issue requires to add maps to support relationship types as keys. That means we need concerto to parse cto file, generate the JSON AST and validate the metamodel in the AST. This all would reside in The |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Feature Request 🛍️
Extend Map Declarations to allow reference types for values.
e.g.
Use Case
Today, Concerto supports two types of properties in declarations
o
notation, https://concerto.accordproject.org/docs/design/specification/model-properties-->
notation, https://concerto.accordproject.org/docs/design/specification/model-relationshipsMap Declarations are a new feature (which haven't been fully released, draft documentation is here). However, Map declarations only allow map value types to use child objects, e.g.
However, for many scenarios, it would be more semantically correct to allow foreign key relationships to objects rather than forcing containment in the map. For example, an AddressBook doesn't conceptually contain people, it should be a pointer to them instead.
The design for maps does not include relationship types for Map keys.
Possible Solution
Implementing this change requires touching multiple places in the code:
Context
Detailed Description
The text was updated successfully, but these errors were encountered: