@nfdi4plants/arctrl 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ARC.js CHANGED
@@ -14,7 +14,7 @@ import { getAllFilePathsAsync } from "./ContractIO/FileSystemHelper.js";
14
14
  import { FSharpResult$2 } from "./fable_modules/fable-library-js.4.24.0/Result.js";
15
15
  import { comparePrimitives, safeHash, stringHash } from "./fable_modules/fable-library-js.4.24.0/Util.js";
16
16
  import { getStudyFolderPath, getAssayFolderPath } from "./FileSystem/Path.js";
17
- import { printf, toText, replace } from "./fable_modules/fable-library-js.4.24.0/String.js";
17
+ import { toText, printf, toFail, join, replace } from "./fable_modules/fable-library-js.4.24.0/String.js";
18
18
  import { Contract } from "./Contract/Contract.js";
19
19
  import { tryISAReadContractFromPath } from "./Contract/ARC.js";
20
20
  import { ArcTables } from "./Core/Table/ArcTables.js";
@@ -122,15 +122,15 @@ export class ARC {
122
122
  const this$ = this;
123
123
  this$._fs = fs;
124
124
  }
125
- WriteAsync(arcPath) {
125
+ TryWriteAsync(arcPath) {
126
126
  const this$ = this;
127
127
  return fullFillContractBatchAsync(arcPath, this$.GetWriteContracts());
128
128
  }
129
- UpdateAsync(arcPath) {
129
+ TryUpdateAsync(arcPath) {
130
130
  const this$ = this;
131
131
  return fullFillContractBatchAsync(arcPath, this$.GetUpdateContracts());
132
132
  }
133
- static loadAsync(arcPath) {
133
+ static tryLoadAsync(arcPath) {
134
134
  return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (getAllFilePathsAsync(arcPath).then((_arg) => {
135
135
  const arc = ARC.fromFilePaths(toArray(_arg));
136
136
  const contracts = arc.GetReadContracts();
@@ -173,7 +173,7 @@ export class ARC {
173
173
  this$.SetFilePaths(filteredPaths);
174
174
  return toArray(delay(() => append(singleton(ARCtrl_ArcAssay__ArcAssay_ToDeleteContract(assay)), delay(() => append(singleton(ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(isa)), delay(() => map_1(ARCtrl_ArcStudy__ArcStudy_ToUpdateContract, studies)))))));
175
175
  }
176
- RemoveAssayAsync(arcPath, assayIdentifier) {
176
+ TryRemoveAssayAsync(arcPath, assayIdentifier) {
177
177
  const this$ = this;
178
178
  return fullFillContractBatchAsync(arcPath, this$.GetAssayRemoveContracts(assayIdentifier));
179
179
  }
@@ -203,7 +203,7 @@ export class ARC {
203
203
  this$.SetFilePaths(renamedPaths);
204
204
  return toArray(delay(() => append(singleton(Contract.createRename(oldAssayFolderPath, newAssayFolderPath)), delay(() => this$.GetUpdateContracts()))));
205
205
  }
206
- RenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier) {
206
+ TryRenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier) {
207
207
  const this$ = this;
208
208
  return fullFillContractBatchAsync(arcPath, this$.GetAssayRenameContracts(oldAssayIdentifier, newAssayIdentifier));
209
209
  }
@@ -224,7 +224,7 @@ export class ARC {
224
224
  this$.SetFilePaths(filteredPaths);
225
225
  return [Contract.createDelete(studyFolderPath), ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(isa)];
226
226
  }
227
- RemoveStudyAsync(arcPath, studyIdentifier) {
227
+ TryRemoveStudyAsync(arcPath, studyIdentifier) {
228
228
  const this$ = this;
229
229
  return fullFillContractBatchAsync(arcPath, this$.GetStudyRemoveContracts(studyIdentifier));
230
230
  }
@@ -254,10 +254,107 @@ export class ARC {
254
254
  this$.SetFilePaths(renamedPaths);
255
255
  return toArray(delay(() => append(singleton(Contract.createRename(oldStudyFolderPath, newStudyFolderPath)), delay(() => this$.GetUpdateContracts()))));
256
256
  }
257
- RenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier) {
257
+ TryRenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier) {
258
258
  const this$ = this;
259
259
  return fullFillContractBatchAsync(arcPath, this$.GetStudyRenameContracts(oldStudyIdentifier, newStudyIdentifier));
260
260
  }
261
+ WriteAsync(arcPath) {
262
+ const this$ = this;
263
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (this$.TryWriteAsync(arcPath).then((_arg) => {
264
+ const result = _arg;
265
+ if (result.tag === 1) {
266
+ const appended = join("\n", map((e) => e, result.fields[0]));
267
+ toFail(printf("Could not write ARC, failed with the following errors %s"))(appended);
268
+ return Promise.resolve();
269
+ }
270
+ else {
271
+ return Promise.resolve();
272
+ }
273
+ }))));
274
+ }
275
+ UpdateAsync(arcPath) {
276
+ const this$ = this;
277
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (this$.TryUpdateAsync(arcPath).then((_arg) => {
278
+ const result = _arg;
279
+ if (result.tag === 1) {
280
+ const appended = join("\n", map((e) => e, result.fields[0]));
281
+ toFail(printf("Could not update ARC, failed with the following errors %s"))(appended);
282
+ return Promise.resolve();
283
+ }
284
+ else {
285
+ return Promise.resolve();
286
+ }
287
+ }))));
288
+ }
289
+ RemoveAssayAsync(arcPath, assayIdentifier) {
290
+ const this$ = this;
291
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (this$.TryRemoveAssayAsync(arcPath, assayIdentifier).then((_arg) => {
292
+ const result = _arg;
293
+ if (result.tag === 1) {
294
+ const appended = join("\n", map((e) => e, result.fields[0]));
295
+ toFail(printf("Could not remove assay, failed with the following errors %s"))(appended);
296
+ return Promise.resolve();
297
+ }
298
+ else {
299
+ return Promise.resolve();
300
+ }
301
+ }))));
302
+ }
303
+ RenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier) {
304
+ const this$ = this;
305
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (this$.TryRenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier).then((_arg) => {
306
+ const result = _arg;
307
+ if (result.tag === 1) {
308
+ const appended = join("\n", map((e) => e, result.fields[0]));
309
+ toFail(printf("Could not rename assay, failed with the following errors %s"))(appended);
310
+ return Promise.resolve();
311
+ }
312
+ else {
313
+ return Promise.resolve();
314
+ }
315
+ }))));
316
+ }
317
+ RemoveStudyAsync(arcPath, studyIdentifier) {
318
+ const this$ = this;
319
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (this$.TryRemoveStudyAsync(arcPath, studyIdentifier).then((_arg) => {
320
+ const result = _arg;
321
+ if (result.tag === 1) {
322
+ const appended = join("\n", map((e) => e, result.fields[0]));
323
+ toFail(printf("Could not remove study, failed with the following errors %s"))(appended);
324
+ return Promise.resolve();
325
+ }
326
+ else {
327
+ return Promise.resolve();
328
+ }
329
+ }))));
330
+ }
331
+ RenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier) {
332
+ const this$ = this;
333
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (this$.TryRenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier).then((_arg) => {
334
+ const result = _arg;
335
+ if (result.tag === 1) {
336
+ const appended = join("\n", map((e) => e, result.fields[0]));
337
+ toFail(printf("Could not rename study, failed with the following errors %s"))(appended);
338
+ return Promise.resolve();
339
+ }
340
+ else {
341
+ return Promise.resolve();
342
+ }
343
+ }))));
344
+ }
345
+ static loadAsync(arcPath) {
346
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (ARC.tryLoadAsync(arcPath).then((_arg) => {
347
+ const result = _arg;
348
+ if (result.tag === 1) {
349
+ const appended = join("\n", map((e) => e, result.fields[0]));
350
+ toFail(printf("Could not load ARC, failed with the following errors %s"))(appended);
351
+ return Promise.resolve(new ARC());
352
+ }
353
+ else {
354
+ return Promise.resolve(result.fields[0]);
355
+ }
356
+ }))));
357
+ }
261
358
  static fromFilePaths(filePaths) {
262
359
  return new ARC(undefined, undefined, FileSystem.fromFilePaths(filePaths));
263
360
  }
