Skip to content

Commit f1d049c

Browse files
authored
feat(ontology): new cardinality workflow (DSP-1652) (#455)
* refactor(ontology): init new cardinality workflow * refactor(ontology): more on cardinality * fix(ontology): update last modification date (DSP-1656) * feat(ontology): add prop and set cardinality * fix(ontology): update cardinality if prop not in use * fix(ontology): cardinality in form * fix(ontology): add property to res class * refactor(ontology): clean up code * feat(ontology): add existing prop to res class * test(ontology): fix tests * refactor(ontology): delete unused components and services * chore(app): undo previous import organisation * test(resource): fix routes issue in tests * fix(ontology): make ts-lint happy * docs(ontology): update ontology documentation * docs(ontology): update ontology documentation incl. refactoring * fix(ontology): bug and style fix in property form
1 parent 0ba0cfb commit f1d049c

37 files changed

Lines changed: 870 additions & 1563 deletions
233 KB
Loading
214 KB
Loading
271 KB
Loading
249 KB
Loading
255 KB
Loading
269 KB
Loading

‎docs/assets/style/theme.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
.md-tabs {
33
background-color: rgb(89, 73, 167) !important;
44
}
5+
6+
em {
7+
font-size: smaller;
8+
text-align: center;
9+
}

‎docs/how-to-use/project.md‎

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22

33
## Project
44

5-
Once you are [logged in](/user-guide/#login), the dashboard displays the list of your project(s). If you are a project administrator or a system administrator, you can edit the project information or archive your project from the project menu. Archived projects are stored in a list on your dashboard and they can be "reactivated" at any time.
5+
Once you are [logged in](/user-guide/#login), the dashboard displays the list of your project(s). If you are a project administrator or a system administrator, you can edit the project information or archive your project from the project menu. Archived projects are stored in a list on your dashboard and they can be "reactivated" at any time.
66

7-
![Project list and project menu](../assets/images/project-list.png)*https://app2.dasch.swiss/dashboard - By clicking on the project name, you get access to the full project information.*
7+
![Project list and project menu](../assets/images/project-list.png)*<https://admin.dasch.swiss/dashboard> - By clicking on the project name, you get access to the full project information.*
88

99
System administrator can create your new research project. Essential information are required such as the project name, a short project description and institution information.
1010

1111
![Create a new project](../assets/images/project-create-new.png)<center>*Form to create a new project.*</center>
1212

1313
As project administrator or system administrator, you can define your project, add your team members, create permission groups and as most important, define your data model (ontology) and the lists of your project.
1414

15-
![Project management available functionalities](../assets/images/project-info.png)*https://app2.dasch.swiss/project/0803/info - Project management functionalities; e.g. Incunabula project. Project information page is displayed without restricted content, the other functionalities are reserved for project admin and system admin.*
15+
![Project management available functionalities](../assets/images/project-info.png)*<https://admin.dasch.swiss/project/0803/info> - Project management functionalities; e.g. Incunabula project. Project information page is displayed without restricted content, the other functionalities are reserved for project admin and system admin.*
1616

1717
---
1818

1919
## Collaboration
20-
&#9888; *WORK IN PROGRESS*
2120

2221
As system admin, you can add users as project member and define their permissions roles: *Who is able to edit or to see data in the project?* Data includes the research sources and their metadata. [Permissions](/user-guide/project/#permission-groups) can be set for the entire project or for single metadata fields.
2322

2423
A user menu with different actions is accessible for each member of the project (link to the right side of the user line). The admin can appoint another user as project admin (or remove this permission), edit user's information, change user's password if forgotten, and remove a user.
2524

26-
![Collaboration page](../assets/images/project-collaboration.png)*https://app2.dasch.swiss/project/0803/collaboration - Collaboration page where project admin and system admin can add new user to the team.*
25+
![Collaboration page](../assets/images/project-collaboration.png)*<https://admin.dasch.swiss/project/0803/collaboration> - Collaboration page where project admin and system admin can add new user to the team.*
2726

28-
***Permissions for project admins to add new users as project member will be implemented soon.***
27+
> **_NOTE:_** **Permissions for project admins to add new users as project member will be implemented soon.**
2928
3029
---
3130

@@ -37,7 +36,6 @@ Project admin can create one or several permission groups in their project to se
3736
---
3837

3938
## Data model
40-
&#9888; *NOT YET IMPLEMENTED* (only mockups are presented)
4139

4240
The most important step in the project is the definition of the data model. DSP-APP will provide a tool for easy creation of data models. First, you have to know which data and sources you want to work with. The data model can be flexible and customizable. With DSP-APP, you can comply with the FAIR data standard, but compliance is not required to analyze your data.
4341

@@ -54,19 +52,38 @@ The questions to answer in creating your data model:
5452
- data about the person you interviewed
5553
- location where the photograph was taken
5654

57-
Diagram 1 shows the relationships of the data by source type from these experiences.
55+
Diagram 1 shows the relationships of the data by resource classes from these experiences.
56+
57+
![Relationship of the data by resource classes](../assets/images/diagram-data-model.png)*Relationship of the data by resource classes*
58+
59+
### Create your data model
60+
61+
Go to your project, select the tab `Data model` and click on button `New data model` or `Create your first data model` (in case of a brand new project). This will open a form in a dialog box where you have to set a unique name and a label. Optional you can also add a short description of form of a comment.
5862

59-
![Relationship of the data by source type](../assets/images/diagram-data-model.png)*Relationship of the data by source type*
63+
> **_NOTE:_** There are some rules for the unique name:
64+
>
65+
> - must be at least 3 characters long
66+
> - shouldn't begin with a number
67+
> - shouldn't begin with the letter v and a number
68+
> - spaces or special characters are not allowed
69+
> - the term "ontology" is not allowed
70+
> - the unique name can't be changed afterwards
71+
72+
The label is a combination of project's shortname and the unique name. You can replace with any other string.
73+
74+
![Data model editor | Step 1: Start by creating a new data model.](../assets/images/data-model-create.png)*Data model editor | Step 1: Start by creating a new data model.*
6075

6176
---
6277

63-
### Select your SOURCE TYPES
78+
### Create the resource CLASSES
6479

65-
In the data model editor, you select your source types from a predefined list on the right-hand side. Later, you will be able to customize the source type or define an additional default source type, if the one you need doesn't exist by default.
80+
In the data model editor, you create your resource classes by selecting a default representation type from a predefined list on the right-hand side.
6681

67-
![Data model editor 1: Select all your main source types by drag and drop; e.g. for an interview, select the source type "Audio / Sound / Interview".](../assets/images/data-model-add-source.png)*Data model editor 1: Select all your main source types by drag and drop; e.g. for an interview, select the source type "Audio / Sound / Interview".*
82+
Click on `+ Create new class` and select a representation type for your resource class.
6883

69-
In our example with the interview and the photographs, you drag and drop the following main source types from the list on the right-hand side:
84+
![Data model editor | Step 2: Create all your main resource classes by selecting a predefined representation type; e.g. for a taped interview, select the representation type "Audio / Sound / Interview".](../assets/images/data-model-class-select-representation.png)*Data model editor | Step 2: Create all your main resource classes by selecting a predefined representation type; e.g. for a taped interview, select the representation type "Audio / Sound / Interview".*
85+
86+
In our example with the interview and the photographs, you drag and drop the following main resource classes from the list on the right-hand side:
7087

7188
- Audio / Sound / Interview
7289
- Transcript
@@ -76,30 +93,42 @@ In our example with the interview and the photographs, you drag and drop the fol
7693

7794
---
7895

79-
### Select the METADATA fields for each source type (optional)
96+
### Select or create the PROPERTIES for each resource class
8097

81-
The predefined source types offer a suggested list of metadata fields. This list could help to create a data model simply and quickly. It's also possible to deselect the suggested metadata fields (e.g., no metadata), to adapt others and to customize them.
98+
<!-- TODO: nice idea, but not yet implemented >>> The predefined resource classes offer a suggested list of metadata fields. This list could help to create a data model simply and quickly. It's also possible to deselect the suggested metadata fields (e.g., no metadata), to adapt others and to customize them. -->
8299

83-
![Data model editor 2: Add additional metadata fields to your source type; e.g. add the missing field "Person".](../assets/images/data-model-add-property.png)*Data model editor 2: Add additional metadata fields to your source type; e.g. add the missing field "Person".*
100+
There are two possibilites to add properties to a resource class:
84101

85-
---
102+
#### Create new property by selecting from list of default property types
86103

87-
### Customize the SOURCE TYPES and the METADATA fields (optional)
104+
![Data model editor | Step 3: Add properties to your resource class by selecting from list of default property types.](../assets/images/data-model-property-select-type.png)*Data model editor | Step 3: Add properties to your resource class by selecting from list of default property types.*
88105

89-
It's possible to customize the predefined source type and the metadata field values by clicking on the edit button of the source type. You can rename the source type, rearrange the order of the metadata fields, and set permissions.
106+
#### Select from list of existing properties
90107

91-
![Data model editor 3: Customize the source type AUDIO; e.g. rename it into Interview](../assets/images/data-model-edit-source.png)*Data model editor 3: Customize the source type AUDIO; e.g. rename it into Interview*
108+
If you have already created some properties in another resource classes or in the property section <!-- TODO: add link to property section as soon this section exists --> you can select one of them to add it to the resource class. This way you have to define — for example — a "Title" property only once.
92109

93-
---
110+
![Data model editor | Step 3: Add properties to your resource class by selecting from list of already existing properties](/assets/images/data-model-property-select-existing.png)*Data model editor | Step 3: Add properties to your resource class by selecting from list of already existing properties*
111+
112+
In both cases it will open the property form where you have to define a label and optional a comment. If you have selected an existing property, you can also change the label and comment. Be careful in this case, because it can have an effect on other resource classes that use the same property!
113+
114+
The property type can't be changed here. Depending on the property type you have to set additional attributes, e.g. in a resource link property you have to select a resource class to which the property will point to. Similar in case of a list property where you have to select the corresponding list. In both cases a the linked resource class or the list should already exist.
115+
116+
![Data model editor | Step 4: Define property's label and comment and set the cardinality corresponding to the resource class.](../assets/images/data-model-property-create.png)*Data model editor | Step 4: Define property's label and comment and set the cardinality corresponding to the resource class.*
117+
118+
For each property in a resource class you can define some rules. For example you can define if one of the property can have `multiple` values or if a property is a mandatory (`requiered`) field.
119+
120+
After adding more than one property to a resource class you can change the displayed order by drag'n'drop the properties in the list.
121+
122+
<!--- TODO: add definition for each property type and maybe also for the representation type
94123
95124
### Connect SOURCE TYPES in the data model (optional)
96125
97-
If you have reusable metadata value in a source type (A), you should create an additional source type (B) and drag-and-drop it over the metadata field of the first source type (A) to connect the two data types.
98-
E.g., For the metadata "Photographer" in source type "Photograph", you should create a source type "Person" and connect it in "Photograph".
126+
If you have reusable metadata value in a resource type (A), you should create an additional resource type (B) and drag-and-drop it over the metadata field of the first resource type (A) to connect the two data types.
127+
E.g., For the metadata "Photographer" in resource type "Photograph", you should create a resource type "Person" and connect it in "Photograph".
99128
100-
![Data model editor 4: Manage connections between the source types.](../assets/images/data-model-example.png)*Data model editor 4: Manage connections between the source types.*
129+
![Data model editor 4: Manage connections between the resource classes.](../assets/images/data-model-example.png)*Data model editor 4: Manage connections between the resource classes.*
101130
102-
----
131+
---
103132
104133
## Lists
105134
&#9888; *WORK IN PROGRESS*
@@ -109,3 +138,4 @@ Projects often need to define lists or hierarchies of categories that can be ass
109138
![Project lists](../assets/images/project-lists.png)*https://app2.dasch.swiss/project/0803/lists - Project lists: create a new list, add items by selecting the language and enter the corresponding value, repeat for each translation and press the + sign to create another item to the same level.*
110139
111140
**The edition of items and child items will be implemented in a later version.**
141+
-->

‎src/app/app.module.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ import { PropertyFormComponent } from './project/ontology/property-form/property
7171
import { PropertyInfoComponent } from './project/ontology/property-info/property-info.component';
7272
import { ResourceClassFormComponent } from './project/ontology/resource-class-form/resource-class-form.component';
7373
import { ResourceClassInfoComponent } from './project/ontology/resource-class-info/resource-class-info.component';
74-
import { ResourceClassPropertyFormComponent } from './project/ontology/resource-class-property-form/resource-class-property-form.component';
7574
import { ResourceComponent } from './workspace/resource/resource.component';
7675
import { ResourceInstanceFormComponent } from './workspace/resource/resource-instance-form/resource-instance-form.component';
7776
import { ResultsComponent } from './workspace/results/results.component';
@@ -150,7 +149,6 @@ export function httpLoaderFactory(httpClient: HttpClient) {
150149
PropertyInfoComponent,
151150
ResourceClassFormComponent,
152151
ResourceClassInfoComponent,
153-
ResourceClassPropertyFormComponent,
154152
ResourceComponent,
155153
ResourceInstanceFormComponent,
156154
ResultsComponent,

‎src/app/main/dialog/dialog.component.html‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@
258258
<div *ngSwitchCase="'editResourceClass'">
259259
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
260260
</app-dialog-header>
261-
<app-resource-class-form [iri]="data.id" [name]="data.title" [projectCode]="data.project"
262-
[showResourceClassForm]="true" [edit]="true" (closeDialog)="dialogRef.close()">
261+
<app-resource-class-form [iri]="data.id" [name]="data.title" [projectCode]="data.project" [edit]="true"
262+
(closeDialog)="dialogRef.close()">
263263
</app-resource-class-form>
264264
</div>
265265

@@ -281,22 +281,21 @@
281281
<div *ngSwitchCase="'updateCardinality'">
282282
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
283283
</app-dialog-header>
284-
<app-resource-class-form [iri]="data.id" [name]="data.title" [projectCode]="data.project"
285-
[showResourceClassForm]="false" [edit]="true" (closeDialog)="dialogRef.close()">
286-
</app-resource-class-form>
284+
<app-property-form [propertyInfo]="data.propInfo" [resClassIri]="data.parentIri" [guiOrder]="data.position" (closeDialog)="dialogRef.close()">
285+
</app-property-form>
287286
</div>
288287

289288
<div *ngSwitchCase="'createProperty'">
290289
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
291290
</app-dialog-header>
292-
<app-property-form [propertyInfo]="data.propInfo" (closeDialog)="dialogRef.close()">
291+
<app-property-form [propertyInfo]="data.propInfo" [resClassIri]="data.parentIri" [guiOrder]="data.position" (closeDialog)="dialogRef.close()">
293292
</app-property-form>
294293
</div>
295294

296295
<div *ngSwitchCase="'editProperty'">
297296
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
298297
</app-dialog-header>
299-
<app-property-form [propertyInfo]="data.propInfo" (closeDialog)="dialogRef.close()">
298+
<app-property-form [propertyInfo]="data.propInfo" [resClassIri]="data.parentIri" [guiOrder]="data.position" (closeDialog)="dialogRef.close()">
300299
</app-property-form>
301300
</div>
302301

0 commit comments

Comments
 (0)