Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Orphaned staging graph on ModelLoad #156

Open
dlamoris opened this issue Sep 26, 2024 · 0 comments
Open

Orphaned staging graph on ModelLoad #156

dlamoris opened this issue Sep 26, 2024 · 0 comments

Comments

@dlamoris
Copy link
Contributor

dlamoris commented Sep 26, 2024

On ModelLoad - the loaded graph replaces the previous staging graph of a branch and the previous staging graph is orphaned .
https://github.com/Open-MBEE/flexo-mms-layer1-service/blob/develop/src/main/kotlin/org/openmbee/flexo/mms/routes/gsp/ModelLoad.kt#L440

There is a separate but related issue to how the ?_interim lock is added/deleted during a ModelLoad/ModelCommit - during the call to genCommitUpdate (used by both ModelLoad and ModelCommit)

  • an ?_interim lock was supposed to be created to point to the previous ?model snapshot
    • this was supposed to point to ?model from the 'where' clause, which comes from BRANCH_COMMIT_CONDITIONS in Conditions.kt
    • ?model was never bound because the condition morc: was supposed to be ?baseCommit (and this clause was commented out at some point)
//                    # optionally, its model snapshot
//                    morc: ^mms:commit/mms:snapshot ?model .
//                    ?model a mms:Model ;
//                        mms:graph ?modelGraph .
//                }
  • at the end of ModelCommit/ModelLoad, the ?_interim lock gets deleted as well as the model graph - but graph delete never worked because it didn't get related to the right model, plus there was a syntax error (the syntax error is fixed in the feat/ldp branch, link to syntax error issue malformed query exception #130 )
    • in addition, this doesn't check if there are other locks pointing to the ?model (which would prevent the delete since a commit lock is automatically created after each model load/commit)

Proposed fix would be to delete the previous staging graph on model load instead.

Relevant files and lines:

@dlamoris dlamoris converted this from a draft issue Sep 26, 2024
@dlamoris dlamoris mentioned this issue Sep 26, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant