cardialfly / DALNIM

[DEPRECATED] Some source code and scripts for DALNIM
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Let "PrecedenceTask sub MIAEntity" #8

Closed cardialfly closed 2 years ago

cardialfly commented 2 years ago

Current version of the concept model TypeQL declares

PrecedenceTask sub entity;

This does not seem to match with the concept model diagram.

In addition, the mappings from/to BPMN entities need the UID in order to query and/or insert the mappings (with a match-insert clause), so I'd like to have the PrecedenceTask declaration changed to

PrecedenceTask sub MIAEntity;

cardialfly commented 2 years ago

Related issue: https://github.com/cardialfly/DALNIM/issues/6

hjyoon93 commented 2 years ago

I changed PrecedenceTask sub entity; to PrecedenceTask sub MIAEntity; and overwrote the existing file on GitHub. As this issue is resolved, I will close this one.

cardialfly commented 2 years ago

Reference to the commit that solved this issue: https://github.com/cardialfly/DALNIM/commit/a0ab3108be3efa63c60f3d4234549dc17c0f18cb

cardialfly commented 2 years ago

I'm reopening this issue because the concept_model.tql is not properly defining PrecedenceTask as a sub-entity of MIAEntity.

This seems to be happening because later lines are overwriting/overloading the previous declaration as follows:

Line 247: PrecedenceTask sub entity, plays isCompoundBySetOfTask:precedence_task;

Line 259: PrecedenceTask sub entity, plays isPrecededBySetOfTask:precedence_task;

Because of the above, TypeDB is "re-considering" that PrecedenceTask is a direct sub-entity of entity, not a sub-entity of MIAEntity as declared in line 22 anymore.

Probably, this is also causing the "Invalid Rule Write" error stating that the rule "can never be satisfied in the current schema."

Fixing the above lines should work. However, I'd suggest refactoring the _conceptmodel.tql to avoid redundant re-declarations (because there is no need to declare that some entity is a sub-entity of another entity multiple times in the same tql file).

cardialfly commented 2 years ago

Just declaring PrecedenceTask plays (...); instead of PrecedenceTask sub (...), plays (...); should work better because it won't re-declare the sub-entity relationship.

hjyoon93 commented 2 years ago

This has been fixed and pushed to the repo.