@@ -83,10 +83,16 @@ export class ArcTable {
83
83
  const this$ = this;
84
84
  return getColumnCount(this$.Headers) | 0;
85
85
  }
86
+ static columnCount(table) {
87
+ return table.ColumnCount;
88
+ }
86
89
  get RowCount() {
87
90
  const this$ = this;
88
91
  return getRowCount(this$.Values) | 0;
89
92
  }
93
+ static rowCount(table) {
94
+ return table.RowCount;
95
+ }
90
96
  get Columns() {
91
97
  const this$ = this;
92
98
  return toArray(delay(() => map((i) => this$.GetColumn(i), rangeDouble(0, 1, this$.ColumnCount - 1))));
@@ -490,6 +490,10 @@ export class CompositeHeader extends Union {
490
490
  const this$ = this;
491
491
  return (this$.tag === 3) ? (new CompositeHeader(3, [this$.fields[0].Copy()])) : ((this$.tag === 2) ? (new CompositeHeader(2, [this$.fields[0].Copy()])) : ((this$.tag === 1) ? (new CompositeHeader(1, [this$.fields[0].Copy()])) : ((this$.tag === 0) ? (new CompositeHeader(0, [this$.fields[0].Copy()])) : this$)));
492
492
  }
493
+ TryGetTerm() {
494
+ const this$ = this;
495
+ return (this$.tag === 3) ? this$.fields[0] : ((this$.tag === 2) ? this$.fields[0] : ((this$.tag === 1) ? this$.fields[0] : ((this$.tag === 0) ? this$.fields[0] : undefined)));
496
+ }
493
497
  static component(oa) {
494
498
  return new CompositeHeader(0, [oa]);
495
499
  }
package/Json/Assay.js CHANGED
@@ -71,7 +71,7 @@ export function ROCrate_genID(a) {
71
71
  return "#EmptyAssay";
72
72
  }
73
73
  else {
74
- return `#assay/${replace(matchValue, " ", "_")}`;
74
+ return `assays/${replace(matchValue, " ", "_")}/`;
75
75
  }
76
76
  }
77
77
 
@@ -10,6 +10,7 @@ import { ISAJson_decoder as ISAJson_decoder_5, ISAJson_encoder as ISAJson_encode
10
10
  import { concat, map as map_1 } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
11
11
  import { list as list_1, resizeArray, string, object } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
12
12
  import { ArcInvestigation } from "../Core/ArcTypes.js";
13
+ import { toString, today } from "../fable_modules/fable-library-js.4.24.0/Date.js";
13
14
  import { context_jsonvalue } from "./context/rocrate/isa_investigation_context.js";
14
15
  import { createMissingIdentifier } from "../Core/Helper/Identifier.js";
15
16
  import { distinctBy } from "../fable_modules/fable-library-js.4.24.0/Seq2.js";
@@ -104,7 +105,7 @@ export function ROCrate_genID(i) {
104
105
  }
105
106
 
106
107
  export function ROCrate_encoder(oa) {
107
- let value, value_3, value_4;
108
+ let value, value_3, value_4, value_12, copyOfStruct;
108
109
  const values = choose((tupledArg) => map((v_1) => [tupledArg[0], v_1], tupledArg[1]), ofArray([["@id", (value = ROCrate_genID(oa), {
109
110
  Encode(helpers) {
110
111
  return helpers.encodeString(value);
@@ -137,11 +138,11 @@ export function ROCrate_encoder(oa) {
137
138
  Encode(helpers_7) {
138
139
  return helpers_7.encodeString(value_9);
139
140
  },
140
- }), oa.SubmissionDate), tryInclude("publicReleaseDate", (value_11) => ({
141
+ }), oa.SubmissionDate), ["publicReleaseDate", (value_12 = defaultArg(oa.PublicReleaseDate, (copyOfStruct = today(), toString(copyOfStruct, "yyyy-MM-dd"))), {
141
142
  Encode(helpers_8) {
142
- return helpers_8.encodeString(value_11);
143
+ return helpers_8.encodeString(value_12);
143
144
  },
144
- }), oa.PublicReleaseDate), tryIncludeSeq("ontologySourceReferences", ROCrate_encoder_1, oa.OntologySourceReferences), tryIncludeSeq("publications", ROCrate_encoder_2, oa.Publications), tryIncludeSeq("people", ROCrate_encoder_3, oa.Contacts), tryIncludeSeq("studies", (s) => ROCrate_encoder_4(undefined, s), oa.Studies), tryIncludeSeq("comments", ROCrate_encoder_5, oa.Comments), ["@context", context_jsonvalue]]));
145
+ })], tryIncludeSeq("ontologySourceReferences", ROCrate_encoder_1, oa.OntologySourceReferences), tryIncludeSeq("publications", ROCrate_encoder_2, oa.Publications), tryIncludeSeq("people", ROCrate_encoder_3, oa.Contacts), tryIncludeSeq("studies", (s) => ROCrate_encoder_4(undefined, s), oa.Studies), tryIncludeSeq("comments", ROCrate_encoder_5, oa.Comments), ["@context", context_jsonvalue]]));
145
146
  return {
146
147
  Encode(helpers_9) {
147
148
  const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_9)], values);
package/Json/Study.js CHANGED
@@ -8,7 +8,7 @@ import { ISAJson_decoder as ISAJson_decoder_3, ISAJson_encoder as ISAJson_encode
8
8
  import { OntologyAnnotation_ISAJson_decoder, OntologyAnnotation_ISAJson_encoder, OntologyAnnotation_ROCrate_decoderDefinedTerm, OntologyAnnotation_ROCrate_encoderDefinedTerm, OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./OntologyAnnotation.js";
9
9
  import { decoderCompressed as decoderCompressed_1, encoderCompressed as encoderCompressed_1, decoder as decoder_4, encoder as encoder_7 } from "./Table/ArcTable.js";
10
10
  import { decoderCompressed as decoderCompressed_2, encoderCompressed as encoderCompressed_2, decoder as decoder_5, encoder as encoder_8 } from "./DataMap/DataMap.js";
11
- import { ISAJson_decoder as ISAJson_decoder_5, ISAJson_encoder as ISAJson_encoder_6, ROCrate_decoder as ROCrate_decoder_5, ROCrate_encoder as ROCrate_encoder_5, decoder as decoder_6, encoder as encoder_9 } from "./Comment.js";
11
+ import { ISAJson_decoder as ISAJson_decoder_5, ISAJson_encoder as ISAJson_encoder_6, ROCrate_decoder as ROCrate_decoder_5, ROCrate_encoder as ROCrate_encoder_6, decoder as decoder_6, encoder as encoder_9 } from "./Comment.js";
12
12
  import { isEmpty, map as map_1 } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
13
13
  import { list as list_2, resizeArray, string, object } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
14
14
  import { replace } from "../fable_modules/fable-library-js.4.24.0/String.js";
@@ -17,9 +17,10 @@ import { Person_removeSourceAssayComments, Person_getSourceAssayIdentifiersFromC
17
17
  import { list as list_1 } from "../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
18
18
  import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_4, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_3 } from "./Process/Process.js";
19
19
  import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_5, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_4 } from "./Assay.js";
20
+ import { ROCrate_encoder as ROCrate_encoder_5 } from "./Data.js";
21
+ import { getProtocols, getCharacteristics, getFactors, getUnits, getData } from "../Core/Process/ProcessSequence.js";
20
22
  import { context_jsonvalue } from "./context/rocrate/isa_study_context.js";
21
23
  import { disposeSafe, getEnumerator } from "../fable_modules/fable-library-js.4.24.0/Util.js";
22
- import { getProtocols, getCharacteristics, getFactors, getUnits } from "../Core/Process/ProcessSequence.js";
23
24
  import { encoder as encoder_10 } from "./Process/Factor.js";
24
25
  import { encoder as encoder_11 } from "./Process/MaterialAttribute.js";
25
26
  import { encoder as encoder_12 } from "./Process/StudyMaterials.js";
@@ -127,7 +128,7 @@ export function ROCrate_genID(a) {
127
128
  return "#EmptyStudy";
128
129
  }
129
130
  else {
130
- return `#study/${replace(matchValue, " ", "_")}`;
131
+ return `studies/${replace(matchValue, " ", "_")}/`;
131
132
  }
132
133
  }
