Skip to content

Commit 1e59668

Browse files
authored
Merge pull request #12 from matheuslenke/refactor/fixing-tonto-import-for-catalog
Refactor/fixing tonto import for catalog
2 parents c342534 + a99c863 commit 1e59668

File tree

144 files changed

+11802
-5494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+11802
-5494
lines changed

.eslintrc.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
"@typescript-eslint"
1919
],
2020
"rules": {
21-
"indent": [
22-
"error",
23-
2
24-
],
21+
"indent": "off",
22+
"@typescript-eslint/indent": ["error"],
2523
"linebreak-style": [
2624
"error",
2725
"unix"

.vscode/launch.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]
2020
},
2121
{
22-
"name": "CLI: Import Modular",
22+
"name": "CLI: Import From JSON",
2323
"program": "${workspaceFolder}/packages/tonto/bin/cli",
2424
"request": "launch",
2525
"skipFiles": [
@@ -28,7 +28,8 @@
2828
"type": "node",
2929
"args": [
3030
"import",
31-
"${workspaceFolder}/examples/library/ontology.json"
31+
"${workspaceFolder}/examples/newGeneration/ontology.json",
32+
"generated"
3233
]
3334
},
3435
{
@@ -41,7 +42,7 @@
4142
"type": "node",
4243
"args": [
4344
"validate",
44-
"${workspaceFolder}/examples/library",
45+
"${workspaceFolder}/examples/newGeneration",
4546
"--local",
4647
">> errors.txt"
4748
]
@@ -96,7 +97,8 @@
9697
"request": "launch",
9798
"args": [
9899
// "${workspaceFolder}/../tonto-example-models/Library",
99-
"${workspaceFolder}/../tonto-catalog/models/abel2015petroleum-system",
100+
// "${workspaceFolder}/../tonto-catalog/models/abel2015petroleum-system",
101+
"${workspaceFolder}/examples/newGeneration",
100102
"--extensionDevelopmentPath=${workspaceFolder}/packages/tonto-vscode"
101103
],
102104
"outFiles": [

examples/University/CoreDatatypes.tonto

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package PersonAndOrganizationDatatypes
2+
3+
datatype int specializes number
4+
5+
datatype Address {
6+
country: string
7+
city: string
8+
postalCode: string
9+
street: string
10+
streetNumber: int
11+
}
12+
13+
enum EyeColor { Blue, Green, Brown, Black }
14+
15+

examples/University/PersonPhases.tonto

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/University/Persons.tonto

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import PersonAndOrganizationDatatypes
2+
3+
package Persons
4+
5+
kind Person {
6+
age: number { derived }
7+
eyeColor: EyeColor [1..2]
8+
birthDate: date { const }
9+
firstName: string
10+
preferredNames: string [1..*] { ordered }
11+
}
12+
13+
type PersonTypeByAge
14+
15+
phase Child
16+
phase Teenager
17+
phase Adult
18+
19+
disjoint complete genset PhasesOfPerson {
20+
general Person
21+
categorizer PersonTypeByAge
22+
specifics Child, Teenager, Adult
23+
}
24+
25+
role UniversityStudent specializes Person
26+
27+
role Employee specializes Person
28+
role Professor specializes Employee
29+
30+
role PhDCandidate specializes Person

examples/University/University.tonto

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,28 @@
1-
import CoreDatatypes
2-
import PersonPhases
1+
import PersonAndOrganizationDatatypes
2+
import Persons
33
package University
44

55
category Organization
66
kind University specializes Organization {
77
address: Address
8-
@componentOf
9-
[1] <>-- has -- [1..*] Department
10-
@componentOf
11-
[1] <>-- [0..*] Classroom
8+
@componentOf [1] <o>-- has -- [2..*] Department
129
}
1310

14-
relation Department [1] <>-- [1] JuniorStaff
11+
relation Department [1] -- [1] Staff
1512

1613
kind Department {
17-
name: string
14+
[1] -- constitutedBy -- [1] Staff
1815
}
19-
collective Staff
20-
subkind JuniorStaff specializes Staff
21-
22-
kind teste {
23-
16+
collective Staff {
17+
@memberOf [1..*] <>-- members -- [2..*] Employee
2418
}
2519

26-
kind Room
27-
subkind Classroom specializes Room
28-
29-
// collective Staff {
30-
// [1] <o>-- hasMember -- [0..*] Employee
31-
// }
32-
33-
subkind SeniorStaff specializes Staff
34-
35-
roleMixin Employer
36-
37-
role UniversityEmployer specializes Employer, University
20+
collective SeniorStaff {
21+
@subCollectionOf [1] --<o> [1] Staff
22+
@memberOf [1..*] <>-- professors -- [2..*] Professor ({subsets members})
23+
}
3824

39-
relator EmploymentContract {
40-
@mediation
41-
[1..*] -- [1] Employee
42-
@mediation
43-
[1..*] -- [1] Employer
44-
}
25+
relator PhDEnrollment {
26+
@mediation [*] -- [1] University
27+
@mediation [1..*] -- [1] Persons.PhDCandidate
28+
}

examples/University/test.tonto

Lines changed: 0 additions & 121 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import SPO
2+
import RDBSO
3+
import SwO
4+
5+
package DBSO
6+
7+
category DBMS_Item of functional-complexes specializes Software_Item
8+
9+
subkind Data_Language of functional-complexes specializes Language
10+
11+
collective Database specializes DBMS_Item {
12+
[1] -- [1..*] Data_File
13+
}
14+
15+
subkind Data_Schema of functional-complexes specializes Schema
16+
17+
kind Schema specializes DBMS_Item {
18+
[1..*] -- describes -- [1] Database
19+
}
20+
21+
subkind Information_Schema of functional-complexes specializes Schema {
22+
[1] -- defines -- [0..*] Data_Schema
23+
}
24+
25+
kind Dictionary specializes DBMS_Item {
26+
[1] -- records -- [1..*] Schema
27+
[1] -- records -- [1..*] DBMS_Account
28+
}
29+
30+
kind DBMS_Account specializes DBMS_Item
31+
32+
subkind DBMS specializes Software_System {
33+
[0..*] -- adopts -- [1] Data_Language
34+
}
35+
36+
mode Loaded_DBMS_Copy specializes Loaded_Software_System_Copy {
37+
[0..*] -- manages -- [1..*] DBMS_Item
38+
[0..*] -- materialization_of -- [1] DBMS
39+
}
40+
41+
subkind Database_System of functional-complexes specializes Computer_System {
42+
[1] -- has -- [*] DBMS_Item
43+
[1] -- has -- [1..*] Loaded_DBMS_Copy
44+
}
45+

0 commit comments

Comments
 (0)