]> gerrit.simantics Code Review - simantics/platform.git/blob - docs/Developer/Ontology/VersionMigration.md
First test on Simantics documentation using gitbook
[simantics/platform.git] / docs / Developer / Ontology / VersionMigration.md
1 This document addresses the issue of how simantics application migrates from one version to the next. The scope includes software and ontology development.\r
2 \r
3 ## Ontology Migration\r
4 An ontology is a compilation of shared *concepts* (=types, relations and instances).\r
5 \r
6     http://www.simantics.org/Layer0-1.0\r
7         http://www.simantics.org/Layer0-1.0/ConsistOf\r
8         http://www.simantics.org/Layer0-1.0/Library\r
9 \r
10 Ontologies are versioned according to the following scheme\r
11 \r
12     <Ontology URI>-<major version>.<minor version>\r
13 \r
14 For example\r
15 \r
16     http://www.simantics.org/Layer0-1.0\r
17 \r
18 All shared concepts contained in the ontology are accordingly versioned along with the ontology and the version number is visible in the URI. For ontological concepts we define\r
19 \r
20 * **versioned URI** as the proper URI of the resource e.g. `http://www.simantics.org/Layer0-1.0/ConsistsOf`\r
21 * **unversioned URI** where version information is omitted e.g. `http://www.simantics.org/Layer0-0.0/ConsistsOf`\r
22 \r
23 Ontologies are deployed as OSGi bundles. Declarations in Simantics software may use the unversioned URI to refer to concepts in the *latest* version on an ontology (or the version found from OSGi dependencies). An utility class for converting between **versioned URI** and **unversioned URI** is defined in class **org.simantics.scl.reflection.OntologyVersions**.\r
24 \r
25 Additionally we define\r
26 \r
27 * **working ontology** as an ontology bundle which contains the **latest** version of the ontology e.g. *org.simantics.simulation.ontology*\r
28 * **released ontology** as an ontology bundle which is frozen, renamed and never again changed e.g. *org.simantics.simulation.ontology-1.1*\r
29 \r
30 The following simple rules for ontology development are defined to enable version migration\r
31 \r
32 ### Modelling rules\r
33 \r
34 1. All ontology versions shall be completely self-contained. All concepts are declared in all versions of an ontology.\r
35 2. There shall be exactly one ontology (L0.Ontology) defined in each ontology bundle.\r
36 3. The **Bundle-Name** of an ontology shall be the unversioned URI of the ontology without the '-0.0' suffix e.g. <nowiki>http://www.simantics.org/Simulation</nowiki>\r
37 4. The first two digits of the **Bundle-Version** of an ontology shall be the ontology version as specified in the ontology URI e.g. '1.2'\r
38 5. The **Bundle-SymbolicName** (bundle id) of a working ontology is unchanged when versions grow (e.g. org.simantics.simulation.ontology)\r
39 6. The **Bundle-SymbolicName** (bundle id) of a frozen ontology is a version-dependent derivative of the id from the working ontology (e.g. org.simantics.simulation.ontology-1.1)\r
40 \r
41 ## Model Migration\r
42 \r
43 A project in a database contains models of different versions created with different versions of software features.\r
44 \r
45 The database can host multiple versions of ontologies which enables old models to exist and to be imported in the database. A typical software feature can only manipulate models defined with the latest versions of some ontologies.\r
46 \r
47 Software features can make model migration from models created with previous versions of the software. Each model is *associated in the database with a single software feature version*, which then can be used to determine the actions needed for migrating models to the latest ontological definitions. The version modelling is defined in **org.simantics.softwareconfiguration.ontology**.\r
48 \r
49 The user can browse the old and new models contained in the database and perform model migration at will.\r
50 \r
51 ## Making software releases\r
52 \r
53 A released Simantics feature uses a set of ontologies with specified version numbers. All models associated with a specific software version need access to these ontology versions even after the ontologies have evolved. Thus it is necessary to release and freeze all versions of used ontologies whenever a software is released. Thus the procedure for making a software release includes\r
54 \r
55 ### The release process\r
56 \r
57 * **Before the build**\r
58   1. Make usual tagging and branching of all released plugins in Subversion\r
59 * **Right after the build**\r
60   1. For all working ontologies which do not correspond to a frozen version : freeze ontology plugin and store as a tag\r
61   2. Increment the software version number of models\r
62 * **During modelling when ontology is first modified** (before this the working ontology was exactly some frozen ontology)\r
63   1. Increment ontology version number. (Include the corresponding frozen ontology into product dependencies to enable migration).\r