@nfdi4plants/arctrl 2.4.0 → 2.5.1

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.
Files changed (79) hide show
  1. package/ARC.js +103 -12
  2. package/CWL/CWLTypes.js +2 -2
  3. package/CWL/Decode.js +2 -2
  4. package/CWL/Inputs.js +2 -2
  5. package/CWL/Outputs.js +2 -2
  6. package/CWL/Requirements.js +2 -2
  7. package/CWL/ToolDescription.js +1 -1
  8. package/CWL/WorkflowDescription.js +1 -1
  9. package/CWL/WorkflowSteps.js +1 -1
  10. package/ColumnIndex.js +258 -0
  11. package/Conversion.js +1679 -0
  12. package/Core/Data.js +28 -3
  13. package/Core/DataFile.js +19 -3
  14. package/Core/Helper/Collections.js +107 -4
  15. package/Core/Helper/DateTime.js +17 -0
  16. package/Core/Helper/ORCID.js +39 -0
  17. package/Json/Decode.js +3 -3
  18. package/Json/Encode.js +9 -0
  19. package/Json/OntologySourceReference.js +4 -4
  20. package/Json/ROCrate/LDContext.js +121 -0
  21. package/Json/ROCrate/LDGraph.js +87 -0
  22. package/Json/{LDObject.js → ROCrate/LDNode.js} +55 -46
  23. package/Json/ROCrate/LDRef.js +25 -0
  24. package/Json/ROCrate/LDValue.js +66 -0
  25. package/JsonIO/LDObject.js +30 -5
  26. package/ROCrate/ArcROCrateMetadata.js +14 -13
  27. package/ROCrate/Generic/Comment.js +115 -0
  28. package/ROCrate/Generic/Dataset.js +669 -0
  29. package/ROCrate/Generic/DefinedTerm.js +115 -0
  30. package/ROCrate/Generic/File.js +200 -0
  31. package/ROCrate/Generic/LabProcess.js +238 -0
  32. package/ROCrate/Generic/LabProtocol.js +275 -0
  33. package/ROCrate/Generic/Organization.js +71 -0
  34. package/ROCrate/Generic/Person.js +411 -0
  35. package/ROCrate/Generic/PostalAddress.js +159 -0
  36. package/ROCrate/Generic/PropertyValue.js +548 -0
  37. package/ROCrate/Generic/Sample.js +139 -0
  38. package/ROCrate/Generic/ScholarlyArticle.js +187 -0
  39. package/ROCrate/Helper.js +6 -0
  40. package/ROCrate/ISAProfile/Assay.js +3 -3
  41. package/ROCrate/ISAProfile/Data.js +7 -7
  42. package/ROCrate/ISAProfile/Dataset.js +7 -6
  43. package/ROCrate/ISAProfile/Investigation.js +3 -3
  44. package/ROCrate/ISAProfile/LabProcess.js +7 -7
  45. package/ROCrate/ISAProfile/LabProtocol.js +7 -7
  46. package/ROCrate/ISAProfile/Person.js +7 -7
  47. package/ROCrate/ISAProfile/PropertyValue.js +7 -7
  48. package/ROCrate/ISAProfile/Sample.js +7 -7
  49. package/ROCrate/ISAProfile/ScholarlyArticle.js +7 -7
  50. package/ROCrate/ISAProfile/Study.js +3 -3
  51. package/ROCrate/LDContext.js +283 -0
  52. package/ROCrate/LDObject.js +902 -36
  53. package/ROCrate/ROCrateContext.js +44 -0
  54. package/ROCrateIO.js +62 -0
  55. package/Spreadsheet/DataMapTable/DataMapHeader.js +3 -2
  56. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs +31 -1
  57. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs.js +30 -1
  58. package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs +1025 -0
  59. package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +433 -0
  60. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs +16 -0
  61. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FablePy.fs +14 -0
  62. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs +15 -0
  63. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs.js +4 -0
  64. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/DynamicObj.AssemblyInfo.fs +1 -1
  65. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/DynamicObj.AssemblyInfo.fs +3 -3
  66. package/fable_modules/project_cracked.json +1 -1
  67. package/package.json +1 -1
  68. package/Json/ARC.js +0 -31
  69. package/JsonIO/ARC.js +0 -31
  70. package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs +0 -310
  71. package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js +0 -166
  72. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynamicObj.fableproj +0 -0
  73. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs.js +0 -0
  74. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs +0 -0
  75. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs.js +0 -0
  76. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs +0 -0
  77. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs.js +0 -0
  78. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  79. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
@@ -0,0 +1,548 @@
1
+ import { toArray, defaultArg, value as value_3, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
2
+ import { ResizeArray_map } from "../../Core/Helper/Collections.js";
3
+ import { contains } from "../../fable_modules/fable-library-js.4.24.0/Array.js";
4
+ import { stringHash } from "../../fable_modules/fable-library-js.4.24.0/Util.js";
5
+ import { clean } from "../Helper.js";
6
+ import { LDNode } from "../LDObject.js";
7
+ import { iterate } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
8
+ import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
9
+
10
+ export class LDPropertyValue {
11
+ constructor() {
12
+ }
13
+ static get schemaType() {
14
+ return "http://schema.org/PropertyValue";
15
+ }
16
+ static get name() {
17
+ return "http://schema.org/name";
18
+ }
19
+ static get value() {
20
+ return "http://schema.org/value";
21
+ }
22
+ static get propertyID() {
23
+ return "http://schema.org/propertyID";
24
+ }
25
+ static get unitCode() {
26
+ return "http://schema.org/unitCode";
27
+ }
28
+ static get unitText() {
29
+ return "http://schema.org/unitText";
30
+ }
31
+ static get valueReference() {
32
+ return "http://schema.org/valueReference";
33
+ }
34
+ static get measurementMethod() {
35
+ return "http://schema.org/measurementMethod";
36
+ }
37
+ static get description() {
38
+ return "http://schema.org/description";
39
+ }
40
+ static get alternateName() {
41
+ return "http://schema.org/alternateName";
42
+ }
43
+ static get subjectOf() {
44
+ return "http://schema.org/subjectOf";
45
+ }
46
+ static get disambiguatingDescription() {
47
+ return "http://schema.org/disambiguatingDescription";
48
+ }
49
+ static get doiKey() {
50
+ return "DOI";
51
+ }
52
+ static get doiURL() {
53
+ return "http://purl.obolibrary.org/obo/OBI_0002110";
54
+ }
55
+ static get pubmedIDKey() {
56
+ return "PubMedID";
57
+ }
58
+ static get pubmedIDURL() {
59
+ return "http://purl.obolibrary.org/obo/OBI_0001617";
60
+ }
61
+ static tryGetNameAsString(pv, context) {
62
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.name, unwrap(context));
63
+ let matchResult, n;
64
+ if (matchValue != null) {
65
+ if (typeof value_3(matchValue) === "string") {
66
+ matchResult = 0;
67
+ n = value_3(matchValue);
68
+ }
69
+ else {
70
+ matchResult = 1;
71
+ }
72
+ }
73
+ else {
74
+ matchResult = 1;
75
+ }
76
+ switch (matchResult) {
77
+ case 0:
78
+ return n;
79
+ default:
80
+ return undefined;
81
+ }
82
+ }
83
+ static getNameAsString(pv, context) {
84
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.name, unwrap(context));
85
+ if (matchValue != null) {
86
+ if (typeof value_3(matchValue) === "string") {
87
+ const n = value_3(matchValue);
88
+ return n;
89
+ }
90
+ else {
91
+ throw new Error(`Property of \`name\` of object with @id \`${pv.Id}\` was not a string`);
92
+ }
93
+ }
94
+ else {
95
+ throw new Error(`Could not access property \`name\` of object with @id \`${pv.Id}\``);
96
+ }
97
+ }
98
+ static setNameAsString(pv, name, context) {
99
+ return pv.SetProperty(LDPropertyValue.name, name, unwrap(context));
100
+ }
101
+ static tryGetValueAsString(pv, context) {
102
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.value, unwrap(context));
103
+ let matchResult, v;
104
+ if (matchValue != null) {
105
+ if (typeof value_3(matchValue) === "string") {
106
+ matchResult = 0;
107
+ v = value_3(matchValue);
108
+ }
109
+ else {
110
+ matchResult = 1;
111
+ }
112
+ }
113
+ else {
114
+ matchResult = 1;
115
+ }
116
+ switch (matchResult) {
117
+ case 0:
118
+ return v;
119
+ default:
120
+ return undefined;
121
+ }
122
+ }
123
+ static getValueAsString(pv, context) {
124
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.value, unwrap(context));
125
+ if (matchValue != null) {
126
+ if (typeof value_3(matchValue) === "string") {
127
+ const v = value_3(matchValue);
128
+ return v;
129
+ }
130
+ else {
131
+ throw new Error(`Property of \`value\` of object with @id \`${pv.Id}\` was not a string`);
132
+ }
133
+ }
134
+ else {
135
+ throw new Error(`Could not access property \`value\` of object with @id \`${pv.Id}\``);
136
+ }
137
+ }
138
+ static setValueAsString(pv, value, context) {
139
+ return pv.SetProperty(LDPropertyValue.value, value, unwrap(context));
140
+ }
141
+ static tryGetPropertyIDAsString(pv, context) {
142
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.propertyID, unwrap(context));
143
+ let matchResult, pid;
144
+ if (matchValue != null) {
145
+ if (typeof value_3(matchValue) === "string") {
146
+ matchResult = 0;
147
+ pid = value_3(matchValue);
148
+ }
149
+ else {
150
+ matchResult = 1;
151
+ }
152
+ }
153
+ else {
154
+ matchResult = 1;
155
+ }
156
+ switch (matchResult) {
157
+ case 0:
158
+ return pid;
159
+ default:
160
+ return undefined;
161
+ }
162
+ }
163
+ static setPropertyIDAsString(pv, propertyID, context) {
164
+ return pv.SetProperty(LDPropertyValue.propertyID, propertyID, unwrap(context));
165
+ }
166
+ static tryGetUnitCodeAsString(pv, context) {
167
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.unitCode, unwrap(context));
168
+ let matchResult, uc;
169
+ if (matchValue != null) {
170
+ if (typeof value_3(matchValue) === "string") {
171
+ matchResult = 0;
172
+ uc = value_3(matchValue);
173
+ }
174
+ else {
175
+ matchResult = 1;
176
+ }
177
+ }
178
+ else {
179
+ matchResult = 1;
180
+ }
181
+ switch (matchResult) {
182
+ case 0:
183
+ return uc;
184
+ default:
185
+ return undefined;
186
+ }
187
+ }
188
+ static setUnitCodeAsString(pv, unitCode, context) {
189
+ return pv.SetProperty(LDPropertyValue.unitCode, unitCode, unwrap(context));
190
+ }
191
+ static tryGetUnitTextAsString(pv, context) {
192
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.unitText, unwrap(context));
193
+ let matchResult, ut;
194
+ if (matchValue != null) {
195
+ if (typeof value_3(matchValue) === "string") {
196
+ matchResult = 0;
197
+ ut = value_3(matchValue);
198
+ }
199
+ else {
200
+ matchResult = 1;
201
+ }
202
+ }
203
+ else {
204
+ matchResult = 1;
205
+ }
206
+ switch (matchResult) {
207
+ case 0:
208
+ return ut;
209
+ default:
210
+ return undefined;
211
+ }
212
+ }
213
+ static setUnitTextAsString(pv, unitText, context) {
214
+ return pv.SetProperty(LDPropertyValue.unitText, unitText, unwrap(context));
215
+ }
216
+ static tryGetValueReferenceAsString(pv, context) {
217
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.valueReference, unwrap(context));
218
+ let matchResult, vr;
219
+ if (matchValue != null) {
220
+ if (typeof value_3(matchValue) === "string") {
221
+ matchResult = 0;
222
+ vr = value_3(matchValue);
223
+ }
224
+ else {
225
+ matchResult = 1;
226
+ }
227
+ }
228
+ else {
229
+ matchResult = 1;
230
+ }
231
+ switch (matchResult) {
232
+ case 0:
233
+ return vr;
234
+ default:
235
+ return undefined;
236
+ }
237
+ }
238
+ static setValueReferenceAsString(pv, valueReference, context) {
239
+ return pv.SetProperty(LDPropertyValue.valueReference, valueReference, unwrap(context));
240
+ }
241
+ static tryGetMeasurementMethodAsString(pv, context) {
242
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.measurementMethod, unwrap(context));
243
+ let matchResult, vr;
244
+ if (matchValue != null) {
245
+ if (typeof value_3(matchValue) === "string") {
246
+ matchResult = 0;
247
+ vr = value_3(matchValue);
248
+ }
249
+ else {
250
+ matchResult = 1;
251
+ }
252
+ }
253
+ else {
254
+ matchResult = 1;
255
+ }
256
+ switch (matchResult) {
257
+ case 0:
258
+ return vr;
259
+ default:
260
+ return undefined;
261
+ }
262
+ }
263
+ static setMeasurementMethodAsString(pv, measurementMethod, context) {
264
+ return pv.SetProperty(LDPropertyValue.measurementMethod, measurementMethod, unwrap(context));
265
+ }
266
+ static tryGetDescriptionAsString(pv, context) {
267
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.description, unwrap(context));
268
+ let matchResult, vr;
269
+ if (matchValue != null) {
270
+ if (typeof value_3(matchValue) === "string") {
271
+ matchResult = 0;
272
+ vr = value_3(matchValue);
273
+ }
274
+ else {
275
+ matchResult = 1;
276
+ }
277
+ }
278
+ else {
279
+ matchResult = 1;
280
+ }
281
+ switch (matchResult) {
282
+ case 0:
283
+ return vr;
284
+ default:
285
+ return undefined;
286
+ }
287
+ }
288
+ static setDescriptionAsString(pv, description, context) {
289
+ return pv.SetProperty(LDPropertyValue.description, description, unwrap(context));
290
+ }
291
+ static tryGetAlternateNameAsString(pv, context) {
292
+ const matchValue = pv.TryGetPropertyAsSingleton(LDPropertyValue.alternateName, unwrap(context));
293
+ let matchResult, vr;
294
+ if (matchValue != null) {
295
+ if (typeof value_3(matchValue) === "string") {
296
+ matchResult = 0;
297
+ vr = value_3(matchValue);
298
+ }
299
+ else {
300
+ matchResult = 1;
301
+ }
302
+ }
303
+ else {
304
+ matchResult = 1;
305
+ }
306
+ switch (matchResult) {
307
+ case 0:
308
+ return vr;
309
+ default:
310
+ return undefined;
311
+ }
312
+ }
313
+ static setAlternateNameAsString(pv, alternateName, context) {
314
+ return pv.SetProperty(LDPropertyValue.alternateName, alternateName, unwrap(context));
315
+ }
316
+ static getDisambiguatingDescriptionsAsString(pv, context) {
317
+ return ResizeArray_map((o_1) => o_1, pv.GetPropertyValues(LDPropertyValue.disambiguatingDescription, (o, context_1) => (typeof o === "string"), unwrap(context)));
318
+ }
319
+ static setDisambiguatingDescriptionsAsString(lp, disambiguatingDescriptions, context) {
320
+ return lp.SetProperty(LDPropertyValue.disambiguatingDescription, disambiguatingDescriptions, unwrap(context));
321
+ }
322
+ static tryGetSubjectOf(pv, graph, context) {
323
+ const matchValue = pv.TryGetPropertyAsSingleNode(LDPropertyValue.subjectOf, unwrap(graph), unwrap(context));
324
+ return (matchValue != null) ? matchValue : undefined;
325
+ }
326
+ static setSubjectOf(pv, subjectOf, context) {
327
+ return pv.SetProperty(LDPropertyValue.subjectOf, subjectOf, unwrap(context));
328
+ }
329
+ static validate(pv, context) {
330
+ return pv.HasType(LDPropertyValue.schemaType, unwrap(context)) && pv.HasProperty(LDPropertyValue.name, unwrap(context));
331
+ }
332
+ static validateComponent(pv, context) {
333
+ return LDPropertyValue.validate(pv, unwrap(context)) && contains("Component", pv.AdditionalType, {
334
+ Equals: (x, y) => (x === y),
335
+ GetHashCode: stringHash,
336
+ });
337
+ }
338
+ static validateParameterValue(pv, context) {
339
+ return LDPropertyValue.validate(pv, unwrap(context)) && (contains("ParameterValue", pv.AdditionalType, {
340
+ Equals: (x, y) => (x === y),
341
+ GetHashCode: stringHash,
342
+ }) ? true : contains("ProcessParameterValue", pv.AdditionalType, {
343
+ Equals: (x_1, y_1) => (x_1 === y_1),
344
+ GetHashCode: stringHash,
345
+ }));
346
+ }
347
+ static validateCharacteristicValue(pv, context) {
348
+ return LDPropertyValue.validate(pv, unwrap(context)) && (contains("CharacteristicValue", pv.AdditionalType, {
349
+ Equals: (x, y) => (x === y),
350
+ GetHashCode: stringHash,
351
+ }) ? true : contains("MaterialAttributeValue", pv.AdditionalType, {
352
+ Equals: (x_1, y_1) => (x_1 === y_1),
353
+ GetHashCode: stringHash,
354
+ }));
355
+ }
356
+ static validateFactorValue(pv, context) {
357
+ return LDPropertyValue.validate(pv, unwrap(context)) && contains("FactorValue", pv.AdditionalType, {
358
+ Equals: (x, y) => (x === y),
359
+ GetHashCode: stringHash,
360
+ });
361
+ }
362
+ static validateFragmentDescriptor(pv, context) {
363
+ return LDPropertyValue.validate(pv, unwrap(context)) && (LDPropertyValue.getNameAsString(pv, unwrap(context)) === "FragmentDescriptor");
364
+ }
365
+ static validateDOI(pv, context) {
366
+ let value, id;
367
+ if (LDPropertyValue.validate(pv, unwrap(context))) {
368
+ const matchValue = LDPropertyValue.tryGetNameAsString(pv, unwrap(context));
369
+ const matchValue_1 = LDPropertyValue.tryGetValueAsString(pv, unwrap(context));
370
+ const matchValue_2 = LDPropertyValue.tryGetPropertyIDAsString(pv, unwrap(context));
371
+ let matchResult, id_1, name_1, value_1;
372
+ if (matchValue != null) {
373
+ if (matchValue_1 != null) {
374
+ if (matchValue_2 != null) {
375
+ if ((value = matchValue_1, (id = matchValue_2, (matchValue === LDPropertyValue.doiKey) && (id === LDPropertyValue.doiURL)))) {
376
+ matchResult = 0;
377
+ id_1 = matchValue_2;
378
+ name_1 = matchValue;
379
+ value_1 = matchValue_1;
380
+ }
381
+ else {
382
+ matchResult = 1;
383
+ }
384
+ }
385
+ else {
386
+ matchResult = 1;
387
+ }
388
+ }
389
+ else {
390
+ matchResult = 1;
391
+ }
392
+ }
393
+ else {
394
+ matchResult = 1;
395
+ }
396
+ switch (matchResult) {
397
+ case 0:
398
+ return true;
399
+ default:
400
+ return false;
401
+ }
402
+ }
403
+ else {
404
+ return false;
405
+ }
406
+ }
407
+ static validatePubMedID(pv, context) {
408
+ let value, id;
409
+ if (LDPropertyValue.validate(pv, unwrap(context))) {
410
+ const matchValue = LDPropertyValue.tryGetNameAsString(pv, unwrap(context));
411
+ const matchValue_1 = LDPropertyValue.tryGetValueAsString(pv, unwrap(context));
412
+ const matchValue_2 = LDPropertyValue.tryGetPropertyIDAsString(pv, unwrap(context));
413
+ let matchResult, id_1, name_1, value_1;
414
+ if (matchValue != null) {
415
+ if (matchValue_1 != null) {
416
+ if (matchValue_2 != null) {
417
+ if ((value = matchValue_1, (id = matchValue_2, (matchValue === LDPropertyValue.pubmedIDKey) && (id === LDPropertyValue.pubmedIDURL)))) {
418
+ matchResult = 0;
419
+ id_1 = matchValue_2;
420
+ name_1 = matchValue;
421
+ value_1 = matchValue_1;
422
+ }
423
+ else {
424
+ matchResult = 1;
425
+ }
426
+ }
427
+ else {
428
+ matchResult = 1;
429
+ }
430
+ }
431
+ else {
432
+ matchResult = 1;
433
+ }
434
+ }
435
+ else {
436
+ matchResult = 1;
437
+ }
438
+ switch (matchResult) {
439
+ case 0:
440
+ return true;
441
+ default:
442
+ return false;
443
+ }
444
+ }
445
+ else {
446
+ return false;
447
+ }
448
+ }
449
+ static genId(name, value, propertyID, prefix) {
450
+ let pid_1, value_2, pid, value_1;
451
+ const prefix_1 = defaultArg(prefix, "PV");
452
+ return clean((value == null) ? ((propertyID != null) ? ((pid_1 = propertyID, `#${prefix_1}_${name}`)) : (`#${prefix_1}_${name}`)) : ((propertyID == null) ? ((value_2 = value, `#${prefix_1}_${name}_${value_2}`)) : ((pid = propertyID, (value_1 = value, `#${prefix_1}_${name}_${value_1}`)))));
453
+ }
454
+ static genIdComponent(name, value, propertyID) {
455
+ return LDPropertyValue.genId(name, unwrap(value), unwrap(propertyID), "Component");
456
+ }
457
+ static genIdParameterValue(name, value, propertyID) {
458
+ return LDPropertyValue.genId(name, unwrap(value), unwrap(propertyID), "ParameterValue");
459
+ }
460
+ static genIdCharacteristicValue(name, value, propertyID) {
461
+ return LDPropertyValue.genId(name, unwrap(value), unwrap(propertyID), "CharacteristicValue");
462
+ }
463
+ static genIdFactorValue(name, value, propertyID) {
464
+ return LDPropertyValue.genId(name, unwrap(value), unwrap(propertyID), "FactorValue");
465
+ }
466
+ static genIdFragmentDescriptor(fileName) {
467
+ return `#Descriptor_${fileName}`;
468
+ }
469
+ static create(name, value, id, propertyID, unitCode, unitText, valueReference, context) {
470
+ const pv = new LDNode((id == null) ? LDPropertyValue.genId(name, unwrap(value), unwrap(propertyID)) : id, [LDPropertyValue.schemaType], undefined, unwrap(context));
471
+ LDPropertyValue.setNameAsString(pv, name, unwrap(context));
472
+ pv.SetOptionalProperty(LDPropertyValue.value, value, unwrap(context));
473
+ iterate((pid) => {
474
+ LDPropertyValue.setPropertyIDAsString(pv, pid, unwrap(context));
475
+ }, toArray(propertyID));
476
+ iterate((uc) => {
477
+ LDPropertyValue.setUnitCodeAsString(pv, uc, unwrap(context));
478
+ }, toArray(unitCode));
479
+ iterate((ut) => {
480
+ LDPropertyValue.setUnitTextAsString(pv, ut, unwrap(context));
481
+ }, toArray(unitText));
482
+ iterate((vr) => {
483
+ LDPropertyValue.setValueReferenceAsString(pv, vr, unwrap(context));
484
+ }, toArray(valueReference));
485
+ return pv;
486
+ }
487
+ static createComponent(name, value, id, propertyID, unitCode, unitText, valueReference, context) {
488
+ const id_1 = (id == null) ? LDPropertyValue.genIdComponent(name, unwrap(value), unwrap(propertyID)) : id;
489
+ const c = LDPropertyValue.create(name, unwrap(value), id_1, unwrap(propertyID), unwrap(unitCode), unwrap(unitText), unwrap(valueReference), unwrap(context));
490
+ c.AdditionalType = ["Component"];
491
+ return c;
492
+ }
493
+ static createParameterValue(name, value, id, propertyID, unitCode, unitText, valueReference, context) {
494
+ const id_1 = (id == null) ? LDPropertyValue.genIdParameterValue(name, unwrap(value), unwrap(propertyID)) : id;
495
+ const pv = LDPropertyValue.create(name, unwrap(value), id_1, unwrap(propertyID), unwrap(unitCode), unwrap(unitText), unwrap(valueReference), unwrap(context));
496
+ pv.AdditionalType = ["ParameterValue"];
497
+ return pv;
498
+ }
499
+ static createCharacteristicValue(name, value, id, propertyID, unitCode, unitText, valueReference, context) {
500
+ const id_1 = (id == null) ? LDPropertyValue.genIdCharacteristicValue(name, unwrap(value), unwrap(propertyID)) : id;
501
+ const cv = LDPropertyValue.create(name, unwrap(value), id_1, unwrap(propertyID), unwrap(unitCode), unwrap(unitText), unwrap(valueReference), unwrap(context));
502
+ cv.AdditionalType = ["CharacteristicValue"];
503
+ return cv;
504
+ }
505
+ static createFactorValue(name, value, id, propertyID, unitCode, unitText, valueReference, context) {
506
+ const id_1 = (id == null) ? LDPropertyValue.genIdFactorValue(name, unwrap(value), unwrap(propertyID)) : id;
507
+ const fv = LDPropertyValue.create(name, unwrap(value), id_1, unwrap(propertyID), unwrap(unitCode), unwrap(unitText), unwrap(valueReference), unwrap(context));
508
+ fv.AdditionalType = ["FactorValue"];
509
+ return fv;
510
+ }
511
+ static createFragmentDescriptor(fileName, value, id, unitCode, unitText, valueReference, measurementMethod, description, alternateName, disambiguatingDescriptions, subjectOf, context) {
512
+ const id_1 = (id == null) ? LDPropertyValue.genIdFragmentDescriptor(fileName) : id;
513
+ const fd = LDPropertyValue.create("FragmentDescriptor", unwrap(value), id_1, "https://github.com/nfdi4plants/ARC-specification/blob/dev/ISA-XLSX.md#datamap-table-sheets", unwrap(unitCode), unwrap(unitText), unwrap(valueReference), unwrap(context));
514
+ if (measurementMethod != null) {
515
+ LDPropertyValue.setMeasurementMethodAsString(fd, value_3(measurementMethod), unwrap(context));
516
+ }
517
+ if (description != null) {
518
+ LDPropertyValue.setDescriptionAsString(fd, value_3(description), unwrap(context));
519
+ }
520
+ if (alternateName != null) {
521
+ LDPropertyValue.setAlternateNameAsString(fd, value_3(alternateName), unwrap(context));
522
+ }
523
+ if (disambiguatingDescriptions != null) {
524
+ LDPropertyValue.setDisambiguatingDescriptionsAsString(fd, value_3(disambiguatingDescriptions), unwrap(context));
525
+ }
526
+ if (subjectOf != null) {
527
+ LDPropertyValue.setSubjectOf(fd, value_3(subjectOf), unwrap(context));
528
+ }
529
+ return fd;
530
+ }
531
+ static createDOI(value, context) {
532
+ return LDPropertyValue.create(LDPropertyValue.doiKey, value, value, LDPropertyValue.doiURL, undefined, undefined, undefined, unwrap(context));
533
+ }
534
+ static createPubMedID(value, context) {
535
+ return LDPropertyValue.create(LDPropertyValue.pubmedIDKey, value, value, LDPropertyValue.pubmedIDURL, undefined, undefined, undefined, unwrap(context));
536
+ }
537
+ static tryGetAsDOI(pv, context) {
538
+ return LDPropertyValue.validateDOI(pv, unwrap(context)) ? LDPropertyValue.getValueAsString(pv, unwrap(context)) : undefined;
539
+ }
540
+ static tryGetAsPubMedID(pv, context) {
541
+ return LDPropertyValue.validatePubMedID(pv, unwrap(context)) ? LDPropertyValue.getValueAsString(pv, unwrap(context)) : undefined;
542
+ }
543
+ }
544
+
545
+ export function LDPropertyValue_$reflection() {
546
+ return class_type("ARCtrl.ROCrate.LDPropertyValue", undefined, LDPropertyValue);
547
+ }
548
+
@@ -0,0 +1,139 @@
1
+ import { value, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
2
+ import { LDPropertyValue } from "./PropertyValue.js";
3
+ import { clean } from "../Helper.js";
4
+ import { contains } from "../../fable_modules/fable-library-js.4.24.0/Array.js";
5
+ import { stringHash } from "../../fable_modules/fable-library-js.4.24.0/Util.js";
6
+ import { LDNode } from "../LDObject.js";
7
+ import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
8
+
9
+ export class LDSample {
10
+ constructor() {
11
+ }
12
+ static get schemaType() {
13
+ return "https://bioschemas.org/Sample";
14
+ }
15
+ static get name() {
16
+ return "http://schema.org/name";
17
+ }
18
+ static get additionalProperty() {
19
+ return "http://schema.org/additionalProperty";
20
+ }
21
+ static tryGetNameAsString(s, context) {
22
+ const matchValue = s.TryGetPropertyAsSingleton(LDSample.name, unwrap(context));
23
+ let matchResult, n;
24
+ if (matchValue != null) {
25
+ if (typeof value(matchValue) === "string") {
26
+ matchResult = 0;
27
+ n = value(matchValue);
28
+ }
29
+ else {
30
+ matchResult = 1;
31
+ }
32
+ }
33
+ else {
34
+ matchResult = 1;
35
+ }
36
+ switch (matchResult) {
37
+ case 0:
38
+ return n;
39
+ default:
40
+ return undefined;
41
+ }
42
+ }
43
+ static getNameAsString(s, context) {
44
+ const matchValue = s.TryGetPropertyAsSingleton(LDSample.name, unwrap(context));
45
+ let matchResult, n;
46
+ if (matchValue != null) {
47
+ if (typeof value(matchValue) === "string") {
48
+ matchResult = 0;
49
+ n = value(matchValue);
50
+ }
51
+ else {
52
+ matchResult = 1;
53
+ }
54
+ }
55
+ else {
56
+ matchResult = 1;
57
+ }
58
+ switch (matchResult) {
59
+ case 0:
60
+ return n;
61
+ default:
62
+ throw new Error(`Could not access property \`name\` of object with @id \`${s.Id}\``);
63
+ }
64
+ }
65
+ static setNameAsString(s, n) {
66
+ s.SetProperty(LDSample.name, n);
67
+ }
68
+ static getAdditionalProperties(s, graph, context) {
69
+ return s.GetPropertyNodes(LDSample.additionalProperty, (ldObject, context_1) => LDPropertyValue.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
70
+ }
71
+ static setAdditionalProperties(s, additionalProperties, context) {
72
+ return s.SetProperty(LDSample.additionalProperty, additionalProperties, unwrap(context));
73
+ }
74
+ static getCharacteristics(s, graph, context) {
75
+ return s.GetPropertyNodes(LDSample.additionalProperty, (ldObject, context_1) => LDPropertyValue.validateCharacteristicValue(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
76
+ }
77
+ static getFactors(s, graph, context) {
78
+ return s.GetPropertyNodes(LDSample.additionalProperty, (ldObject, context_1) => LDPropertyValue.validateFactorValue(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
79
+ }
80
+ static validate(s, context) {
81
+ return s.HasType(LDSample.schemaType, unwrap(context)) && s.HasProperty(LDSample.name, unwrap(context));
82
+ }
83
+ static genIDSample(name) {
84
+ return clean(`#Sample_${name}`);
85
+ }
86
+ static genIDSource(name) {
87
+ return clean(`#Source_${name}`);
88
+ }
89
+ static genIDMaterial(name) {
90
+ return clean(`#Material_${name}`);
91
+ }
92
+ static validateSample(s, context) {
93
+ return LDSample.validate(s, unwrap(context)) && contains("Sample", s.AdditionalType, {
94
+ Equals: (x, y) => (x === y),
95
+ GetHashCode: stringHash,
96
+ });
97
+ }
98
+ static validateSource(s, context) {
99
+ return LDSample.validate(s, unwrap(context)) && contains("Source", s.AdditionalType, {
100
+ Equals: (x, y) => (x === y),
101
+ GetHashCode: stringHash,
102
+ });
103
+ }
104
+ static validateMaterial(s, context) {
105
+ return LDSample.validate(s, unwrap(context)) && contains("Material", s.AdditionalType, {
106
+ Equals: (x, y) => (x === y),
107
+ GetHashCode: stringHash,
108
+ });
109
+ }
110
+ static create(id, name, additionalProperties, context) {
111
+ const s = new LDNode(id, [LDSample.schemaType], undefined, unwrap(context));
112
+ s.SetProperty(LDSample.name, name, unwrap(context));
113
+ s.SetOptionalProperty(LDSample.additionalProperty, additionalProperties, unwrap(context));
114
+ return s;
115
+ }
116
+ static createSample(name, id, additionalProperties, context) {
117
+ const id_2 = (id == null) ? LDSample.genIDSample(name) : id;
118
+ const s = LDSample.create(id_2, name, unwrap(additionalProperties), unwrap(context));
119
+ s.AdditionalType = ["Sample"];
120
+ return s;
121
+ }
122
+ static createSource(name, id, additionalProperties, context) {
123
+ const id_2 = (id == null) ? LDSample.genIDSource(name) : id;
124
+ const s = LDSample.create(id_2, name, unwrap(additionalProperties), unwrap(context));
125
+ s.AdditionalType = ["Source"];
126
+ return s;
127
+ }
128
+ static createMaterial(name, id, additionalProperties, context) {
129
+ const id_2 = (id == null) ? LDSample.genIDMaterial(name) : id;
130
+ const s = LDSample.create(id_2, name, unwrap(additionalProperties), unwrap(context));
131
+ s.AdditionalType = ["Material"];
132
+ return s;
133
+ }
134
+ }
135
+
136
+ export function LDSample_$reflection() {
137
+ return class_type("ARCtrl.ROCrate.LDSample", undefined, LDSample);
138
+ }
139
+