Skip to content

Commit 563ab8a

Browse files
authored
Rename from entity value to entity instance (#189)
* rename from entity value to entity instance * fix e2e
1 parent b983cb8 commit 563ab8a

File tree

20 files changed

+66
-66
lines changed

20 files changed

+66
-66
lines changed

core/apps/ame-e2e/src/integration/editor/edit-enumeration-entity-values.cy.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ describe('Test enumeration entity value', () => {
258258
.then(() => cyHelp.clickSaveButton());
259259
});
260260

261-
it('import new model with entity values', () => {
261+
it('import new model with entity instances', () => {
262262
cy.visitDefault();
263263
cy.intercept('POST', 'http://localhost:9091/ame/api/models/validate', {fixture: 'model-validation-response.json'});
264264
cy.fixture('entity-values-enumeration')
@@ -295,7 +295,7 @@ describe('Test enumeration entity value', () => {
295295
});
296296
});
297297

298-
it('search for entity value', () => {
298+
it('search for entity instance', () => {
299299
cy.shapeExists('Characteristic1')
300300
.then(() => cy.dbClickShape('Characteristic1'))
301301
.then(() => cy.get(SELECTOR_searchEntityValueInputField).should('exist').type('test2', {force: true}))
@@ -305,7 +305,7 @@ describe('Test enumeration entity value', () => {
305305
.then(() => cyHelp.clickSaveButton());
306306
});
307307

308-
it('edit all entity values', () => {
308+
it('edit all entity instances', () => {
309309
cy.shapeExists('test1')
310310
.then(() => cy.dbClickShape('test1').wait(200))
311311
.then(() => cy.get(FIELD_name).clear({force: true}).type('edit1', {force: true}))
@@ -360,7 +360,7 @@ describe('Test enumeration entity value', () => {
360360
.then(() => cy.get(SELECTOR_editorCancelButton).click({force: true}));
361361
});
362362

363-
it('edit one entity values', () => {
363+
it('edit one entity instances', () => {
364364
cy.shapeExists('edit2')
365365
.then(() => cy.dbClickShape('edit2'))
366366
.then(() => cy.get(FIELD_name).should('exist').clear({force: true}).type('editOnlyOnEntityValue', {force: true}))
@@ -430,7 +430,7 @@ describe('Test enumeration entity value', () => {
430430
.then(() => cyHelp.clickSaveButton());
431431
});
432432

433-
it('delete all entity value one by one', () => {
433+
it('delete all entity instance one by one', () => {
434434
cy.visitDefault();
435435
cy.intercept('POST', 'http://localhost:9091/ame/api/models/validate', {fixture: 'model-validation-response.json'});
436436
cy.fixture('entity-values-enumeration')
@@ -475,7 +475,7 @@ describe('Test enumeration entity value', () => {
475475
});
476476
});
477477

478-
it('it should add manually new entity value shape', () => {
478+
it('it should add manually new entity instance shape', () => {
479479
cy.visitDefault();
480480
cy.startModelling()
481481
.wait(500)
@@ -493,7 +493,7 @@ describe('Test enumeration entity value', () => {
493493
.then(() => cyHelp.hasAddShapeOverlay('Characteristic1'))
494494
.then(() => {
495495
cyHelp.hasAddShapeOverlay('Characteristic1');
496-
testEntityValuesExists(['EntityValue1']);
496+
testEntityValuesExists(['EntityInstance1']);
497497
})
498498
.then(() => cy.getUpdatedRDF())
499499
.then(rdf =>
@@ -506,22 +506,22 @@ describe('Test enumeration entity value', () => {
506506
' samm:characteristic :Characteristic1.\n' +
507507
':Characteristic1 a samm-c:Enumeration;\n' +
508508
' samm:dataType :Entity1;\n' +
509-
' samm-c:values (:FillGapEntityValue :EntityValue1).\n' +
509+
' samm-c:values (:FillGapEntityValue :EntityInstance1).\n' +
510510
':Entity1 a samm:Entity;\n' +
511511
' samm:properties ().\n' +
512512
':FillGapEntityValue a :Entity1.\n' +
513-
':EntityValue1 a :Entity1.',
513+
':EntityInstance1 a :Entity1.',
514514
),
515515
);
516516
});
517517

518518
it('it should delete entity value', () => {
519-
cy.getHTMLCell('EntityValue1')
519+
cy.getHTMLCell('EntityInstance1')
520520
.click({force: true})
521521
.then(() => cy.get(SELECTOR_tbDeleteButton).click({force: true}))
522522
.then(() => {
523523
cyHelp.hasAddShapeOverlay('Characteristic1');
524-
testEntityValuesDoesNotExist(['EntityValue1']);
524+
testEntityValuesDoesNotExist(['EntityInstance1']);
525525
})
526526
.then(() => cy.getUpdatedRDF())
527527
.then(rdf => {

core/libs/aspect-exporter/src/lib/domain-model-to-rdf.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
CharacteristicVisitor,
2323
CleanupVisitor,
2424
ConstraintVisitor,
25-
EntityValueVisitor,
25+
EntityInstanceVisitor,
2626
EntityVisitor,
2727
EventVisitor,
2828
OperationVisitor,
@@ -41,7 +41,7 @@ import {
4141
CleanupVisitor,
4242
ConstraintVisitor,
4343
DomainModelToRdfService,
44-
EntityValueVisitor,
44+
EntityInstanceVisitor,
4545
EntityVisitor,
4646
EntityVisitor,
4747
EventVisitor,

core/libs/aspect-exporter/src/lib/domain-model-to-rdf.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
CharacteristicVisitor,
3939
CleanupVisitor,
4040
ConstraintVisitor,
41-
EntityValueVisitor,
41+
EntityInstanceVisitor,
4242
EntityVisitor,
4343
EventVisitor,
4444
OperationVisitor,
@@ -70,7 +70,7 @@ export class DomainModelToRdfService {
7070
private entityVisitorService: EntityVisitor,
7171
private abstractEntityVisitorService: AbstractEntityVisitor,
7272
private abstractPropertyVisitorService: AbstractPropertyVisitor,
73-
private entityValueVisitor: EntityValueVisitor,
73+
private entityInstanceVisitor: EntityInstanceVisitor,
7474
private eventVisitorService: EventVisitor,
7575
private unitVisitorService: UnitVisitor,
7676
private modelService: ModelService,
@@ -140,7 +140,7 @@ export class DomainModelToRdfService {
140140
} else if (metaModelElement instanceof DefaultAbstractEntity) {
141141
return this.abstractEntityVisitorService;
142142
} else if (metaModelElement instanceof DefaultEntityInstance) {
143-
return this.entityValueVisitor;
143+
return this.entityInstanceVisitor;
144144
} else if (metaModelElement instanceof DefaultEvent) {
145145
return this.eventVisitorService;
146146
} else if (metaModelElement instanceof DefaultUnit) {

core/libs/aspect-exporter/src/lib/visitor/entity-value/entity-value-visitor.spec.ts renamed to core/libs/aspect-exporter/src/lib/visitor/entity-instance/entity-instance-visitor.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import {TestBed} from '@angular/core/testing';
1515
import {DataFactory, Quad, Store} from 'n3';
1616
import {describe, expect, it} from '@jest/globals';
17-
import {EntityValueVisitor} from '@ame/aspect-exporter';
17+
import {EntityInstanceVisitor} from '@ame/aspect-exporter';
1818
import {Samm} from '@ame/vocabulary';
1919
import {ModelService, RdfService} from '@ame/rdf/services';
2020
import {provideMockObject} from '../../../../../../jest-helpers';
@@ -36,9 +36,9 @@ class MockRDFModel {
3636
SAMM = jest.fn((): Samm => new MockSamm() as any as Samm);
3737
}
3838

39-
describe('Entity value visitor', () => {
39+
describe('Entity instance visitor', () => {
4040
let mockedRdfModel: MockRDFModel;
41-
let service: EntityValueVisitor;
41+
let service: EntityInstanceVisitor;
4242
let rdfService: jest.Mocked<RdfService>;
4343
const entity: any = {aspectModelUrn: 'entityUrn1'};
4444
const mockProperty1: any = {
@@ -80,7 +80,7 @@ describe('Entity value visitor', () => {
8080
mockedRdfModel = new MockRDFModel();
8181
TestBed.configureTestingModule({
8282
providers: [
83-
EntityValueVisitor,
83+
EntityInstanceVisitor,
8484
{
8585
provide: ModelService,
8686
useValue: {
@@ -95,7 +95,7 @@ describe('Entity value visitor', () => {
9595
},
9696
],
9797
});
98-
service = TestBed.inject(EntityValueVisitor);
98+
service = TestBed.inject(EntityInstanceVisitor);
9999

100100
rdfService = TestBed.inject(RdfService) as jest.Mocked<RdfService>;
101101
rdfService.currentRdfModel = mockedRdfModel.rdfModel;

core/libs/aspect-exporter/src/lib/visitor/entity-value/entity-value-visitor.ts renamed to core/libs/aspect-exporter/src/lib/visitor/entity-instance/entity-instance-visitor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
import {Injectable} from '@angular/core';
15-
import {DefaultCollection, DefaultEntityInstance, EntityValueProperty} from '@ame/meta-model';
15+
import {DefaultCollection, DefaultEntityInstance, EntityInstanceProperty} from '@ame/meta-model';
1616
import {ModelService, RdfService} from '@ame/rdf/services';
1717
import {DataFactory, Literal, NamedNode} from 'n3';
1818
import {BaseVisitor} from '../base-visitor';
@@ -21,7 +21,7 @@ import {RdfListService} from '../../rdf-list';
2121
import {Samm} from '@ame/vocabulary';
2222

2323
@Injectable()
24-
export class EntityValueVisitor extends BaseVisitor<DefaultEntityInstance> {
24+
export class EntityInstanceVisitor extends BaseVisitor<DefaultEntityInstance> {
2525
constructor(
2626
private rdfListService: RdfListService,
2727
public modelService: ModelService,
@@ -82,14 +82,14 @@ export class EntityValueVisitor extends BaseVisitor<DefaultEntityInstance> {
8282
}
8383
}
8484

85-
private createObjectForCollectionLangStringRDF(ev: EntityValueProperty): {predicate: NamedNode; literal: Literal} {
85+
private createObjectForCollectionLangStringRDF(ev: EntityInstanceProperty): {predicate: NamedNode; literal: Literal} {
8686
return {
8787
predicate: DataFactory.namedNode(ev.key.property.aspectModelUrn),
8888
literal: DataFactory.literal(ev?.value?.toString(), ev?.language?.toString()),
8989
};
9090
}
9191

92-
private createObjectForRDF({key, value, language}: EntityValueProperty): NamedNode | Literal {
92+
private createObjectForRDF({key, value, language}: EntityInstanceProperty): NamedNode | Literal {
9393
if (value instanceof DefaultEntityInstance) {
9494
return DataFactory.namedNode(value.aspectModelUrn);
9595
}

core/libs/aspect-exporter/src/lib/visitor/entity-value/index.ts renamed to core/libs/aspect-exporter/src/lib/visitor/entity-instance/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
* SPDX-License-Identifier: MPL-2.0
1212
*/
1313

14-
export * from './entity-value-visitor';
14+
export * from './entity-instance-visitor';

core/libs/aspect-exporter/src/lib/visitor/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export * from './characteristic';
1818
export * from './entity';
1919
export * from './constraint';
2020
export * from './cleanup-visitor';
21-
export * from './entity-value';
21+
export * from './entity-instance';
2222
export * from './unit';
2323
export * from './event';
2424
export * from './abstract-entity';

core/libs/editor/src/lib/editor-dialog/components/entity-instance/entity-instance-modal-table/entity-instance-modal-table.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
DefaultEntityInstance,
2222
DefaultEnumeration,
2323
DefaultProperty,
24-
EntityValueProperty,
24+
EntityInstanceProperty,
2525
OverWrittenProperty,
2626
} from '@ame/meta-model';
2727
import {DataType, EditorDialogValidators, FormFieldHelper} from '@ame/editor';
@@ -55,7 +55,7 @@ export class EntityInstanceModalTableComponent implements OnChanges, OnDestroy {
5555
protected readonly formFieldHelper = FormFieldHelper;
5656
protected readonly dataType = DataType;
5757

58-
sources: EntityValueProperty[] = [];
58+
sources: EntityInstanceProperty[] = [];
5959

6060
filteredEntityValues$: {[key: string]: Observable<any[]>} = {};
6161
filteredLanguageValues$: {[key: string]: Observable<any[]>} = {};
@@ -96,11 +96,11 @@ export class EntityInstanceModalTableComponent implements OnChanges, OnDestroy {
9696
return this.propertiesForm.get(value) as FormArray;
9797
}
9898

99-
private buildEntityValueArray(): EntityValueProperty[] {
99+
private buildEntityValueArray(): EntityInstanceProperty[] {
100100
return this.entity.allProperties.map(prop => this.createEntityValueProp(prop));
101101
}
102102

103-
private createEntityValueProp(prop: OverWrittenProperty<DefaultProperty | DefaultAbstractProperty>): EntityValueProperty {
103+
private createEntityValueProp(prop: OverWrittenProperty<DefaultProperty | DefaultAbstractProperty>): EntityInstanceProperty {
104104
const valueControl = this.createFormControl(prop);
105105
this.subscribeToEntityValueChanges(valueControl, prop);
106106

@@ -156,7 +156,7 @@ export class EntityInstanceModalTableComponent implements OnChanges, OnDestroy {
156156
this.changeDetector.detectChanges();
157157
}
158158

159-
changeLanguageSelection(ev: EntityValueProperty, propertyValue: string, index: number): void {
159+
changeLanguageSelection(ev: EntityInstanceProperty, propertyValue: string, index: number): void {
160160
EntityInstanceUtil.changeLanguageSelection(this.propertiesForm, ev, propertyValue, index);
161161
this.closeAllAutocompletePanels();
162162
this.changeDetector.detectChanges();
@@ -173,7 +173,7 @@ export class EntityInstanceModalTableComponent implements OnChanges, OnDestroy {
173173
this.changeDetector.detectChanges();
174174
}
175175

176-
addLanguage(entityValueProp: EntityValueProperty): void {
176+
addLanguage(entityValueProp: EntityInstanceProperty): void {
177177
const fieldValidators = entityValueProp.optional ? null : EditorDialogValidators.requiredObject;
178178
const languagesFormArray = this.propertiesForm.get(entityValueProp.key.property.name) as FormArray;
179179

@@ -200,7 +200,7 @@ export class EntityInstanceModalTableComponent implements OnChanges, OnDestroy {
200200
);
201201
}
202202

203-
removeLanguage(entityValueProp: EntityValueProperty, index: number): void {
203+
removeLanguage(entityValueProp: EntityInstanceProperty, index: number): void {
204204
const languagesFormArray = this.propertiesForm.get(entityValueProp.key.property.name) as FormArray;
205205
languagesFormArray.removeAt(index);
206206
}

core/libs/editor/src/lib/editor-dialog/components/entity-instance/entity-instance-table/entity-instance-table.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
DefaultCollection,
3030
DefaultEntityInstance,
3131
DefaultProperty,
32-
EntityValueProperty,
32+
EntityInstanceProperty,
3333
OverWrittenProperty,
3434
} from '@ame/meta-model';
3535
import {DataType, EditorDialogValidators, EntityInstanceUtil, FormFieldHelper} from '@ame/editor';
@@ -52,7 +52,7 @@ export class EntityInstanceTableComponent extends InputFieldComponent<DefaultEnt
5252
protected readonly dataType = DataType;
5353

5454
propertiesForm: FormGroup;
55-
sources: EntityValueProperty[] = [];
55+
sources: EntityInstanceProperty[] = [];
5656
subscriptions = new Subscription();
5757

5858
filteredEntityValues$: {[key: string]: Observable<any[]>} = {};
@@ -101,7 +101,7 @@ export class EntityInstanceTableComponent extends InputFieldComponent<DefaultEnt
101101
);
102102
}
103103

104-
private createEntityValueProp(prop: OverWrittenProperty<DefaultProperty | DefaultAbstractProperty>): EntityValueProperty {
104+
private createEntityValueProp(prop: OverWrittenProperty<DefaultProperty | DefaultAbstractProperty>): EntityInstanceProperty {
105105
const property = prop.property as DefaultProperty;
106106
const propertyControl = this.propertiesForm.get(property.name);
107107

@@ -132,7 +132,7 @@ export class EntityInstanceTableComponent extends InputFieldComponent<DefaultEnt
132132
return new FormControl('', prop.keys.optional ? null : EditorDialogValidators.requiredObject);
133133
}
134134

135-
private getValidators(entityValueProperty: EntityValueProperty): (control: AbstractControl) => ValidationErrors | null {
135+
private getValidators(entityValueProperty: EntityInstanceProperty): (control: AbstractControl) => ValidationErrors | null {
136136
return entityValueProperty.key.keys.optional ? null : Validators.required;
137137
}
138138

@@ -231,7 +231,7 @@ export class EntityInstanceTableComponent extends InputFieldComponent<DefaultEnt
231231
this.changeDetector.detectChanges();
232232
}
233233

234-
changeLanguageSelection(ev: EntityValueProperty, propertyValue: string, index: number): void {
234+
changeLanguageSelection(ev: EntityInstanceProperty, propertyValue: string, index: number): void {
235235
EntityInstanceUtil.changeLanguageSelection(this.propertiesForm, ev, propertyValue, index);
236236
this.closeAllAutocompletePanels();
237237
this.changeDetector.detectChanges();
@@ -248,7 +248,7 @@ export class EntityInstanceTableComponent extends InputFieldComponent<DefaultEnt
248248
this.changeDetector.detectChanges();
249249
}
250250

251-
addLanguage(entityValueProp: EntityValueProperty): void {
251+
addLanguage(entityValueProp: EntityInstanceProperty): void {
252252
const fieldValidators = entityValueProp.optional ? null : EditorDialogValidators.requiredObject;
253253
const languagesFormArray = this.propertiesForm.get(entityValueProp.key.property.name) as FormArray;
254254

@@ -268,7 +268,7 @@ export class EntityInstanceTableComponent extends InputFieldComponent<DefaultEnt
268268
languagesFormArray.push(languageFormGroup);
269269
}
270270

271-
removeLanguage(entityValueProp: EntityValueProperty, index: number): void {
271+
removeLanguage(entityValueProp: EntityInstanceProperty, index: number): void {
272272
const languagesFormArray = this.propertiesForm.get(entityValueProp.key.property.name) as FormArray;
273273
languagesFormArray.removeAt(index);
274274
}

core/libs/editor/src/lib/editor-dialog/components/entity-instance/entity-instance-view/entity-instance-view.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {SelectionModel} from '@angular/cdk/collections';
1515
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
1616
import {filter} from 'rxjs/operators';
1717
import {EntityInstanceModalComponent} from '..';
18-
import {DefaultEntityInstance, DefaultEnumeration, EntityValueProperty} from '@ame/meta-model';
18+
import {DefaultEntityInstance, DefaultEnumeration, EntityInstanceProperty} from '@ame/meta-model';
1919
import {FormControl, FormGroup} from '@angular/forms';
2020
import {MatDialog} from '@angular/material/dialog';
2121
import {DataType, FormFieldHelper} from '../../../../helpers/form-field.helper';
@@ -33,7 +33,7 @@ export class EntityInstanceViewComponent implements OnInit, OnDestroy {
3333
protected readonly dataType = DataType;
3434

3535
public searchFilter: string;
36-
public selection: SelectionModel<EntityValueProperty> = new SelectionModel<EntityValueProperty>();
36+
public selection: SelectionModel<EntityInstanceProperty> = new SelectionModel<EntityInstanceProperty>();
3737

3838
readonly displayedColumns = ['key', 'value'];
3939

@@ -81,7 +81,7 @@ export class EntityInstanceViewComponent implements OnInit, OnDestroy {
8181
this.complexValues = [];
8282
}
8383

84-
trackProperty(_index: number, item: EntityValueProperty): string {
84+
trackProperty(_index: number, item: EntityInstanceProperty): string {
8585
return `${item?.key.property.name}`;
8686
}
8787

0 commit comments

Comments
 (0)