simphony-osp icon indicating copy to clipboard operation
simphony-osp copied to clipboard

Data migration of db wrapper upon ontology update

Open yoavnash opened this issue 5 years ago • 8 comments

Updating the underlying ontology might make a DB used by a DB wrapper unusable due to a change in the DB schema or another reason depending on the wrapper implementation. Since ontology updates are possible and expected to occur, it would be beneficial to offer a generic solution to this problem.

yoavnash avatar Aug 27 '20 15:08 yoavnash

Naive solution: have two db-wrappers each with a separate database where one follows the old schema and the other follows the new one. Write an OSP-core script that reads all the data from the old DB, updates it according to the new schema, and then adds it to the new DB.

yoavnash avatar Aug 27 '20 15:08 yoavnash

But the naive solution doesn't cover the ontology update case, does it?

urbanmatthias avatar Aug 28 '20 05:08 urbanmatthias

Even if the two versions of the ontology have two separate namespaces (so they can be installed at the same time)?

yoavnash avatar Aug 28 '20 07:08 yoavnash

Ontology version 1: Entity A has attribute C. Ontology version 2: Entity A is related to B. B has attribute C.

If you have all data in ontology v1 format, how would you introduce the B instances? The naive solution you propose wouldn't. Or would it?

urbanmatthias avatar Aug 31 '20 05:08 urbanmatthias

b = myonto_v2.B(c=old_a.c)
a = myonto_v2.A()
a.add(b)

yoavnash avatar Oct 07 '20 08:10 yoavnash

Decisions from the meeting last week:

  • As a first solution, we want to support a way that allows a user to manually update his data.
  • There should be a tool that supports the ontology updates that have been made.
  • Two discussed solutions:
    1. Special ontology update mode where union of ontologies is installed. The user can then update his cuds objects to the new ontology.
    2. Allow to install the new ontology under a new name. Then the user can recreate the data under the new ontology. Problem: After the new ontology has been removed, the user might want to rename the new ontology.

--> We try solution 1 first. --> There should be an example that explains the ontology update procedure.

urbanmatthias avatar Nov 02 '20 07:11 urbanmatthias

@yoavnash if I understood correctly, your modular design should help in this regard correct? Do you want to add a couple of sentences?

urbanmatthias avatar Mar 17 '21 07:03 urbanmatthias

One idea that we could explore is the use of a standard mapping tool to achieve the following kind of flow: image

Such a tool can have the following functionality: image

yoavnash avatar Mar 17 '21 09:03 yoavnash