@nfdi4plants/arctrl 3.0.0-alpha.2 → 3.0.0-alpha.4
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/README.md +12 -12
- package/dist/ts/cjs/index.js +47 -1
- package/dist/ts/cjs/ts/Conversion.js +39 -11
- package/dist/ts/cjs/ts/Core/Helper/Collections.js +15 -0
- package/dist/ts/cjs/ts/Core/Table/ArcTableAux.js +39 -8
- package/dist/ts/cjs/ts/Json/StringTable.js +9 -2
- package/dist/ts/cjs/ts/Json/Table/CellTable.js +2 -2
- package/dist/ts/cjs/ts/Json/Table/OATable.js +2 -2
- package/dist/ts/cjs/ts/JsonIO/LDObject.js +107 -0
- package/dist/ts/cjs/ts/JsonIO/Table/Compression.js +4 -11
- package/dist/ts/cjs/ts/ROCrate/Generic/LabProcess.js +1 -1
- package/dist/ts/cjs/ts/ROCrate/LDContext.js +92 -54
- package/dist/ts/esm/index.js +45 -1
- package/dist/ts/esm/ts/Conversion.js +34 -8
- package/dist/ts/esm/ts/Core/Helper/Collections.js +12 -0
- package/dist/ts/esm/ts/Core/Table/ArcTableAux.js +36 -8
- package/dist/ts/esm/ts/Json/StringTable.js +10 -3
- package/dist/ts/esm/ts/Json/Table/CellTable.js +2 -2
- package/dist/ts/esm/ts/Json/Table/OATable.js +2 -2
- package/dist/ts/esm/ts/JsonIO/LDObject.js +94 -0
- package/dist/ts/esm/ts/JsonIO/Table/Compression.js +4 -11
- package/dist/ts/esm/ts/ROCrate/Generic/LabProcess.js +1 -1
- package/dist/ts/esm/ts/ROCrate/LDContext.js +106 -66
- package/dist/ts/types/index.d.ts +44 -1
- package/dist/ts/types/index.d.ts.map +1 -1
- package/dist/ts/types/ts/Conversion.d.ts +13 -3
- package/dist/ts/types/ts/Conversion.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts +3 -0
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts +5 -2
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/StringTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Table/CellTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Table/OATable.d.ts.map +1 -1
- package/dist/ts/types/ts/JsonIO/LDObject.d.ts +29 -0
- package/dist/ts/types/ts/JsonIO/LDObject.d.ts.map +1 -0
- package/dist/ts/types/ts/JsonIO/Table/Compression.d.ts.map +1 -1
- package/dist/ts/types/ts/ROCrate/LDContext.d.ts +3 -5
- package/dist/ts/types/ts/ROCrate/LDContext.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,47 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LDContext = exports.IRIHelper_compactIRIRegex = void 0;
|
|
4
|
-
exports.Dictionary_ofSeq = Dictionary_ofSeq;
|
|
5
|
-
exports.Dictionary_tryFind = Dictionary_tryFind;
|
|
6
4
|
exports.IRIHelper_$007CCompactIri$007C_$007C = IRIHelper_$007CCompactIri$007C_$007C;
|
|
7
5
|
exports.IRIHelper_combine = IRIHelper_combine;
|
|
8
6
|
exports.IRIHelper_combineOptional = IRIHelper_combineOptional;
|
|
9
7
|
exports.LDContext_$reflection = LDContext_$reflection;
|
|
10
8
|
exports.LDContext_$ctor_7878CD77 = LDContext_$ctor_7878CD77;
|
|
11
|
-
const MutableMap_js_1 = require("@fable-org/fable-library-js/MutableMap.js");
|
|
12
|
-
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
13
|
-
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
14
|
-
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
15
|
-
const Types_js_1 = require("@fable-org/fable-library-js/Types.js");
|
|
16
|
-
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
17
9
|
const Regex_js_1 = require("../Core/Helper/Regex.js");
|
|
10
|
+
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
11
|
+
const Types_js_1 = require("@fable-org/fable-library-js/Types.js");
|
|
18
12
|
const Uri_js_1 = require("@fable-org/fable-library-js/Uri.js");
|
|
13
|
+
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
14
|
+
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
15
|
+
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
19
16
|
const Collections_js_1 = require("../Core/Helper/Collections.js");
|
|
20
17
|
const HashCodes_js_1 = require("../Core/Helper/HashCodes.js");
|
|
21
18
|
const Reflection_js_1 = require("@fable-org/fable-library-js/Reflection.js");
|
|
22
|
-
function Dictionary_ofSeq(s) {
|
|
23
|
-
const dict = new MutableMap_js_1.Dictionary([], {
|
|
24
|
-
Equals: Util_js_1.equals,
|
|
25
|
-
GetHashCode: Util_js_1.structuralHash,
|
|
26
|
-
});
|
|
27
|
-
(0, Seq_js_1.iterate)((tupledArg) => {
|
|
28
|
-
(0, MapUtil_js_1.addToDict)(dict, tupledArg[0], tupledArg[1]);
|
|
29
|
-
}, s);
|
|
30
|
-
return dict;
|
|
31
|
-
}
|
|
32
|
-
function Dictionary_tryFind(key, dict) {
|
|
33
|
-
let patternInput;
|
|
34
|
-
let outArg = (0, Util_js_1.defaultOf)();
|
|
35
|
-
patternInput = [(0, MapUtil_js_1.tryGetValue)(dict, key, new Types_js_1.FSharpRef(() => outArg, (v) => {
|
|
36
|
-
outArg = v;
|
|
37
|
-
})), outArg];
|
|
38
|
-
if (patternInput[0]) {
|
|
39
|
-
return (0, Option_js_1.some)(patternInput[1]);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
19
|
exports.IRIHelper_compactIRIRegex = "(?<prefix>.*):(?<suffix>[^\\/][^\\/].*)";
|
|
46
20
|
function IRIHelper_$007CCompactIri$007C_$007C(termDefition) {
|
|
47
21
|
const activePatternResult = (0, Regex_js_1.ActivePatterns_$007CRegex$007C_$007C)(exports.IRIHelper_compactIRIRegex, termDefition);
|
|
@@ -83,12 +57,12 @@ function IRIHelper_combineOptional(baseIRI, relative) {
|
|
|
83
57
|
}
|
|
84
58
|
class LDContext {
|
|
85
59
|
constructor(mappings, baseContexts) {
|
|
86
|
-
this["baseContexts@
|
|
60
|
+
this["baseContexts@41"] = (0, Option_js_1.defaultArg)(baseContexts, []);
|
|
87
61
|
this.name = undefined;
|
|
88
|
-
this["mappings@
|
|
62
|
+
this["mappings@45"] = ((mappings == null) ? (new Map([])) : (0, Option_js_1.value)(mappings));
|
|
89
63
|
this.reverseMappings = (new Map([]));
|
|
90
64
|
this.compactReverseMappings = (new Map([]));
|
|
91
|
-
let enumerator = (0, Util_js_1.getEnumerator)(this["mappings@
|
|
65
|
+
let enumerator = (0, Util_js_1.getEnumerator)(this["mappings@45"]);
|
|
92
66
|
try {
|
|
93
67
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
94
68
|
const kvp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -101,15 +75,15 @@ class LDContext {
|
|
|
101
75
|
}
|
|
102
76
|
get Mappings() {
|
|
103
77
|
const this$ = this;
|
|
104
|
-
return this$["mappings@
|
|
78
|
+
return this$["mappings@45"];
|
|
105
79
|
}
|
|
106
80
|
get BaseContexts() {
|
|
107
81
|
const this$ = this;
|
|
108
|
-
return this$["baseContexts@
|
|
82
|
+
return this$["baseContexts@41"];
|
|
109
83
|
}
|
|
110
84
|
set BaseContexts(value) {
|
|
111
85
|
const this$ = this;
|
|
112
|
-
this$["baseContexts@
|
|
86
|
+
this$["baseContexts@41"] = value;
|
|
113
87
|
}
|
|
114
88
|
get Name() {
|
|
115
89
|
const this$ = this;
|
|
@@ -121,7 +95,15 @@ class LDContext {
|
|
|
121
95
|
}
|
|
122
96
|
AddMapping(term, definition) {
|
|
123
97
|
const this$ = this;
|
|
124
|
-
|
|
98
|
+
const key = term;
|
|
99
|
+
const value = definition;
|
|
100
|
+
const dict = this$["mappings@45"];
|
|
101
|
+
if (dict.has(key)) {
|
|
102
|
+
dict.set(key, value);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
(0, MapUtil_js_1.addToDict)(dict, key, value);
|
|
106
|
+
}
|
|
125
107
|
this$.addReverseMapping(term, definition);
|
|
126
108
|
}
|
|
127
109
|
TryResolveTerm(term) {
|
|
@@ -145,7 +127,7 @@ class LDContext {
|
|
|
145
127
|
}
|
|
146
128
|
}
|
|
147
129
|
static fromMappingSeq(mappings) {
|
|
148
|
-
return new LDContext(
|
|
130
|
+
return new LDContext((0, Collections_js_1.StringDictionary_ofSeq)(mappings));
|
|
149
131
|
}
|
|
150
132
|
static combine_InPlace(baseContext, specificContext) {
|
|
151
133
|
void (specificContext.BaseContexts.push(baseContext));
|
|
@@ -161,7 +143,7 @@ class LDContext {
|
|
|
161
143
|
ShallowCopy() {
|
|
162
144
|
const this$ = this;
|
|
163
145
|
const newMappings = new Map([]);
|
|
164
|
-
let enumerator = (0, Util_js_1.getEnumerator)(this$["mappings@
|
|
146
|
+
let enumerator = (0, Util_js_1.getEnumerator)(this$["mappings@45"]);
|
|
165
147
|
try {
|
|
166
148
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
167
149
|
const kvp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -171,12 +153,12 @@ class LDContext {
|
|
|
171
153
|
finally {
|
|
172
154
|
(0, Util_js_1.disposeSafe)(enumerator);
|
|
173
155
|
}
|
|
174
|
-
return new LDContext(newMappings, this$["baseContexts@
|
|
156
|
+
return new LDContext(newMappings, this$["baseContexts@41"]);
|
|
175
157
|
}
|
|
176
158
|
DeepCopy() {
|
|
177
159
|
const this$ = this;
|
|
178
160
|
const newMappings = new Map([]);
|
|
179
|
-
let enumerator = (0, Util_js_1.getEnumerator)(this$["mappings@
|
|
161
|
+
let enumerator = (0, Util_js_1.getEnumerator)(this$["mappings@45"]);
|
|
180
162
|
try {
|
|
181
163
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
182
164
|
const kvp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -187,7 +169,7 @@ class LDContext {
|
|
|
187
169
|
(0, Util_js_1.disposeSafe)(enumerator);
|
|
188
170
|
}
|
|
189
171
|
const newBaseContexts = [];
|
|
190
|
-
let enumerator_1 = (0, Util_js_1.getEnumerator)(this$["baseContexts@
|
|
172
|
+
let enumerator_1 = (0, Util_js_1.getEnumerator)(this$["baseContexts@41"]);
|
|
191
173
|
try {
|
|
192
174
|
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
193
175
|
const ctx = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -220,7 +202,7 @@ class LDContext {
|
|
|
220
202
|
let nameHash;
|
|
221
203
|
const matchValue = this$.Name;
|
|
222
204
|
nameHash = ((matchValue == null) ? 0 : (0, Util_js_1.stringHash)((0, Option_js_1.value)(matchValue)));
|
|
223
|
-
const baseContextsHash = ((this$["baseContexts@
|
|
205
|
+
const baseContextsHash = ((this$["baseContexts@41"].length === 0) ? 0 : (0, Seq_js_1.reduce)(HashCodes_js_1.mergeHashes, (0, Seq_js_1.map)(Util_js_1.safeHash, this$["baseContexts@41"]))) | 0;
|
|
224
206
|
return (0, HashCodes_js_1.mergeHashes)((0, HashCodes_js_1.mergeHashes)(mappingsHash, nameHash), baseContextsHash) | 0;
|
|
225
207
|
}
|
|
226
208
|
"System.ICloneable.Clone"() {
|
|
@@ -229,26 +211,70 @@ class LDContext {
|
|
|
229
211
|
}
|
|
230
212
|
addReverseMapping(key, value) {
|
|
231
213
|
const this$ = this;
|
|
232
|
-
|
|
214
|
+
const key_1 = value;
|
|
215
|
+
const value_1 = key;
|
|
216
|
+
const dict = this$.reverseMappings;
|
|
217
|
+
if (dict.has(key_1)) {
|
|
218
|
+
dict.set(key_1, value_1);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
(0, MapUtil_js_1.addToDict)(dict, key_1, value_1);
|
|
222
|
+
}
|
|
233
223
|
const activePatternResult = IRIHelper_$007CCompactIri$007C_$007C(value);
|
|
234
224
|
if (activePatternResult != null) {
|
|
235
225
|
const prefix = (0, Option_js_1.value)(activePatternResult)[0];
|
|
236
226
|
const suffix = (0, Option_js_1.value)(activePatternResult)[1];
|
|
237
|
-
|
|
238
|
-
const
|
|
227
|
+
const key_2 = prefix;
|
|
228
|
+
const value_2 = [suffix, key];
|
|
229
|
+
const dict_1 = this$.compactReverseMappings;
|
|
230
|
+
if (dict_1.has(key_2)) {
|
|
231
|
+
dict_1.set(key_2, value_2);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
(0, MapUtil_js_1.addToDict)(dict_1, key_2, value_2);
|
|
235
|
+
}
|
|
236
|
+
let matchValue;
|
|
237
|
+
let patternInput;
|
|
238
|
+
let outArg = (0, Util_js_1.defaultOf)();
|
|
239
|
+
patternInput = [(0, MapUtil_js_1.tryGetValue)(this$["mappings@45"], prefix, new Types_js_1.FSharpRef(() => outArg, (v) => {
|
|
240
|
+
outArg = v;
|
|
241
|
+
})), outArg];
|
|
242
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
239
243
|
if (matchValue == null) {
|
|
240
244
|
}
|
|
241
245
|
else {
|
|
242
|
-
|
|
246
|
+
const key_4 = IRIHelper_combine((0, Option_js_1.value)(matchValue), suffix);
|
|
247
|
+
const value_3 = key;
|
|
248
|
+
const dict_3 = this$.reverseMappings;
|
|
249
|
+
if (dict_3.has(key_4)) {
|
|
250
|
+
dict_3.set(key_4, value_3);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
(0, MapUtil_js_1.addToDict)(dict_3, key_4, value_3);
|
|
254
|
+
}
|
|
243
255
|
}
|
|
244
256
|
}
|
|
245
257
|
else {
|
|
246
|
-
|
|
258
|
+
let matchValue_1;
|
|
259
|
+
let patternInput_1;
|
|
260
|
+
let outArg_1 = (0, Util_js_1.defaultOf)();
|
|
261
|
+
patternInput_1 = [(0, MapUtil_js_1.tryGetValue)(this$.compactReverseMappings, key, new Types_js_1.FSharpRef(() => outArg_1, (v_2) => {
|
|
262
|
+
outArg_1 = v_2;
|
|
263
|
+
})), outArg_1];
|
|
264
|
+
matchValue_1 = (patternInput_1[0] ? patternInput_1[1] : undefined);
|
|
247
265
|
if (matchValue_1 == null) {
|
|
248
266
|
}
|
|
249
267
|
else {
|
|
250
268
|
const term = (0, Option_js_1.value)(matchValue_1)[1];
|
|
251
|
-
|
|
269
|
+
const key_6 = IRIHelper_combine(value, (0, Option_js_1.value)(matchValue_1)[0]);
|
|
270
|
+
const value_4 = term;
|
|
271
|
+
const dict_5 = this$.reverseMappings;
|
|
272
|
+
if (dict_5.has(key_6)) {
|
|
273
|
+
dict_5.set(key_6, value_4);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
(0, MapUtil_js_1.addToDict)(dict_5, key_6, value_4);
|
|
277
|
+
}
|
|
252
278
|
}
|
|
253
279
|
}
|
|
254
280
|
}
|
|
@@ -256,8 +282,14 @@ class LDContext {
|
|
|
256
282
|
let prefix, suffix, d;
|
|
257
283
|
const this$ = this;
|
|
258
284
|
let definition;
|
|
259
|
-
|
|
260
|
-
|
|
285
|
+
let matchValue;
|
|
286
|
+
let patternInput;
|
|
287
|
+
let outArg = (0, Util_js_1.defaultOf)();
|
|
288
|
+
patternInput = [(0, MapUtil_js_1.tryGetValue)(this$["mappings@45"], term, new Types_js_1.FSharpRef(() => outArg, (v) => {
|
|
289
|
+
outArg = v;
|
|
290
|
+
})), outArg];
|
|
291
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
292
|
+
definition = ((matchValue == null) ? (0, Seq_js_1.tryPick)((ctx) => ctx.TryResolveTerm(term), this$["baseContexts@41"]) : (0, Option_js_1.value)(matchValue));
|
|
261
293
|
if (definition == null) {
|
|
262
294
|
return undefined;
|
|
263
295
|
}
|
|
@@ -268,8 +300,14 @@ class LDContext {
|
|
|
268
300
|
}
|
|
269
301
|
tryFindIri(iri) {
|
|
270
302
|
const this$ = this;
|
|
271
|
-
|
|
272
|
-
|
|
303
|
+
let matchValue;
|
|
304
|
+
let patternInput;
|
|
305
|
+
let outArg = (0, Util_js_1.defaultOf)();
|
|
306
|
+
patternInput = [(0, MapUtil_js_1.tryGetValue)(this$.reverseMappings, iri, new Types_js_1.FSharpRef(() => outArg, (v) => {
|
|
307
|
+
outArg = v;
|
|
308
|
+
})), outArg];
|
|
309
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
310
|
+
return (matchValue == null) ? (0, Seq_js_1.tryPick)((ctx) => ctx.TryGetTerm(iri), this$["baseContexts@41"]) : (0, Option_js_1.value)(matchValue);
|
|
273
311
|
}
|
|
274
312
|
tryCompactIRI(iri) {
|
|
275
313
|
throw new Error("TryCompactIRI is Not implemented yet");
|
package/dist/ts/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ARC } from './ts/ARC.js';
|
|
2
|
-
export { ArcAssay, ArcStudy, ArcInvestigation } from './ts/Core/ArcTypes.js';
|
|
2
|
+
export { ArcAssay, ArcStudy, ArcRun, ArcWorkflow, ArcInvestigation } from './ts/Core/ArcTypes.js';
|
|
3
3
|
export { CompositeCell } from './ts/Core/Table/CompositeCell.js';
|
|
4
4
|
export { CompositeHeader, IOType } from './ts/Core/Table/CompositeHeader.js';
|
|
5
5
|
export { CompositeColumn } from './ts/Core/Table/CompositeColumn.js';
|
|
@@ -14,3 +14,47 @@ export { OntologyAnnotation } from './ts/Core/OntologyAnnotation.js';
|
|
|
14
14
|
export { Comment$ as Comment } from './ts/Core/Comment.js';
|
|
15
15
|
export { Contract } from './ts/Contract/Contract.js';
|
|
16
16
|
export { WebController } from './ts/Template.Web.js';
|
|
17
|
+
/// RO-Crate
|
|
18
|
+
import { LDNode, LDGraph, LDRef, LDValue } from './ts/ROCrate/LDObject.js';
|
|
19
|
+
import { LDContext } from './ts/ROCrate/LDContext.js';
|
|
20
|
+
import { initV1_1, initV1_2DRAFT, initBioschemasContext } from './ts/ROCrate/ROCrateContext.js';
|
|
21
|
+
import { LDComment } from './ts/ROCrate/Generic/Comment.js';
|
|
22
|
+
import { LDDefinedTerm } from './ts/ROCrate/Generic/DefinedTerm.js';
|
|
23
|
+
import { LDFile } from './ts/ROCrate/Generic/File.js';
|
|
24
|
+
import { LDLabProcess } from './ts/ROCrate/Generic/LabProcess.js';
|
|
25
|
+
import { LDLabProtocol } from './ts/ROCrate/Generic/LabProtocol.js';
|
|
26
|
+
import { LDOrganization } from './ts/ROCrate/Generic/Organization.js';
|
|
27
|
+
import { LDPerson } from './ts/ROCrate/Generic/Person.js';
|
|
28
|
+
import { LDPostalAddress } from './ts/ROCrate/Generic/PostalAddress.js';
|
|
29
|
+
import { LDPropertyValue } from './ts/ROCrate/Generic/PropertyValue.js';
|
|
30
|
+
import { LDSample } from './ts/ROCrate/Generic/Sample.js';
|
|
31
|
+
import { LDScholarlyArticle } from './ts/ROCrate/Generic/ScholarlyArticle.js';
|
|
32
|
+
import { LDDataset } from './ts/ROCrate/Generic/Dataset.js';
|
|
33
|
+
import { LDGraphExtensions_PyJsInterop as LDGraphIO } from './ts/JsonIO/LDObject.js';
|
|
34
|
+
import { LDNodeExtensions_PyJsInterop as LDNodeIO } from './ts/JsonIO/LDObject.js';
|
|
35
|
+
import { TypeExtensions_Conversion as Conversion } from './ts/Conversion.js';
|
|
36
|
+
export const ROCrate = {
|
|
37
|
+
LDNode,
|
|
38
|
+
LDGraph,
|
|
39
|
+
LDValue,
|
|
40
|
+
LDRef,
|
|
41
|
+
LDContext,
|
|
42
|
+
initV1_1,
|
|
43
|
+
initV1_2DRAFT,
|
|
44
|
+
initBioschemasContext,
|
|
45
|
+
LDComment,
|
|
46
|
+
LDDefinedTerm,
|
|
47
|
+
LDFile,
|
|
48
|
+
LDLabProcess,
|
|
49
|
+
LDLabProtocol,
|
|
50
|
+
LDOrganization,
|
|
51
|
+
LDPerson,
|
|
52
|
+
LDPostalAddress,
|
|
53
|
+
LDPropertyValue,
|
|
54
|
+
LDSample,
|
|
55
|
+
LDScholarlyArticle,
|
|
56
|
+
LDDataset,
|
|
57
|
+
LDGraphIO,
|
|
58
|
+
LDNodeIO,
|
|
59
|
+
Conversion
|
|
60
|
+
};
|
|
@@ -767,7 +767,7 @@ export function ProcessConversion_tryGetPerformerGetter(generalI, header) {
|
|
|
767
767
|
/**
|
|
768
768
|
* Given the header sequence of an ArcTable, returns a function for parsing each row of the table to a process
|
|
769
769
|
*/
|
|
770
|
-
export function ProcessConversion_getProcessGetter(processNameRoot, headers) {
|
|
770
|
+
export function ProcessConversion_getProcessGetter(assayName, studyName, processNameRoot, headers) {
|
|
771
771
|
const headers_1 = indexed(headers);
|
|
772
772
|
const valueHeaders = toList(indexed(filter((arg) => arg[1].IsCvParamColumn, headers_1)));
|
|
773
773
|
const charGetters = choose((tupledArg) => {
|
|
@@ -846,6 +846,7 @@ export function ProcessConversion_getProcessGetter(processNameRoot, headers) {
|
|
|
846
846
|
const paramvalues = map((collection_4) => Array.from(collection_4), Option_fromValueWithDefault(empty(), map_2((f_4) => f_4(matrix_6)(i_6), parameterValueGetters)));
|
|
847
847
|
const comments = map((collection_5) => Array.from(collection_5), Option_fromValueWithDefault(empty(), map_2((f_5) => f_5(matrix_6)(i_6), commentGetters)));
|
|
848
848
|
const components = map((collection_6) => Array.from(collection_6), Option_fromValueWithDefault(empty(), map_2((f_6) => f_6(matrix_6)(i_6), componentGetters)));
|
|
849
|
+
const id = LDLabProcess.genId(processNameRoot, unwrap(assayName), unwrap(studyName)) + (`_${i_6}`);
|
|
849
850
|
let protocol;
|
|
850
851
|
const name = map((f_7) => f_7(matrix_6)(i_6), protocolREFGetter);
|
|
851
852
|
const protocolId = LDLabProtocol.genId(unwrap(name), processNameRoot);
|
|
@@ -853,7 +854,7 @@ export function ProcessConversion_getProcessGetter(processNameRoot, headers) {
|
|
|
853
854
|
const matchValue_2 = inputGetter_1(matrix_6)(i_6);
|
|
854
855
|
const matchValue_3 = outputGetter_1(matrix_6)(i_6);
|
|
855
856
|
const agent = map((f_12) => f_12(matrix_6)(i_6), performerGetter);
|
|
856
|
-
return LDLabProcess.create(pn, matchValue_2, matchValue_3,
|
|
857
|
+
return LDLabProcess.create(pn, matchValue_2, matchValue_3, id, unwrap(agent), unwrap(protocol), unwrap(paramvalues), undefined, unwrap(comments));
|
|
857
858
|
});
|
|
858
859
|
}
|
|
859
860
|
/**
|
|
@@ -1179,12 +1180,12 @@ export function ARCtrl_ArcTable__ArcTable_GetProtocols(this$) {
|
|
|
1179
1180
|
/**
|
|
1180
1181
|
* Returns the list of processes specidified in this ArcTable
|
|
1181
1182
|
*/
|
|
1182
|
-
export function
|
|
1183
|
+
export function ARCtrl_ArcTable__ArcTable_GetProcesses_40457300(this$, assayName, studyName) {
|
|
1183
1184
|
if (this$.RowCount === 0) {
|
|
1184
1185
|
return singleton_2(LDLabProcess.create(this$.Name));
|
|
1185
1186
|
}
|
|
1186
1187
|
else {
|
|
1187
|
-
const getter = ProcessConversion_getProcessGetter(this$.Name, this$.Headers);
|
|
1188
|
+
const getter = ProcessConversion_getProcessGetter(assayName, studyName, this$.Name, this$.Headers);
|
|
1188
1189
|
return toList(delay(() => map_1((i) => getter(this$.Values)(i), rangeDouble(0, 1, this$.RowCount - 1))));
|
|
1189
1190
|
}
|
|
1190
1191
|
}
|
|
@@ -1202,8 +1203,8 @@ export function ARCtrl_ArcTable__ArcTable_fromProcesses_Static_Z3575FB5F(name, p
|
|
|
1202
1203
|
/**
|
|
1203
1204
|
* Return a list of all the processes in all the tables.
|
|
1204
1205
|
*/
|
|
1205
|
-
export function
|
|
1206
|
-
return collect(
|
|
1206
|
+
export function ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(this$, assayName, studyName) {
|
|
1207
|
+
return collect((t) => ARCtrl_ArcTable__ArcTable_GetProcesses_40457300(t, unwrap(assayName), unwrap(studyName)), toList(this$.Tables));
|
|
1207
1208
|
}
|
|
1208
1209
|
/**
|
|
1209
1210
|
* Create a collection of tables from a list of processes.
|
|
@@ -1453,7 +1454,7 @@ export function AssayConversion_composeAssay_1501C0F8(assay) {
|
|
|
1453
1454
|
const measurementTechnique = map(BaseTypes_composeDefinedTerm_ZDED3A0F, assay.TechnologyPlatform);
|
|
1454
1455
|
const variableMeasured = map(BaseTypes_composePropertyValueFromOA_ZDED3A0F, assay.MeasurementType);
|
|
1455
1456
|
const creators = Option_fromSeq(ResizeArray_map(PersonConversion_composePerson_Z64D846DC, assay.Performers));
|
|
1456
|
-
const processSequence = Option_fromSeq((collection =
|
|
1457
|
+
const processSequence = Option_fromSeq((collection = ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(new ArcTables(assay.Tables), assay.Identifier), Array.from(collection)));
|
|
1457
1458
|
const fragmentDescriptors = map(DatamapConversion_composeFragmentDescriptors_Z8923FA3, assay.DataMap);
|
|
1458
1459
|
const dataFiles = map((ps) => AssayConversion_getDataFilesFromProcesses_6BABD1B0(ps, unwrap(fragmentDescriptors)), processSequence);
|
|
1459
1460
|
const variableMeasureds = (variableMeasured == null) ? ((fragmentDescriptors == null) ? undefined : ((fds_1 = value_4(fragmentDescriptors), fds_1))) : ((fragmentDescriptors == null) ? ((vm_1 = value_4(variableMeasured), ResizeArray_singleton(vm_1))) : ((fds = value_4(fragmentDescriptors), (vm = value_4(variableMeasured), ResizeArray_appendSingleton(vm, fds)))));
|
|
@@ -1486,7 +1487,7 @@ export function StudyConversion_composeStudy_1680536E(study) {
|
|
|
1486
1487
|
const dateModified = now();
|
|
1487
1488
|
const publications = Option_fromSeq(ResizeArray_map(ScholarlyArticleConversion_composeScholarlyArticle_D324A6D, study.Publications));
|
|
1488
1489
|
const creators = Option_fromSeq(ResizeArray_map(PersonConversion_composePerson_Z64D846DC, study.Contacts));
|
|
1489
|
-
const processSequence = Option_fromSeq((collection =
|
|
1490
|
+
const processSequence = Option_fromSeq((collection = ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(new ArcTables(study.Tables), undefined, study.Identifier), Array.from(collection)));
|
|
1490
1491
|
const fragmentDescriptors = map(DatamapConversion_composeFragmentDescriptors_Z8923FA3, study.DataMap);
|
|
1491
1492
|
const dataFiles = map((ps) => AssayConversion_getDataFilesFromProcesses_6BABD1B0(ps, unwrap(fragmentDescriptors)), processSequence);
|
|
1492
1493
|
const comments = Option_fromSeq(ResizeArray_map(BaseTypes_composeComment_Z13201A7E, study.Comments));
|
|
@@ -1562,6 +1563,31 @@ export function ARCtrl_ArcInvestigation__ArcInvestigation_ToROCrateInvestigation
|
|
|
1562
1563
|
export function ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateInvestigation_Static_Z6839B9E8(a, graph, context) {
|
|
1563
1564
|
return InvestigationConversion_decomposeInvestigation_Z6839B9E8(a, unwrap(graph), unwrap(context));
|
|
1564
1565
|
}
|
|
1566
|
+
export class TypeExtensions_Conversion {
|
|
1567
|
+
constructor() {
|
|
1568
|
+
}
|
|
1569
|
+
static arcAssayToDataset(a) {
|
|
1570
|
+
return ARCtrl_ArcAssay__ArcAssay_ToROCrateAssay(a);
|
|
1571
|
+
}
|
|
1572
|
+
static datasetToArcAssay(a, graph, context) {
|
|
1573
|
+
return ARCtrl_ArcAssay__ArcAssay_fromROCrateAssay_Static_Z6839B9E8(a, unwrap(graph), unwrap(context));
|
|
1574
|
+
}
|
|
1575
|
+
static arcStudyToDataset(a) {
|
|
1576
|
+
return ARCtrl_ArcStudy__ArcStudy_ToROCrateStudy(a);
|
|
1577
|
+
}
|
|
1578
|
+
static datasetToArcStudy(a, graph, context) {
|
|
1579
|
+
return ARCtrl_ArcStudy__ArcStudy_fromROCrateStudy_Static_Z6839B9E8(a, unwrap(graph), unwrap(context));
|
|
1580
|
+
}
|
|
1581
|
+
static arcInvestigationToDataset(a) {
|
|
1582
|
+
return ARCtrl_ArcInvestigation__ArcInvestigation_ToROCrateInvestigation(a);
|
|
1583
|
+
}
|
|
1584
|
+
static datasetToArcInvestigation(a, graph, context) {
|
|
1585
|
+
return ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateInvestigation_Static_Z6839B9E8(a, unwrap(graph), unwrap(context));
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
export function TypeExtensions_Conversion_$reflection() {
|
|
1589
|
+
return class_type("ARCtrl.Conversion.TypeExtensions.Conversion", undefined, TypeExtensions_Conversion);
|
|
1590
|
+
}
|
|
1565
1591
|
export function ARCtrl_ROCrate_Dataset__Dataset_toArcAssay_Static_Z6839B9E8(a, graph, context) {
|
|
1566
1592
|
return AssayConversion_decomposeAssay_Z6839B9E8(a, unwrap(graph), unwrap(context));
|
|
1567
1593
|
}
|
|
@@ -123,6 +123,18 @@ export function Dictionary_ofSeqWithMerge(merge, s) {
|
|
|
123
123
|
}, s);
|
|
124
124
|
return dict;
|
|
125
125
|
}
|
|
126
|
+
export function Dictionary_init() {
|
|
127
|
+
return new Dictionary([], {
|
|
128
|
+
Equals: equals,
|
|
129
|
+
GetHashCode: structuralHash,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export function Dictionary_items(dict) {
|
|
133
|
+
return dict;
|
|
134
|
+
}
|
|
135
|
+
export function StringDictionary_ofSeq(s) {
|
|
136
|
+
return new Map(s);
|
|
137
|
+
}
|
|
126
138
|
export function ResizeArray_create(i, v) {
|
|
127
139
|
const a = [];
|
|
128
140
|
if (i > 0) {
|
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { op_UnaryNegation_Int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
2
|
-
import {
|
|
3
|
-
import { arrayHash, equalArrays, numberHash, disposeSafe, getEnumerator, compare, equals, safeHash, comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
2
|
+
import { getItemFromDict, tryGetValue, addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
4
3
|
import { CompositeCell } from "./CompositeCell.js";
|
|
5
|
-
import {
|
|
4
|
+
import { numberHash, disposeSafe, getEnumerator, compare, equals, safeHash, comparePrimitives, defaultOf, arrayHash, equalArrays } from "@fable-org/fable-library-js/Util.js";
|
|
5
|
+
import { Dictionary } from "@fable-org/fable-library-js/MutableMap.js";
|
|
6
|
+
import { toString, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
6
7
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
8
|
+
import { toList, head as head_1, toArray, filter, tryFindIndex, maxBy } from "@fable-org/fable-library-js/Seq.js";
|
|
7
9
|
import { mapIndexed, pick, exists, ofSeq, empty, head, tail as tail_1, isEmpty, cons } from "@fable-org/fable-library-js/List.js";
|
|
8
10
|
import { printf, toConsole } from "@fable-org/fable-library-js/String.js";
|
|
9
|
-
import { List_tryPickAndRemove, Dictionary_tryFind } from "../Helper/Collections.js";
|
|
10
11
|
import { max } from "@fable-org/fable-library-js/Double.js";
|
|
11
12
|
import { setItem, item, map, iterateIndexed } from "@fable-org/fable-library-js/Array.js";
|
|
12
13
|
import { tryFind, ofArray } from "@fable-org/fable-library-js/Map.js";
|
|
13
14
|
import { Array_groupBy } from "@fable-org/fable-library-js/Seq2.js";
|
|
14
15
|
import { FSharpSet__Contains, ofArray as ofArray_1 } from "@fable-org/fable-library-js/Set.js";
|
|
15
|
-
import { toString } from "@fable-org/fable-library-js/Types.js";
|
|
16
16
|
import { rangeDouble } from "@fable-org/fable-library-js/Range.js";
|
|
17
|
-
import {
|
|
17
|
+
import { List_tryPickAndRemove } from "../Helper/Collections.js";
|
|
18
|
+
export function CellDictionary_addOrUpdate(key_, key__1, value, dict) {
|
|
19
|
+
const key = [key_, key__1];
|
|
20
|
+
if (dict.has(key)) {
|
|
21
|
+
dict.set(key, value);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
addToDict(dict, key, value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function CellDictionary_ofSeq(s) {
|
|
28
|
+
return new Dictionary(s, {
|
|
29
|
+
Equals: equalArrays,
|
|
30
|
+
GetHashCode: arrayHash,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function CellDictionary_tryFind(key_, key__1, dict) {
|
|
34
|
+
let patternInput;
|
|
35
|
+
let outArg = defaultOf();
|
|
36
|
+
patternInput = [tryGetValue(dict, [key_, key__1], new FSharpRef(() => outArg, (v) => {
|
|
37
|
+
outArg = v;
|
|
38
|
+
})), outArg];
|
|
39
|
+
if (patternInput[0]) {
|
|
40
|
+
return patternInput[1];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
18
46
|
export function getColumnCount(headers) {
|
|
19
47
|
return headers.length;
|
|
20
48
|
}
|
|
@@ -176,7 +204,7 @@ export function SanityChecks_validate(headers, values, raiseException) {
|
|
|
176
204
|
return isValid;
|
|
177
205
|
}
|
|
178
206
|
export function Unchecked_tryGetCellAt(column, row, cells) {
|
|
179
|
-
return
|
|
207
|
+
return CellDictionary_tryFind(column, row, cells);
|
|
180
208
|
}
|
|
181
209
|
/**
|
|
182
210
|
* Add or update a cell in the dictionary.
|
|
@@ -191,7 +219,7 @@ export function Unchecked_addCellAt(columnIndex, rowIndex, c, cells) {
|
|
|
191
219
|
addToDict(cells, [columnIndex, rowIndex], c);
|
|
192
220
|
}
|
|
193
221
|
export function Unchecked_moveCellTo(fromCol, fromRow, toCol, toRow, cells) {
|
|
194
|
-
const matchValue =
|
|
222
|
+
const matchValue = CellDictionary_tryFind(fromCol, fromRow, cells);
|
|
195
223
|
if (matchValue == null) {
|
|
196
224
|
}
|
|
197
225
|
else {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { item, map, setItem, fill } from "@fable-org/fable-library-js/Array.js";
|
|
2
2
|
import { iterate } from "@fable-org/fable-library-js/Seq.js";
|
|
3
|
+
import { defaultOf } from "@fable-org/fable-library-js/Util.js";
|
|
3
4
|
import { int, string, array as array_2 } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
4
|
-
import { Dictionary_tryFind } from "../Core/Helper/Collections.js";
|
|
5
5
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
6
|
-
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
6
|
+
import { addToDict, tryGetValue } from "@fable-org/fable-library-js/MapUtil.js";
|
|
7
|
+
import { FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
7
8
|
import { FSharpResult$2_Ok, FSharpResult$2_Error } from "@fable-org/fable-library-js/Result.js";
|
|
8
9
|
export function arrayFromMap(otm) {
|
|
9
10
|
const a = fill(new Array(otm.size), 0, otm.size, "");
|
|
@@ -27,7 +28,13 @@ export function encoder(ot) {
|
|
|
27
28
|
}
|
|
28
29
|
export const decoder = array_2(string);
|
|
29
30
|
export function encodeString(otm, s) {
|
|
30
|
-
|
|
31
|
+
let matchValue;
|
|
32
|
+
let patternInput;
|
|
33
|
+
let outArg = defaultOf();
|
|
34
|
+
patternInput = [tryGetValue(otm, s, new FSharpRef(() => outArg, (v) => {
|
|
35
|
+
outArg = (v | 0);
|
|
36
|
+
})), outArg];
|
|
37
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
31
38
|
if (matchValue == null) {
|
|
32
39
|
const i_1 = otm.size | 0;
|
|
33
40
|
addToDict(otm, s, i_1);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { sortBy, map, toArray } from "@fable-org/fable-library-js/Seq.js";
|
|
2
|
+
import { Dictionary_tryFind, Dictionary_items } from "../../Core/Helper/Collections.js";
|
|
2
3
|
import { comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
3
4
|
import { item, map as map_1 } from "@fable-org/fable-library-js/Array.js";
|
|
4
5
|
import { decoderCompressed, encoderCompressed } from "./CompositeCell.js";
|
|
5
6
|
import { int, object, array as array_2 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
6
|
-
import { Dictionary_tryFind } from "../../Core/Helper/Collections.js";
|
|
7
7
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
8
8
|
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
9
9
|
export function arrayFromMap(otm) {
|
|
10
|
-
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
|
|
10
|
+
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], Dictionary_items(otm), {
|
|
11
11
|
Compare: comparePrimitives,
|
|
12
12
|
})));
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { sortBy, map, toArray } from "@fable-org/fable-library-js/Seq.js";
|
|
2
|
+
import { Dictionary_tryFind, Dictionary_items } from "../../Core/Helper/Collections.js";
|
|
2
3
|
import { comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
3
4
|
import { item, map as map_1 } from "@fable-org/fable-library-js/Array.js";
|
|
4
5
|
import { OntologyAnnotation_compressedDecoder, OntologyAnnotation_compressedEncoder } from "../OntologyAnnotation.js";
|
|
5
6
|
import { int, object, array as array_2 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
6
|
-
import { Dictionary_tryFind } from "../../Core/Helper/Collections.js";
|
|
7
7
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
8
8
|
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
9
9
|
export function arrayFromMap(otm) {
|
|
10
|
-
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
|
|
10
|
+
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], Dictionary_items(otm), {
|
|
11
11
|
Compare: comparePrimitives,
|
|
12
12
|
})));
|
|
13
13
|
}
|