Skip to content

Commit 7e501ad

Browse files
Logendegithub-actions[bot]
authored andcommitted
apply formatting changes
1 parent c8f1ce3 commit 7e501ad

13 files changed

Lines changed: 220 additions & 220 deletions

File tree

meta_configurator/src/components/panels/gui-editor/configTreeNodeResolver.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,7 @@ export class ConfigTreeNodeResolver {
298298
const optionalProperties = this.createSchemaPropertiesChildNodes(
299299
mode,
300300
parameters,
301-
key =>
302-
!parameters.schema.isRequired(key) &&
303-
!parameters.schema.properties[key]?.deprecated
301+
key => !parameters.schema.isRequired(key) && !parameters.schema.properties[key]?.deprecated
304302
);
305303
const additionalProperties = this.createDataPropertiesChildNodes(
306304
mode,
@@ -310,8 +308,7 @@ export class ConfigTreeNodeResolver {
310308
const deprecatedProperties = this.createSchemaPropertiesChildNodes(
311309
mode,
312310
parameters,
313-
key =>
314-
!!parameters.schema.properties[key]?.deprecated && !parameters.schema.isRequired(key)
311+
key => !!parameters.schema.properties[key]?.deprecated && !parameters.schema.isRequired(key)
315312
);
316313
return requiredProperties.concat(
317314
optionalProperties,

meta_configurator/src/components/panels/rdf/__tests__/rdfPanel.test.ts

Lines changed: 144 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -40,165 +40,158 @@ const ORIGINAL_LABEL = 'element_size';
4040
const UPDATED_LABEL = 'element_size_updated';
4141

4242
describe('RdfPanel', () => {
43-
it(
44-
'loads fixture data, edits one rdf statement, deletes it, adds it back, and updates editor data',
45-
async () => {
46-
vi.resetModules();
47-
(globalThis as any).window = globalThis as any;
48-
49-
const inputJsonLd = JSON.parse(readFixture('input.json'));
50-
const expectedEditedJsonLd = JSON.parse(readFixture('edit_expected.json'));
51-
const expectedDeletedJsonLd = JSON.parse(readFixture('delete_expected.json'));
52-
const expectedAddedJsonLd = JSON.parse(readFixture('add_expected.json'));
53-
const dataRef = ref<any>({});
54-
const dataAtCurrentPath = ref<any>(null);
55-
const currentPath = ref<any>([]);
56-
const currentSelectedElement = ref<any>([]);
57-
58-
vi.doMock('@/data/useDataLink', () => ({
59-
getDataForMode: () => ({
60-
data: dataRef,
61-
shallowDataRef: dataRef,
62-
dataAtCurrentPath,
63-
isDataUnparseable: () => false,
64-
setData: (value: any) => {
65-
dataRef.value = value;
66-
},
67-
}),
68-
getSessionForMode: () => ({
69-
currentPath,
70-
currentSelectedElement,
71-
updateCurrentPath: (path: any) => {
72-
currentPath.value = path;
73-
},
74-
updateCurrentSelectedElement: (path: any) => {
75-
currentSelectedElement.value = path;
76-
},
77-
}),
78-
}));
79-
80-
vi.doMock('rdflib', async () => {
81-
const {createRequire} = await import('node:module');
82-
const require = createRequire(import.meta.url);
83-
return require('rdflib');
84-
});
85-
86-
const RdfPanel = (await import('@/components/panels/rdf/RdfPanel.vue')).default;
87-
const {rdfStoreManager} = await import('@/components/panels/rdf/rdfStoreManager');
88-
const {TripleEditorService} = await import('@/components/panels/rdf/tripleEditorService');
89-
const {RdfTermType} = await import('@/components/panels/rdf/rdfUtils');
90-
const {RdfMediaType} = await import('@/components/panels/rdf/rdfEnums');
91-
92-
const getExportedJsonLd = () =>
93-
JSON.parse(rdfStoreManager.exportAs(RdfMediaType.JsonLd).content ?? '{"@graph":[]}');
94-
95-
mount(RdfPanel, {
96-
props: {sessionMode: SessionMode.DataEditor},
97-
global: {
98-
stubs: {
99-
PanelSettings: PanelSettingsStub,
100-
RmlMappingDialog: RmlMappingDialogStub,
101-
ImportTurtleDialog: ImportTurtleDialogStub,
102-
Message: MessageStub,
103-
RdfTabPanel: RdfTabPanelStub,
104-
},
43+
it('loads fixture data, edits one rdf statement, deletes it, adds it back, and updates editor data', async () => {
44+
vi.resetModules();
45+
(globalThis as any).window = globalThis as any;
46+
47+
const inputJsonLd = JSON.parse(readFixture('input.json'));
48+
const expectedEditedJsonLd = JSON.parse(readFixture('edit_expected.json'));
49+
const expectedDeletedJsonLd = JSON.parse(readFixture('delete_expected.json'));
50+
const expectedAddedJsonLd = JSON.parse(readFixture('add_expected.json'));
51+
const dataRef = ref<any>({});
52+
const dataAtCurrentPath = ref<any>(null);
53+
const currentPath = ref<any>([]);
54+
const currentSelectedElement = ref<any>([]);
55+
56+
vi.doMock('@/data/useDataLink', () => ({
57+
getDataForMode: () => ({
58+
data: dataRef,
59+
shallowDataRef: dataRef,
60+
dataAtCurrentPath,
61+
isDataUnparseable: () => false,
62+
setData: (value: any) => {
63+
dataRef.value = value;
10564
},
106-
});
107-
108-
dataRef.value = inputJsonLd;
109-
await waitUntil(() => rdfStoreManager.statements.value.length > 0);
110-
111-
const target = rdfStoreManager.statements.value.find(
65+
}),
66+
getSessionForMode: () => ({
67+
currentPath,
68+
currentSelectedElement,
69+
updateCurrentPath: (path: any) => {
70+
currentPath.value = path;
71+
},
72+
updateCurrentSelectedElement: (path: any) => {
73+
currentSelectedElement.value = path;
74+
},
75+
}),
76+
}));
77+
78+
vi.doMock('rdflib', async () => {
79+
const {createRequire} = await import('node:module');
80+
const require = createRequire(import.meta.url);
81+
return require('rdflib');
82+
});
83+
84+
const RdfPanel = (await import('@/components/panels/rdf/RdfPanel.vue')).default;
85+
const {rdfStoreManager} = await import('@/components/panels/rdf/rdfStoreManager');
86+
const {TripleEditorService} = await import('@/components/panels/rdf/tripleEditorService');
87+
const {RdfTermType} = await import('@/components/panels/rdf/rdfUtils');
88+
const {RdfMediaType} = await import('@/components/panels/rdf/rdfEnums');
89+
90+
const getExportedJsonLd = () =>
91+
JSON.parse(rdfStoreManager.exportAs(RdfMediaType.JsonLd).content ?? '{"@graph":[]}');
92+
93+
mount(RdfPanel, {
94+
props: {sessionMode: SessionMode.DataEditor},
95+
global: {
96+
stubs: {
97+
PanelSettings: PanelSettingsStub,
98+
RmlMappingDialog: RmlMappingDialogStub,
99+
ImportTurtleDialog: ImportTurtleDialogStub,
100+
Message: MessageStub,
101+
RdfTabPanel: RdfTabPanelStub,
102+
},
103+
},
104+
});
105+
106+
dataRef.value = inputJsonLd;
107+
await waitUntil(() => rdfStoreManager.statements.value.length > 0);
108+
109+
const target = rdfStoreManager.statements.value.find(
110+
st =>
111+
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
112+
st.predicate.value === RDFS_LABEL_IRI &&
113+
st.object.termType === RdfTermType.Literal
114+
);
115+
expect(target).toBeDefined();
116+
117+
const result = TripleEditorService.addOrEdit({
118+
subject: target!.subject.value,
119+
subjectType: target!.subject.termType,
120+
predicate: target!.predicate.value,
121+
predicateType: target!.predicate.termType,
122+
object: UPDATED_LABEL,
123+
objectType: RdfTermType.Literal,
124+
objectDatatype:
125+
target!.object.termType === RdfTermType.Literal ? target!.object.datatype?.value ?? '' : '',
126+
statement: target,
127+
});
128+
129+
expect(result.success).toBe(true);
130+
131+
await waitUntil(() =>
132+
rdfStoreManager.statements.value.some(
112133
st =>
113134
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
114135
st.predicate.value === RDFS_LABEL_IRI &&
115-
st.object.termType === RdfTermType.Literal
116-
);
117-
expect(target).toBeDefined();
118-
119-
const result = TripleEditorService.addOrEdit({
120-
subject: target!.subject.value,
121-
subjectType: target!.subject.termType,
122-
predicate: target!.predicate.value,
123-
predicateType: target!.predicate.termType,
124-
object: UPDATED_LABEL,
125-
objectType: RdfTermType.Literal,
126-
objectDatatype:
127-
target!.object.termType === RdfTermType.Literal
128-
? target!.object.datatype?.value ?? ''
129-
: '',
130-
statement: target,
131-
});
132-
133-
expect(result.success).toBe(true);
134-
135-
await waitUntil(() =>
136-
rdfStoreManager.statements.value.some(
136+
st.object.termType === RdfTermType.Literal &&
137+
st.object.value === UPDATED_LABEL
138+
)
139+
);
140+
await waitUntil(
141+
() => JSON.stringify(getExportedJsonLd()) === JSON.stringify(expectedEditedJsonLd)
142+
);
143+
expect(getExportedJsonLd()).toEqual(expectedEditedJsonLd);
144+
145+
const editedStatement = rdfStoreManager.statements.value.find(
146+
st =>
147+
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
148+
st.predicate.value === RDFS_LABEL_IRI &&
149+
st.object.termType === RdfTermType.Literal &&
150+
st.object.value === UPDATED_LABEL
151+
);
152+
expect(editedStatement).toBeDefined();
153+
154+
const deleteResult = TripleEditorService.delete(editedStatement!);
155+
expect(deleteResult.success).toBe(true);
156+
157+
await waitUntil(
158+
() =>
159+
!rdfStoreManager.statements.value.some(
137160
st =>
138-
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
139-
st.predicate.value === RDFS_LABEL_IRI &&
140-
st.object.termType === RdfTermType.Literal &&
141-
st.object.value === UPDATED_LABEL
161+
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI && st.predicate.value === RDFS_LABEL_IRI
142162
)
143-
);
144-
await waitUntil(
145-
() => JSON.stringify(getExportedJsonLd()) === JSON.stringify(expectedEditedJsonLd)
146-
);
147-
expect(getExportedJsonLd()).toEqual(expectedEditedJsonLd);
148-
149-
const editedStatement = rdfStoreManager.statements.value.find(
163+
);
164+
await waitUntil(
165+
() => JSON.stringify(getExportedJsonLd()) === JSON.stringify(expectedDeletedJsonLd)
166+
);
167+
expect(getExportedJsonLd()).toEqual(expectedDeletedJsonLd);
168+
169+
const addResult = TripleEditorService.addOrEdit({
170+
subject: editedStatement!.subject.value,
171+
subjectType: editedStatement!.subject.termType,
172+
predicate: editedStatement!.predicate.value,
173+
predicateType: editedStatement!.predicate.termType,
174+
object: ORIGINAL_LABEL,
175+
objectType: RdfTermType.Literal,
176+
objectDatatype:
177+
editedStatement!.object.termType === RdfTermType.Literal
178+
? editedStatement!.object.datatype?.value ?? ''
179+
: '',
180+
});
181+
expect(addResult.success).toBe(true);
182+
183+
await waitUntil(() =>
184+
rdfStoreManager.statements.value.some(
150185
st =>
151186
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
152187
st.predicate.value === RDFS_LABEL_IRI &&
153188
st.object.termType === RdfTermType.Literal &&
154-
st.object.value === UPDATED_LABEL
155-
);
156-
expect(editedStatement).toBeDefined();
157-
158-
const deleteResult = TripleEditorService.delete(editedStatement!);
159-
expect(deleteResult.success).toBe(true);
160-
161-
await waitUntil(
162-
() =>
163-
!rdfStoreManager.statements.value.some(
164-
st =>
165-
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
166-
st.predicate.value === RDFS_LABEL_IRI
167-
)
168-
);
169-
await waitUntil(
170-
() => JSON.stringify(getExportedJsonLd()) === JSON.stringify(expectedDeletedJsonLd)
171-
);
172-
expect(getExportedJsonLd()).toEqual(expectedDeletedJsonLd);
173-
174-
const addResult = TripleEditorService.addOrEdit({
175-
subject: editedStatement!.subject.value,
176-
subjectType: editedStatement!.subject.termType,
177-
predicate: editedStatement!.predicate.value,
178-
predicateType: editedStatement!.predicate.termType,
179-
object: ORIGINAL_LABEL,
180-
objectType: RdfTermType.Literal,
181-
objectDatatype:
182-
editedStatement!.object.termType === RdfTermType.Literal
183-
? editedStatement!.object.datatype?.value ?? ''
184-
: '',
185-
});
186-
expect(addResult.success).toBe(true);
187-
188-
await waitUntil(() =>
189-
rdfStoreManager.statements.value.some(
190-
st =>
191-
st.subject.value === VARIABLE_ELEMENT_SIZE_IRI &&
192-
st.predicate.value === RDFS_LABEL_IRI &&
193-
st.object.termType === RdfTermType.Literal &&
194-
st.object.value === ORIGINAL_LABEL
195-
)
196-
);
197-
await waitUntil(
198-
() => JSON.stringify(getExportedJsonLd()) === JSON.stringify(expectedAddedJsonLd)
199-
);
200-
expect(getExportedJsonLd()).toEqual(expectedAddedJsonLd);
201-
},
202-
8000
203-
);
189+
st.object.value === ORIGINAL_LABEL
190+
)
191+
);
192+
await waitUntil(
193+
() => JSON.stringify(getExportedJsonLd()) === JSON.stringify(expectedAddedJsonLd)
194+
);
195+
expect(getExportedJsonLd()).toEqual(expectedAddedJsonLd);
196+
}, 8000);
204197
});

meta_configurator/src/components/panels/rdf/sparql-editor/SparqlQueryTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const emit = defineEmits<{
121121
}>();
122122
123123
function updateActiveAccordion(value: string | string[] | null | undefined) {
124-
emit('update:activeAccordion', Array.isArray(value) ? (value[0] ?? null) : (value ?? null));
124+
emit('update:activeAccordion', Array.isArray(value) ? value[0] ?? null : value ?? null);
125125
}
126126
</script>
127127

meta_configurator/src/components/toolbar/dialogs/csvimport/ImportCsvDialog.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ defineExpose({show: openDialog, close: hideDialog});
310310
<label for="delimiter" class="mr-2">
311311
<b>Path for the resulting array in the document:</b>
312312
</label>
313-
<InputText v-model="pathBeforeRowIndex" data-testid="csv-table-path-input" class="fixed-width" />
313+
<InputText
314+
v-model="pathBeforeRowIndex"
315+
data-testid="csv-table-path-input"
316+
class="fixed-width" />
314317
</div>
315318
</div>
316319
<div v-else>
@@ -385,7 +388,10 @@ defineExpose({show: openDialog, close: hideDialog});
385388
<span class="text-xs" v-if="isExpandWithLookupTables"
386389
>{{ foreignKey.value }}/</span
387390
>
388-
<InputText v-model="column.pathAfterRowIndex" :data-testid="'csv-column-path-' + column.name" class="fixed-width" />
391+
<InputText
392+
v-model="column.pathAfterRowIndex"
393+
:data-testid="'csv-column-path-' + column.name"
394+
class="fixed-width" />
389395
</td>
390396
<!--td v-if="isInferSchema">
391397
<InputText v-model="column.titleInSchema" class="fixed-width" />

meta_configurator/src/rml-mapping/standard/rmlMappingServiceStandard.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,14 @@ function isErrorWithLine(error: unknown): error is {message: string; context: {l
6060
async function extractPrefixes(config: string): Promise<Record<string, string>> {
6161
let prefixes: Record<string, string> = {};
6262

63-
await new N3Parser().parse(
64-
config,
65-
{
66-
onQuad: () => {},
67-
onPrefix: (prefix, iri) => {
68-
if (!IGNORED_PREFIX_NAMES.has(prefix) && !IGNORED_IRIS.has(iri.value)) {
69-
prefixes[prefix] = iri.value;
70-
}
71-
},
72-
}
73-
);
63+
await new N3Parser().parse(config, {
64+
onQuad: () => {},
65+
onPrefix: (prefix, iri) => {
66+
if (!IGNORED_PREFIX_NAMES.has(prefix) && !IGNORED_IRIS.has(iri.value)) {
67+
prefixes[prefix] = iri.value;
68+
}
69+
},
70+
});
7471

7572
return prefixes;
7673
}

0 commit comments

Comments
 (0)