Ticket #341 (closed Enhancement: fixed)
Association Definitions with custom Association Types
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.6 |
Component: | DeepaMehta Standard Distribution | Version: | 4.0.12 |
Keywords: | Cc: | dgf, Malte | |
Complexity: | 8 | Area: | Data Model |
Module: | deepamehta-core |
Description (last modified by jri) (diff)
When defining a composite type it should be user configurable which association type to be used at instance-level for representing the parent-child relationship.
Currently the instance-level association type is fixed and is determined by the association definition type used:
Type-level Association Type | Instance-level Association Type |
---|---|
Composition Definition | Composition |
Aggregation Definition | Aggregation |
The parent-child semantic is preserved. Consequently the role types are still fixed (Parent, Child). They are not user configurable.
Model
To each Association Definition an additional Association Type is assigned -- the Instance-level Association Type. Every association type, regardless of simple or composite, is applicable -- also user defined ones. The assignment is optional. If no Instance-level Association Type is assigned the standard one is used (see above).
Webclient GUI
For composite topics the detail panel shows -- for each child topic -- also the (simple or composite) values of the association leading to that child. So, in the API jargon the detail panel renders hierarchies of Related Topics (instead of hierarchies of Topics). A Related Topic is a topic-association pair. This applies to both, the detail panel's info rendering and the form rendering.
Association fields can be excluded from rendering by the means of the (association type's) View Configuration's hidden and locked settings. (Analogous to the topic type's view configurations.)
Protocol
In an update request the childs property does not contain sole topics, but Related Topics. That is the request does not only update the topic values but also the association values (of the Relating Associations in the API jargon).
The same could apply to create requests.
(See also #647)
Change History
comment:4 Changed 10 years ago by JuergeN
As I am not sure if this is covering my needs completely, I feel like writing a bit more:
As a user I want to be able to create new (custom) composition types and aggregation types and give them a meaning (like with the existing custom association types). I think this is needed to be able to use DM fully semantical.
Examples:
To specify a private address and a work address, for the very moment it is necessary to add "labels" (another TopicType?) in between the relations. But in the sense of semantic modelling I want to modell them like this:
Address[1]---is WORK ADDRESS of--->Person[1]
Address[2]---is PRIVATE ADDRESS of--->Person[1]
which equals (instance in details panel):
Maria Mustermann ... * Address (TopicType) - Foobarstr. 123, 456789 City, Country (WORK ADDRESS) <--custom aggregation type - Barfoostr. 321, 456789 City, Country (PRIVATE ADDRESS) <--custom aggregation type
Same is true for custom composition types of course ...
This feature is urgently needed, so that people can model their composites in the right way asap.
comment:5 Changed 10 years ago by jri
No, this would NOT be supported by the type model proposed in this ticket.
The current concept is: attach an Association Definition with the information which Association Type to be used at instance-level. That is one instance-level association type per association definition. What would be the one instance-level association type in your example? You use 2.
You could have one association type Address Entry with subtypes Work Address and Private Address. But in DM4 we deliberately do NOT support inheritance. So there are no subtypes.
Instead you could model your case as follows: use Address Entry as the instance-level association type, and have Address Label as a Child Type of Address Entry. Address Labels's could be home, work ... or just undefined as well. So, that's basically the Address model utilized at the moment but without the Address Entry topic in between (currently Address Entry is a topic type, not an association type).
comment:6 Changed 10 years ago by JuergeN
ok - I think this is just a bit of confusion. I was not thinking about inheritance. I think we are on the same track. Let's try to sirt this out. I want to be able to create a custom association definition including the name (label) of the association type and to dertermine which Association Type to be used at instance level, where Association Type can be
- Aggregation
- Composition
- Association (directional or undirectional)
I want to use it on both levels, in the type builder and on instance level. I think it is exactly what yu are saying:
use Address Entry as the instance-level association type, and have Address Label as a Child
Type of Address Entry. Address Labels's could be home, work ... or just undefined as well. So,
that's basically the Address model utilized at the moment but without the Address Entry topic
in between (currently Address Entry is a topic type, not an association type).
Let me try to give you another example: I want to add a birthday to every PersonType?, by defining a custom aggregation definition "Birthday" between PersonType? and a DateType?:
So in the Type Level it would look like this:
PersonType?(parent)-----custom AggregationDefinion? named Birthday----->DateType?(child)
On the instance level (map) it should look like this:
Peter-----Birthday(aggregation)-----13.03.1973
In the details panel (edit mode) it could look like this:
---------------
|Peter Miller |
---------------
...
Birthday [Date]
------------------
|v| 13.03.1973|
------------------
On instance level I could also use the Birthday aggregation as a custom association to make a connection between two other existing topics on the map.
Are we on the same track?
comment:7 follow-up: ↓ 8 Changed 10 years ago by jri
When you wrote this instance-level example:
Address[1]---is WORK ADDRESS of--->Person[1]
Address[2]---is PRIVATE ADDRESS of--->Person[1]
do you mean one association definition is underlying here (then we're not on the same track), or do you mean two association definitions are underlying here (we're on the same track then).
Rendering of the Detail Panel is a different thing.
I don't understand the details (resp. your underlying rules) of your Birthday example.
- You talk about a named Aggregation Definition, but Aggregration Definitions are not named.
- Do you mean that in the map rendering each "Birthday" association should be rendered with the label "Birthday". According to what rule might this happen then?
- The Detail Panel would not render "Birtday" as the field header, but "Date" (the topic type). According to what rule "Birthday" (an association type) could be rendered here?
So, I understand intuitively what you want accomplish but to me it looks rather like an ad-hoc example without underlying rules.
Do you like to call me? This get too complicated here.
comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 10 years ago by JuergeN
Replying to jri:
When you wrote this instance-level example:
Address[1]---is WORK ADDRESS of--->Person[1]
Address[2]---is PRIVATE ADDRESS of--->Person[1]
do you mean one association definition is underlying here (then we're not on the same track), or do you mean two association definitions are underlying here (we're on the same track then).
Two! :)
Rendering of the Detail Panel is a different thing.
I don't understand the details (resp. your underlying rules) of your Birthday example.
- You talk about a named Aggregation Definition, but Aggregration Definitions are not named.
- Do you mean that in the map rendering each "Birthday" association should be rendered with the label "Birthday". According to what rule might this happen then?
- The Detail Panel would not render "Birtday" as the field header, but "Date" (the topic type). According to what rule "Birthday" (an association type) could be rendered here?
So, I understand intuitively what you want accomplish but to me it looks rather like an ad-hoc example without underlying rules.
Do you like to call me? This get too complicated here.
Yes, I will call you ...
comment:9 in reply to: ↑ 8 Changed 10 years ago by jri
Replying to JuergeN:
Two! :)
Yeah, OK. I understand your idea then.
However, having one Association Definition for each "label" (that is "home", "work", ...) makes modeling cumbersome in case another label should be added. A complete Association Definition must be created, along with Assoc Type, Cardinality, ... settings. That is much more labor than needed, and a source for errors.
With my suggestion -- define "Address Entry" as a composite Association Type, with "Address Label" as a simple child topic type -- things become easy and natural: a new address label, e.g. "holiday", can be introduced just by creating another "Address Label" instance.
comment:10 Changed 10 years ago by JuergeN
So here is what we want to do after we talked:
- The user shall create a new AssociationType?
- As AssociationTypes? can also be a composite, for modelling the Address Entry example above (jri's suggestion), the user would do the following:
a) create new Association Type "Address Entry" of data type 'composite'
b) create new Topic Type "Address Label" of data type 'text'
c) associate the two objects with an Aggregation Definition, where "Address Entry" is the parent type and "Address Label" is the child type.
- The GUI must provide the possibility to asign an arbitrary association type to an association definition (Aggregation Definition or Composition Definition).
PS: Most of this is already there: I have just created a new AssociationType? "Address Entry" as a composite and modelled it the way I described above. It works just as it should. So on instance level one can already create custom associations where you can then choose the pre-defined values from your composition definition. WOW! That's DeepaMehta! :)
comment:11 follow-up: ↓ 12 Changed 10 years ago by jri
- Status changed from new to accepted
Development on this feature starts now.
We need it also in conjunction with #696.
comment:12 in reply to: ↑ 11 Changed 10 years ago by jri
- Milestone set to Release 4.6
Replying to jri:
We need it also in conjunction with #696.
This has not proved true, see ticket:696#comment:2
Anyways, development of this feature (see ticket description) starts NOW.
comment:15 Changed 10 years ago by Jörg Richter <jri@…>
comment:16 Changed 10 years ago by Jörg Richter <jri@…>
comment:17 Changed 10 years ago by Jörg Richter <jri@…>
comment:18 Changed 10 years ago by Jörg Richter <jri@…>
comment:19 Changed 10 years ago by Jörg Richter <jri@…>
comment:20 Changed 10 years ago by Jörg Richter <jri@…>
comment:21 Changed 10 years ago by JuergeN
Hi Jörg, I just recently started with testing this feature. In the very recent version of 4.6 nightly (Demo Server - logged in as admin ) it seems the feature is not yet available when editing the assoc dev in the webclient. Is this on purpose?
comment:22 Changed 10 years ago by jri
You could test the feature when building from branch inst-level-assoc-type (instead of master). I'm hesitant to merge it as long as it is not ready for release as this would make releasing a possible 4.5.1 (without that feature) much more cumbersome. But when we decide not to release a 4.5.1 we could do the merge now.
Your testing is appreciated very much!
comment:23 Changed 10 years ago by JuergeN
I do not want to interfere with your release plannings at this point. There might be good reasons for a soonish 4.5.1 release. Just let me know about your schedule and ping me when it's time to get back to this.
comment:24 Changed 10 years ago by Jörg Richter <jri@…>
comment:25 Changed 10 years ago by Jörg Richter <jri@…>
comment:26 Changed 10 years ago by Jörg Richter <jri@…>
comment:27 Changed 10 years ago by Jörg Richter <jri@…>
comment:28 Changed 10 years ago by Jörg Richter <jri@…>
comment:29 Changed 10 years ago by Jörg Richter <jri@…>
comment:30 Changed 9 years ago by Jörg Richter <jri@…>
comment:31 Changed 9 years ago by Jörg Richter <jri@…>
comment:32 Changed 9 years ago by Jörg Richter <jri@…>
comment:33 Changed 9 years ago by Jörg Richter <jri@…>
comment:34 follow-up: ↓ 35 Changed 9 years ago by JuergeN
Just a funny observation: When one edits the color code in the view config of an association type that is included in a custom association definition, the result on instance level varies. Especially after changing the color again, the results seam coincidental. (Observed on nightly build today.)
comment:35 in reply to: ↑ 34 Changed 9 years ago by jri
Replying to JuergeN:
Just a funny observation: When one edits the color code in the view config of an association type that is included in a custom association definition, the result on instance level varies. Especially after changing the color again, the results seam coincidental. (Observed on nightly build today.)
The color value you input must be a valid CSS color, that is e.g. #cc00cc. The # is mandatory here. I saw this was missing. This should solve the problem.
comment:36 Changed 9 years ago by Jörg Richter <jri@…>
comment:37 Changed 9 years ago by Jörg Richter <jri@…>
comment:38 Changed 9 years ago by Jörg Richter <jri@…>
comment:39 Changed 9 years ago by Jörg Richter <jri@…>
comment:40 Changed 9 years ago by Jörg Richter <jri@…>
comment:41 Changed 9 years ago by Jörg Richter <jri@…>
comment:42 Changed 9 years ago by Jörg Richter <jri@…>
comment:43 Changed 9 years ago by Jörg Richter <jri@…>
comment:44 Changed 9 years ago by Jörg Richter <jri@…>
comment:45 Changed 9 years ago by Jörg Richter <jri@…>
comment:46 Changed 9 years ago by Jörg Richter <jri@…>
comment:47 Changed 9 years ago by Jörg Richter <jri@…>
comment:48 Changed 9 years ago by jri
- Status changed from accepted to closed
- Resolution set to fixed
comment:49 Changed 9 years ago by Malte
Associations, Aggregations, Compositions will need arbitrary (many different) customTypeAssocs on instance-level and not _pre-defined_. Definitions are type-level. The desired support of the wikidata plugin for this ticket was to extend the Core API at AssociationModel?-level and not on the AssociationDefinitionModel?-level and i thought you were on the right track (because i just took notice of "custum assoc types on instance-level" and that's why i didnt care any longer about the details of this ticket.
Now i see that i was wrong and i am sorry that i could not support you in this. This implementation was conceptualized and developed with a clear webclient/user-perspective but not with a plugin developers perspective. Consequently, wikidata properties (see https://www.wikidata.org/wiki/Wikidata:List_of_properties) can now not become first class 'Association Types' and not benefit of dm4-core semantics such as Association, Aggregations or Compositions.
Maybe we can solve this the next time we come around this issue. Currently this issue is anyway not related to the immediate development of the wikidata plugin and thanks for your efforts.
comment:50 follow-up: ↓ 51 Changed 9 years ago by Malte
Is there a way to define a custom association type (e.g. for one specific aggregation definition of a composite topic) in a declarative migration?
comment:51 in reply to: ↑ 50 Changed 9 years ago by jri
Replying to Malte:
Is there a way to define a custom association type (e.g. for one specific aggregation definition of a composite topic) in a declarative migration?
Yes, I think so. Look at the Contacts module's migrations.
Sorry, I'm in a hurry ...