133
134
 
@@ -172,7 +173,7 @@ export function ROCrate_encoder(assays, s) {
172
173
  Encode(helpers_8) {
173
174
  return helpers_8.encodeString(value_12);
174
175
  },
175
- }), s.PublicReleaseDate), tryIncludeSeq("publications", ROCrate_encoder_1, s.Publications), tryIncludeSeq("people", ROCrate_encoder_2, s.Contacts), tryIncludeList("processSequence", (studyName = s.Identifier, (oa_3) => ROCrate_encoder_3(studyName, undefined, oa_3)), processes), tryIncludeSeq("assays", (studyName_1 = s.Identifier, (a_1) => ROCrate_encoder_4(studyName_1, a_1)), assays_1), tryIncludeSeq("comments", ROCrate_encoder_5, s.Comments), ["@context", context_jsonvalue]]));
176
+ }), s.PublicReleaseDate), tryIncludeSeq("publications", ROCrate_encoder_1, s.Publications), tryIncludeSeq("people", ROCrate_encoder_2, s.Contacts), tryIncludeList("processSequence", (studyName = s.Identifier, (oa_3) => ROCrate_encoder_3(studyName, undefined, oa_3)), processes), tryIncludeSeq("assays", (studyName_1 = s.Identifier, (a_1) => ROCrate_encoder_4(studyName_1, a_1)), assays_1), tryIncludeList("dataFiles", ROCrate_encoder_5, getData(processes)), tryIncludeSeq("comments", ROCrate_encoder_6, s.Comments), ["@context", context_jsonvalue]]));
176
177
  return {
177
178
  Encode(helpers_9) {
178
179
  const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_9)], values);
@@ -42,7 +42,7 @@ export const context_jsonvalue = (() => {
42
42
  },
43
43
  }], ["title", {
44
44
  Encode(helpers_3) {
45
- return helpers_3.encodeString("sdo:headline");
45
+ return helpers_3.encodeString("sdo:name");
46
46
  },
47
47
  }], ["additionalType", {
48
48
  Encode(helpers_4) {
@@ -93,5 +93,5 @@ export const context_jsonvalue = (() => {
93
93
  };
94
94
  })();
95
95
 
96
- export const context_str = "\r\n{\r\n \"@context\": {\r\n \"sdo\": \"http://schema.org/\",\r\n \"arc\": \"http://purl.org/nfdi4plants/ontology/\",\r\n\r\n \"Investigation\": \"sdo:Dataset\",\r\n\r\n \"identifier\" : \"sdo:identifier\",\r\n \"title\": \"sdo:headline\",\r\n \"description\": \"sdo:description\",\r\n \"submissionDate\": \"sdo:dateCreated\",\r\n \"publicReleaseDate\": \"sdo:datePublished\",\r\n \"publications\": \"sdo:citation\",\r\n \"people\": \"sdo:creator\",\r\n \"studies\": \"sdo:hasPart\",\r\n \"ontologySourceReferences\": \"sdo:mentions\",\r\n \"comments\": \"sdo:disambiguatingDescription\",\r\n\r\n \"publications?\": \"sdo:SubjectOf?\",\r\n \"filename\": \"sdo:alternateName\"\r\n }\r\n}\r\n ";
96
+ export const context_str = "\r\n{\r\n \"@context\": {\r\n \"sdo\": \"http://schema.org/\",\r\n \"arc\": \"http://purl.org/nfdi4plants/ontology/\",\r\n\r\n \"Investigation\": \"sdo:Dataset\",\r\n\r\n \"identifier\" : \"sdo:identifier\",\r\n \"title\": \"sdo:name\",\r\n \"description\": \"sdo:description\",\r\n \"submissionDate\": \"sdo:dateCreated\",\r\n \"publicReleaseDate\": \"sdo:datePublished\",\r\n \"publications\": \"sdo:citation\",\r\n \"people\": \"sdo:creator\",\r\n \"studies\": \"sdo:hasPart\",\r\n \"ontologySourceReferences\": \"sdo:mentions\",\r\n \"comments\": \"sdo:disambiguatingDescription\",\r\n\r\n \"publications?\": \"sdo:SubjectOf?\",\r\n \"filename\": \"sdo:alternateName\"\r\n }\r\n}\r\n ";
97
97
 
@@ -81,27 +81,31 @@ export const context_jsonvalue = (() => {
81
81
  Encode(helpers_10) {
82
82
  return helpers_10.encodeString("sdo:hasPart");
83
83
  },
84
- }], ["filename", {
84
+ }], ["dataFiles", {
85
85
  Encode(helpers_11) {
86
- return helpers_11.encodeString("sdo:alternateName");
86
+ return helpers_11.encodeString("sdo:hasPart");
87
87
  },
88
- }], ["comments", {
88
+ }], ["filename", {
89
89
  Encode(helpers_12) {
90
- return helpers_12.encodeString("sdo:comment");
90
+ return helpers_12.encodeString("sdo:alternateName");
91
91
  },
92
- }], ["processSequence", {
92
+ }], ["comments", {
93
93
  Encode(helpers_13) {
94
- return helpers_13.encodeString("sdo:about");
94
+ return helpers_13.encodeString("sdo:comment");
95
95
  },
96
- }], ["studyDesignDescriptors", {
96
+ }], ["processSequence", {
97
97
  Encode(helpers_14) {
98
- return helpers_14.encodeString("arc:ARC#ARC_00000037");
98
+ return helpers_14.encodeString("sdo:about");
99
+ },
100
+ }], ["studyDesignDescriptors", {
101
+ Encode(helpers_15) {
102
+ return helpers_15.encodeString("arc:ARC#ARC_00000037");
99
103
  },
100
104
  }]];
101
105
  return {
102
- Encode(helpers_15) {
103
- const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_15)], values);
104
- return helpers_15.encodeObject(arg);
106
+ Encode(helpers_16) {
107
+ const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_16)], values);
108
+ return helpers_16.encodeObject(arg);
105
109
  },
106
110
  };
107
111
  })();
@@ -50,7 +50,7 @@ export const context_jsonvalue = (() => {
50
50
  },
51
51
  }], ["conformsTo", {
52
52
  Encode(helpers_4) {
53
- return helpers_4.encodeString("sdo:conformsTo");
53
+ return helpers_4.encodeString("http://purl.org/dc/terms/conformsTo");
54
54
  },
55
55
  }]];
56
56
  return {
package/README.md CHANGED
@@ -1,3 +1,6 @@
1
+
2
+ ![logo](logos/ARCtrl_horizontal.png)
3
+
1
4
  # ARCtrl
2
5
 
3
6
  > **ARCtrl** the easy way to read, manipulate and write ARCs in __.NET__, __JavaScript__ and __Python__! ❤️
@@ -34,9 +37,7 @@ pip install arctrl
34
37
 
35
38
  ## Docs
36
39
 
37
- Currently we provide some documentation in form of markdown files in the `/docs` folder of this repository!
38
-
39
- [Check it out!](/docs)
40
+ Documentation can be found [here](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/arctrl/)
40
41
 
41
42
  ## Development
42
43
 
@@ -75,6 +76,14 @@ On windows you can use the `setup.cmd` to run the following steps automatically!
75
76
 
76
77
  Verify correct setup with `./build.cmd runtests` ✨
77
78
 
79
+ ## Branding
80
+
81
+ Feel free to reference `ARCtrl` on slides or elsewhere using our logos:
82
+
83
+ |Square | Horizontal | Vertical |
84
+ | - | - | - |
85
+ | ![square](logos/ARCtrl_square.png) | ![horizontal](logos/ARCtrl_horizontal.png) | ![vertical](logos/ARCtrl_vertical.png) |
86
+
78
87
  ## Performance
79
88
 
80
89
  Measured on 13th Gen Intel(R) Core(TM) i7-13800H
@@ -1,6 +1,8 @@
1
1
  import { printf, toFail } from "../fable_modules/fable-library-js.4.24.0/String.js";
2
- import { tryPick } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
2
+ import { forAll, tryPick } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
3
3
  import { toFsWorksheet, tryFromFsWorksheet } from "./DataMapTable/DataMapTable.js";
4
+ import { FsCellsCollection__get_Count } from "../fable_modules/FsSpreadsheet.6.3.1/Cells/FsCellsCollection.fs.js";
5
+ import { DataMap_init } from "../Core/DataMap.js";
4
6
  import { FsWorkbook } from "../fable_modules/FsSpreadsheet.6.3.1/FsWorkbook.fs.js";
5
7
 
6
8
  /**
@@ -8,9 +10,15 @@ import { FsWorkbook } from "../fable_modules/FsSpreadsheet.6.3.1/FsWorkbook.fs.j
8
10
  */
9
11
  export function fromFsWorkbook(doc) {
10
12
  try {
11
- const dataMapTable = tryPick(tryFromFsWorksheet, doc.GetWorksheets());
13
+ const worksheets = doc.GetWorksheets();
14
+ const dataMapTable = tryPick(tryFromFsWorksheet, worksheets);
12
15
  if (dataMapTable == null) {
13
- throw new Error("No DataMapTable found in workbook");
16
+ if (forAll((sheet) => (FsCellsCollection__get_Count(sheet.CellCollection) === 0), worksheets)) {
17
+ return DataMap_init();
18
+ }
19
+ else {
20
+ throw new Error("No DataMapTable was found in any of the sheets of the workbook");
21
+ }
14
22
  }
15
23
  else {
16
24
  return dataMapTable;
package/Xlsx.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { toFsWorkbook, fromFsWorkbook } from "./Spreadsheet/DataMap.js";
2
- import { FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static } from "./fable_modules/FsSpreadsheet.Js.6.3.1/FsExtensions.fs.js";
2
+ import { map } from "./CrossAsync.js";
3
+ import { FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static, FsSpreadsheet_FsWorkbook__FsWorkbook_fromXlsxFile_Static_Z721C83C5 } from "./fable_modules/FsSpreadsheet.Js.6.3.1/FsExtensions.fs.js";
3
4
  import { class_type } from "./fable_modules/fable-library-js.4.24.0/Reflection.js";
4
5
  import { ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F, ARCtrl_ArcAssay__ArcAssay_fromFsWorkbook_Static_32154C9D } from "./Spreadsheet/ArcAssay.js";
5
6
  import { ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522, ARCtrl_ArcStudy__ArcStudy_fromFsWorkbook_Static_32154C9D } from "./Spreadsheet/ArcStudy.js";
6
- import { map, unwrap } from "./fable_modules/fable-library-js.4.24.0/Option.js";
7
+ import { map as map_1, unwrap } from "./fable_modules/fable-library-js.4.24.0/Option.js";
7
8
  import { ofSeq } from "./fable_modules/fable-library-js.4.24.0/List.js";
8
9
  import { ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF, ARCtrl_ArcInvestigation__ArcInvestigation_fromFsWorkbook_Static_32154C9D } from "./Spreadsheet/ArcInvestigation.js";
9
10
 
@@ -16,7 +17,10 @@ export class XlsxHelper_DatamapXlsx {
16
17
  toFsWorkbook(datamap) {
17
18
  return toFsWorkbook(datamap);
18
19
  }
19
- toXlsxFile(path, datamap) {
20
+ fromXlsxFileAsync(path) {
21
+ return map(fromFsWorkbook, FsSpreadsheet_FsWorkbook__FsWorkbook_fromXlsxFile_Static_Z721C83C5(path));
22
+ }
23
+ toXlsxFileAsync(path, datamap) {
20
24
  return FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static(path, toFsWorkbook(datamap));
21
25
  }
22
26
  }
@@ -38,7 +42,10 @@ export class XlsxHelper_AssayXlsx {
38
42
  toFsWorkbook(assay) {
39
43
  return ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F(assay);
40
44
  }
41
- toXlsxFile(path, assay) {
45
+ fromXlsxFileAsync(path) {
46
+ return map(ARCtrl_ArcAssay__ArcAssay_fromFsWorkbook_Static_32154C9D, FsSpreadsheet_FsWorkbook__FsWorkbook_fromXlsxFile_Static_Z721C83C5(path));
47
+ }
48
+ toXlsxFileAsync(path, assay) {
42
49
  return FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static(path, ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F(assay));
43
50
  }
44
51
  }
@@ -58,10 +65,13 @@ export class XlsxHelper_StudyXlsx {
58
65
  return ARCtrl_ArcStudy__ArcStudy_fromFsWorkbook_Static_32154C9D(fswb);
59
66
  }
60
67
  toFsWorkbook(study, assays) {
61
- return ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522(study, unwrap(map(ofSeq, assays)));
68
+ return ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522(study, unwrap(map_1(ofSeq, assays)));
62
69
  }
63
- toXlsxFile(path, study, assays) {
64
- return FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static(path, ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522(study, unwrap(map(ofSeq, assays))));
70
+ fromXlsxFileAsync(path) {
71
+ return map(ARCtrl_ArcStudy__ArcStudy_fromFsWorkbook_Static_32154C9D, FsSpreadsheet_FsWorkbook__FsWorkbook_fromXlsxFile_Static_Z721C83C5(path));
72
+ }
73
+ toXlsxFileAsync(path, study, assays) {
74
+ return FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static(path, ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522(study, unwrap(map_1(ofSeq, assays))));
65
75
  }
66
76
  }
67
77
 
@@ -82,7 +92,10 @@ export class XlsxHelper_InvestigationXlsx {
82
92
  toFsWorkbook(investigation) {
83
93
  return ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF(investigation);
84
94
  }
85
- toXlsxFile(path, investigation) {
95
+ fromXlsxFileAsync(path) {
96
+ return map(ARCtrl_ArcInvestigation__ArcInvestigation_fromFsWorkbook_Static_32154C9D, FsSpreadsheet_FsWorkbook__FsWorkbook_fromXlsxFile_Static_Z721C83C5(path));
97
+ }
98
+ toXlsxFileAsync(path, investigation) {
86
99
  return FsSpreadsheet_FsWorkbook__FsWorkbook_toXlsxFile_Static(path, ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF(investigation));
87
100
  }
88
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nfdi4plants/arctrl",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Top level ARC DataModel and API function descriptions.",
5
5
  "type": "module",
6
6
  "main": "index.js",