@nfdi4plants/arctrl 3.0.0-alpha.3 → 3.0.0-beta.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.
- package/README.md +17 -9
- package/dist/ts/cjs/ts/ARC.js +25 -17
- package/dist/ts/cjs/ts/Conversion.js +133 -86
- package/dist/ts/cjs/ts/Core/ArcTypes.js +1 -1
- package/dist/ts/cjs/ts/Core/Conversion.js +110 -43
- package/dist/ts/cjs/ts/Core/Helper/Collections.js +84 -1
- package/dist/ts/cjs/ts/Core/OntologyAnnotation.js +27 -23
- package/dist/ts/cjs/ts/Core/Table/ArcTable.js +234 -217
- package/dist/ts/cjs/ts/Core/Table/ArcTableAux.js +915 -235
- package/dist/ts/cjs/ts/Core/Table/ArcTables.js +12 -19
- package/dist/ts/cjs/ts/Core/Table/CompositeColumn.js +4 -2
- package/dist/ts/cjs/ts/FileSystem/DefaultGitattributes.js +1 -1
- package/dist/ts/cjs/ts/Json/Decode.js +105 -0
- package/dist/ts/cjs/ts/Json/Encode.js +42 -0
- package/dist/ts/cjs/ts/Json/StringTable.js +9 -2
- package/dist/ts/cjs/ts/Json/Table/ArcTable.js +100 -113
- 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/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/cjs/ts/Spreadsheet/AnnotationTable/ArcTable.js +15 -4
- package/dist/ts/cjs/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +77 -6
- package/dist/ts/cjs/ts/Spreadsheet/ArcInvestigation.js +31 -15
- package/dist/ts/cjs/ts/Spreadsheet/DataMapTable/DataMapHeader.js +1 -1
- package/dist/ts/cjs/ts/Spreadsheet/Metadata/SparseTable.js +2 -5
- package/dist/ts/esm/ts/ARC.js +28 -20
- package/dist/ts/esm/ts/Conversion.js +137 -90
- package/dist/ts/esm/ts/Core/ArcTypes.js +1 -1
- package/dist/ts/esm/ts/Core/Conversion.js +112 -45
- package/dist/ts/esm/ts/Core/Helper/Collections.js +73 -1
- package/dist/ts/esm/ts/Core/OntologyAnnotation.js +29 -25
- package/dist/ts/esm/ts/Core/Table/ArcTable.js +243 -226
- package/dist/ts/esm/ts/Core/Table/ArcTableAux.js +907 -246
- package/dist/ts/esm/ts/Core/Table/ArcTables.js +15 -22
- package/dist/ts/esm/ts/Core/Table/CompositeColumn.js +5 -3
- package/dist/ts/esm/ts/FileSystem/DefaultGitattributes.js +1 -1
- package/dist/ts/esm/ts/Json/Decode.js +105 -3
- package/dist/ts/esm/ts/Json/Encode.js +42 -2
- package/dist/ts/esm/ts/Json/StringTable.js +10 -3
- package/dist/ts/esm/ts/Json/Table/ArcTable.js +108 -121
- 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/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/esm/ts/Spreadsheet/AnnotationTable/ArcTable.js +17 -7
- package/dist/ts/esm/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +78 -9
- package/dist/ts/esm/ts/Spreadsheet/ArcInvestigation.js +33 -17
- package/dist/ts/esm/ts/Spreadsheet/DataMapTable/DataMapHeader.js +1 -1
- package/dist/ts/esm/ts/Spreadsheet/Metadata/SparseTable.js +3 -6
- package/dist/ts/types/ts/ARC.d.ts +2 -2
- package/dist/ts/types/ts/ARC.d.ts.map +1 -1
- package/dist/ts/types/ts/Conversion.d.ts +17 -18
- package/dist/ts/types/ts/Conversion.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/ArcTypes.d.ts +2 -0
- package/dist/ts/types/ts/Core/ArcTypes.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Conversion.d.ts +14 -15
- package/dist/ts/types/ts/Core/Conversion.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts +11 -0
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/OntologyAnnotation.d.ts +9 -0
- package/dist/ts/types/ts/Core/OntologyAnnotation.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTable.d.ts +35 -28
- package/dist/ts/types/ts/Core/Table/ArcTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts +84 -33
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTables.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/CompositeColumn.d.ts.map +1 -1
- package/dist/ts/types/ts/FileSystem/DefaultGitattributes.d.ts +1 -1
- package/dist/ts/types/ts/FileSystem/DefaultGitattributes.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Decode.d.ts +6 -0
- package/dist/ts/types/ts/Json/Decode.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Encode.d.ts +2 -0
- package/dist/ts/types/ts/Json/Encode.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/StringTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Table/ArcTable.d.ts +4 -3
- package/dist/ts/types/ts/Json/Table/ArcTable.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/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/dist/ts/types/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts +5 -0
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts +7 -0
- package/dist/ts/types/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/ArcInvestigation.d.ts.map +1 -1
- package/dist/ts/types/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -6,15 +6,15 @@ exports.decoder = decoder;
|
|
|
6
6
|
exports.encodeOA = encodeOA;
|
|
7
7
|
exports.decodeOA = decodeOA;
|
|
8
8
|
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
9
|
+
const Collections_js_1 = require("../../Core/Helper/Collections.js");
|
|
9
10
|
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
10
11
|
const Array_js_1 = require("@fable-org/fable-library-js/Array.js");
|
|
11
12
|
const OntologyAnnotation_js_1 = require("../OntologyAnnotation.js");
|
|
12
13
|
const Decode_fs_js_1 = require("../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js");
|
|
13
|
-
const Collections_js_1 = require("../../Core/Helper/Collections.js");
|
|
14
14
|
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
15
15
|
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
16
16
|
function arrayFromMap(otm) {
|
|
17
|
-
return (0, Seq_js_1.toArray)((0, Seq_js_1.map)((kv_1) => kv_1[0], (0, Seq_js_1.sortBy)((kv) => kv[1], otm, {
|
|
17
|
+
return (0, Seq_js_1.toArray)((0, Seq_js_1.map)((kv_1) => kv_1[0], (0, Seq_js_1.sortBy)((kv) => kv[1], (0, Collections_js_1.Dictionary_items)(otm), {
|
|
18
18
|
Compare: Util_js_1.comparePrimitives,
|
|
19
19
|
})));
|
|
20
20
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encode = encode;
|
|
4
4
|
exports.decode = decode;
|
|
5
|
-
const
|
|
6
|
-
const MutableMap_js_1 = require("@fable-org/fable-library-js/MutableMap.js");
|
|
5
|
+
const Collections_js_1 = require("../../Core/Helper/Collections.js");
|
|
7
6
|
const Encode_fs_js_1 = require("../../fable_modules/Thoth.Json.JavaScript.0.3.0/Encode.fs.js");
|
|
8
7
|
const CellTable_js_1 = require("../../Json/Table/CellTable.js");
|
|
9
8
|
const OATable_js_1 = require("../../Json/Table/OATable.js");
|
|
@@ -11,15 +10,9 @@ const StringTable_js_1 = require("../../Json/StringTable.js");
|
|
|
11
10
|
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
12
11
|
const Decode_fs_js_1 = require("../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js");
|
|
13
12
|
function encode(encoder, obj) {
|
|
14
|
-
const stringTable =
|
|
15
|
-
const oaTable =
|
|
16
|
-
|
|
17
|
-
GetHashCode: Util_js_1.safeHash,
|
|
18
|
-
});
|
|
19
|
-
const cellTable = new MutableMap_js_1.Dictionary([], {
|
|
20
|
-
Equals: Util_js_1.equals,
|
|
21
|
-
GetHashCode: Util_js_1.safeHash,
|
|
22
|
-
});
|
|
13
|
+
const stringTable = (0, Collections_js_1.Dictionary_init)();
|
|
14
|
+
const oaTable = (0, Collections_js_1.Dictionary_init)();
|
|
15
|
+
const cellTable = (0, Collections_js_1.Dictionary_init)();
|
|
23
16
|
const object = encoder(stringTable, oaTable, cellTable, obj);
|
|
24
17
|
(0, Encode_fs_js_1.toString)(0, object);
|
|
25
18
|
const values = [["cellTable", (0, CellTable_js_1.encoder)(stringTable, oaTable, (0, CellTable_js_1.arrayFromMap)(cellTable))], ["oaTable", (0, OATable_js_1.encoder)(stringTable, (0, OATable_js_1.arrayFromMap)(oaTable))], ["stringTable", (0, StringTable_js_1.encoder)((0, StringTable_js_1.arrayFromMap)(stringTable))], ["object", object]];
|
|
@@ -216,7 +216,7 @@ class LDLabProcess {
|
|
|
216
216
|
}
|
|
217
217
|
static genId(name, assayName, studyName) {
|
|
218
218
|
let study_1, assay_1, assay, study;
|
|
219
|
-
return (0, Helper_js_1.clean)((assayName == null) ? ((studyName != null) ? ((study_1 = (0, Option_js_1.value)(studyName), `#
|
|
219
|
+
return (0, Helper_js_1.clean)((assayName == null) ? ((studyName != null) ? ((study_1 = (0, Option_js_1.value)(studyName), `#Process_S_${study_1}_${name}`)) : (`#Process_${name}`)) : ((studyName == null) ? ((assay_1 = (0, Option_js_1.value)(assayName), `#Process_A_${assay_1}_${name}`)) : ((assay = (0, Option_js_1.value)(assayName), (study = (0, Option_js_1.value)(studyName), `#Process_S_${study}_A_${assay}_${name}`)))));
|
|
220
220
|
}
|
|
221
221
|
static create(name, objects, results, id, agent, executesLabProtocol, parameterValues, endTime, disambiguatingDescriptions, context) {
|
|
222
222
|
const id_1 = (id == null) ? LDLabProcess.genId(name) : (0, Option_js_1.value)(id);
|
|
@@ -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");
|
|
@@ -7,6 +7,7 @@ exports.classifyColumnOrder = classifyColumnOrder;
|
|
|
7
7
|
exports.groupColumnsByHeader = groupColumnsByHeader;
|
|
8
8
|
exports.tryAnnotationTable = tryAnnotationTable;
|
|
9
9
|
exports.composeColumns = composeColumns;
|
|
10
|
+
exports.composeArcTableValues = composeArcTableValues;
|
|
10
11
|
exports.tryFromFsWorksheet = tryFromFsWorksheet;
|
|
11
12
|
exports.toFsWorksheet = toFsWorksheet;
|
|
12
13
|
const List_js_1 = require("@fable-org/fable-library-js/List.js");
|
|
@@ -15,6 +16,8 @@ const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
|
15
16
|
const FsWorksheet_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/FsWorksheet.fs.js");
|
|
16
17
|
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
17
18
|
const CompositeColumn_js_1 = require("./CompositeColumn.js");
|
|
19
|
+
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
20
|
+
const ArcTableAux_js_1 = require("../../Core/Table/ArcTableAux.js");
|
|
18
21
|
const String_js_1 = require("@fable-org/fable-library-js/String.js");
|
|
19
22
|
const FsCellsCollection_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Cells/FsCellsCollection.fs.js");
|
|
20
23
|
const Range_js_1 = require("@fable-org/fable-library-js/Range.js");
|
|
@@ -22,7 +25,6 @@ const FsAddress_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/FsAdd
|
|
|
22
25
|
const FsRangeAddress_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Ranges/FsRangeAddress.fs.js");
|
|
23
26
|
const FsRangeBase_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Ranges/FsRangeBase.fs.js");
|
|
24
27
|
const ArcTable_js_1 = require("../../Core/Table/ArcTable.js");
|
|
25
|
-
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
26
28
|
const Double_js_1 = require("@fable-org/fable-library-js/Double.js");
|
|
27
29
|
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
28
30
|
/**
|
|
@@ -92,6 +94,15 @@ function tryAnnotationTable(sheet) {
|
|
|
92
94
|
function composeColumns(stringCellColumns) {
|
|
93
95
|
return (0, Array_js_1.map)(CompositeColumn_js_1.fromStringCellColumns, groupColumnsByHeader(stringCellColumns));
|
|
94
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Groups and parses a collection of single columns into the according ISA composite columns
|
|
99
|
+
*/
|
|
100
|
+
function composeArcTableValues(stringCellColumns) {
|
|
101
|
+
const valueMap = new Map([]);
|
|
102
|
+
const rowCount = ((0, Array_js_1.item)(0, stringCellColumns).length - 1) | 0;
|
|
103
|
+
const patternInput = (0, Array_js_1.unzip)((0, Array_js_1.map)((columns) => (0, CompositeColumn_js_1.ColumnValueRefs_fromStringCellColumns)(valueMap, columns), groupColumnsByHeader(stringCellColumns)));
|
|
104
|
+
return [patternInput[0], ArcTableAux_js_1.ArcTableValues.fromRefColumns(patternInput[1], valueMap, rowCount)];
|
|
105
|
+
}
|
|
95
106
|
/**
|
|
96
107
|
* Returns the protocol described by the headers and a function for parsing the values of the matrix to the processes of this protocol
|
|
97
108
|
*/
|
|
@@ -103,7 +114,7 @@ function tryFromFsWorksheet(sheet) {
|
|
|
103
114
|
}
|
|
104
115
|
else {
|
|
105
116
|
const t = (0, Option_js_1.value)(matchValue);
|
|
106
|
-
const
|
|
117
|
+
const patternInput = composeArcTableValues((0, Array_js_1.map)(CompositeColumn_js_1.fixDeprecatedIOHeader, (0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((c) => (0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.collect)((r) => {
|
|
107
118
|
const matchValue_1 = (0, FsCellsCollection_fs_js_1.FsCellsCollection__TryGetCell_Z37302880)(sheet.CellCollection, r, c);
|
|
108
119
|
if (matchValue_1 == null) {
|
|
109
120
|
return (0, Seq_js_1.singleton)("");
|
|
@@ -113,7 +124,7 @@ function tryFromFsWorksheet(sheet) {
|
|
|
113
124
|
return (0, Seq_js_1.singleton)(cell.ValueAsString());
|
|
114
125
|
}
|
|
115
126
|
}, (0, Range_js_1.rangeDouble)(1, 1, (0, FsAddress_fs_js_1.FsAddress__get_RowNumber)((0, FsRangeAddress_fs_js_1.FsRangeAddress__get_LastAddress)((0, FsRangeBase_fs_js_1.FsRangeBase__get_RangeAddress)(t))))))), (0, Range_js_1.rangeDouble)(1, 1, (0, FsAddress_fs_js_1.FsAddress__get_ColumnNumber)((0, FsRangeAddress_fs_js_1.FsRangeAddress__get_LastAddress)((0, FsRangeBase_fs_js_1.FsRangeBase__get_RangeAddress)(t)))))))));
|
|
116
|
-
return ArcTable_js_1.ArcTable.
|
|
127
|
+
return ArcTable_js_1.ArcTable.fromArcTableValues(sheet.Name, Array.from(patternInput[0]), patternInput[1]);
|
|
117
128
|
}
|
|
118
129
|
}
|
|
119
130
|
catch (err) {
|
|
@@ -129,7 +140,7 @@ function toFsWorksheet(index, table) {
|
|
|
129
140
|
return ws;
|
|
130
141
|
}
|
|
131
142
|
else {
|
|
132
|
-
const columns = (0, List_js_1.collect)(CompositeColumn_js_1.toStringCellColumns, (0, List_js_1.sortBy)(classifyColumnOrder, (0, List_js_1.
|
|
143
|
+
const columns = (0, List_js_1.collect)(CompositeColumn_js_1.toStringCellColumns, (0, List_js_1.sortBy)(classifyColumnOrder, (0, List_js_1.ofSeq)(table.Columns), {
|
|
133
144
|
Compare: Util_js_1.comparePrimitives,
|
|
134
145
|
}));
|
|
135
146
|
let tableRowCount;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fixDeprecatedIOHeader = fixDeprecatedIOHeader;
|
|
4
4
|
exports.fromStringCellColumns = fromStringCellColumns;
|
|
5
|
+
exports.stringCellColumnsOfFsColumns = stringCellColumnsOfFsColumns;
|
|
5
6
|
exports.fromFsColumns = fromFsColumns;
|
|
6
7
|
exports.toStringCellColumns = toStringCellColumns;
|
|
7
8
|
exports.toFsColumns = toFsColumns;
|
|
9
|
+
exports.ColumnValueRefs_fromStringCellColumns = ColumnValueRefs_fromStringCellColumns;
|
|
8
10
|
const Array_js_1 = require("@fable-org/fable-library-js/Array.js");
|
|
9
11
|
const CompositeHeader_js_1 = require("../../Core/Table/CompositeHeader.js");
|
|
10
12
|
const Types_js_1 = require("@fable-org/fable-library-js/Types.js");
|
|
@@ -16,6 +18,10 @@ const FsCell_fs_js_1 = require("../../fable_modules/FsSpreadsheet.6.3.1/Cells/Fs
|
|
|
16
18
|
const CompositeCell_js_1 = require("./CompositeCell.js");
|
|
17
19
|
const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
18
20
|
const List_js_1 = require("@fable-org/fable-library-js/List.js");
|
|
21
|
+
const Util_js_1 = require("@fable-org/fable-library-js/Util.js");
|
|
22
|
+
const ArcTableAux_js_1 = require("../../Core/Table/ArcTableAux.js");
|
|
23
|
+
const HashCodes_js_1 = require("../../Core/Helper/HashCodes.js");
|
|
24
|
+
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
19
25
|
/**
|
|
20
26
|
* Checks if the column header is a deprecated IO Header. If so, fixes it.
|
|
21
27
|
*
|
|
@@ -45,9 +51,15 @@ function fixDeprecatedIOHeader(stringCellCol) {
|
|
|
45
51
|
function fromStringCellColumns(columns) {
|
|
46
52
|
const patternInput = (0, CompositeHeader_js_2.fromStringCells)((0, Array_js_1.map)((c) => (0, Array_js_1.item)(0, c), columns));
|
|
47
53
|
const l = (0, Array_js_1.item)(0, columns).length | 0;
|
|
48
|
-
const cells = (0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => patternInput[1]((0, Array_js_1.map)((c_1) => (0, Array_js_1.item)(i, c_1), columns)), (0, Range_js_1.rangeDouble)(1, 1, l - 1))));
|
|
54
|
+
const cells = Array.from((0, Seq_js_1.toArray)((0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => patternInput[1]((0, Array_js_1.map)((c_1) => (0, Array_js_1.item)(i, c_1), columns)), (0, Range_js_1.rangeDouble)(1, 1, l - 1)))));
|
|
49
55
|
return CompositeColumn_js_1.CompositeColumn.create(patternInput[0], cells);
|
|
50
56
|
}
|
|
57
|
+
function stringCellColumnsOfFsColumns(columns) {
|
|
58
|
+
return (0, Array_js_1.map)((c) => {
|
|
59
|
+
c.ToDenseColumn();
|
|
60
|
+
return (0, Array_js_1.map)((cell) => cell.ValueAsString(), (0, Seq_js_1.toArray)(c.Cells));
|
|
61
|
+
}, columns);
|
|
62
|
+
}
|
|
51
63
|
function fromFsColumns(columns) {
|
|
52
64
|
return fromStringCellColumns((0, Array_js_1.map)((c) => {
|
|
53
65
|
c.ToDenseColumn();
|
|
@@ -59,21 +71,80 @@ function toStringCellColumns(column) {
|
|
|
59
71
|
const isTerm = column.Header.IsTermColumn;
|
|
60
72
|
const isData = column.Header.IsDataColumn && (0, Seq_js_1.exists)((c_1) => c_1.isData, column.Cells);
|
|
61
73
|
const header = (0, CompositeHeader_js_2.toStringCells)(hasUnit, column.Header);
|
|
62
|
-
const
|
|
74
|
+
const compositeCells = (0, Seq_js_1.toArray)(column.Cells);
|
|
75
|
+
const cells = (0, Array_js_1.map)((cell) => (0, CompositeCell_js_1.toStringCells)(isTerm, hasUnit, cell), (0, Seq_js_1.toArray)(column.Cells));
|
|
63
76
|
const getCellOrDefault = (ri, ci, cells_1) => (0, Option_js_1.defaultArg)((0, Array_js_1.tryItem)(ci, (0, Array_js_1.item)(ri, cells_1)), "");
|
|
64
77
|
if (hasUnit) {
|
|
65
|
-
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => getCellOrDefault(i, 0, cells), (0, Range_js_1.rangeDouble)(0, 1,
|
|
78
|
+
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i) => getCellOrDefault(i, 0, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(1, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_1) => getCellOrDefault(i_1, 1, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(2, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_2) => getCellOrDefault(i_2, 2, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(3, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_3) => getCellOrDefault(i_3, 3, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1))))))]);
|
|
66
79
|
}
|
|
67
80
|
else if (isTerm) {
|
|
68
|
-
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_4) => getCellOrDefault(i_4, 0, cells), (0, Range_js_1.rangeDouble)(0, 1,
|
|
81
|
+
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_4) => getCellOrDefault(i_4, 0, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(1, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_5) => getCellOrDefault(i_5, 1, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(2, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_6) => getCellOrDefault(i_6, 2, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1))))))]);
|
|
69
82
|
}
|
|
70
83
|
else if (isData) {
|
|
71
|
-
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_7) => getCellOrDefault(i_7, 0, cells), (0, Range_js_1.rangeDouble)(0, 1,
|
|
84
|
+
return (0, List_js_1.ofArray)([(0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_7) => getCellOrDefault(i_7, 0, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(1, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_8) => getCellOrDefault(i_8, 1, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))), (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(2, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_9) => getCellOrDefault(i_9, 2, cells), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1))))))]);
|
|
72
85
|
}
|
|
73
86
|
else {
|
|
74
|
-
return (0, List_js_1.singleton)((0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_10) => (0, Array_js_1.item)(0, (0, Array_js_1.item)(i_10, cells)), (0, Range_js_1.rangeDouble)(0, 1,
|
|
87
|
+
return (0, List_js_1.singleton)((0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)((0, Seq_js_1.singleton)((0, Array_js_1.item)(0, header)), (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((i_10) => (0, Array_js_1.item)(0, (0, Array_js_1.item)(i_10, cells)), (0, Range_js_1.rangeDouble)(0, 1, compositeCells.length - 1)))))));
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
function toFsColumns(column) {
|
|
78
91
|
return (0, List_js_1.map)((c) => (0, List_js_1.map)((s) => (new FsCell_fs_js_1.FsCell(s)), c), toStringCellColumns(column));
|
|
79
92
|
}
|
|
93
|
+
function ColumnValueRefs_fromStringCellColumns(valueMap, columns) {
|
|
94
|
+
let cellHash;
|
|
95
|
+
const hashMap = new Map([]);
|
|
96
|
+
const cells = new Map([]);
|
|
97
|
+
let constant = true;
|
|
98
|
+
const patternInput = (0, CompositeHeader_js_2.fromStringCells)((0, Array_js_1.map)((c) => (0, Array_js_1.item)(0, c), columns));
|
|
99
|
+
const header = patternInput[0];
|
|
100
|
+
const cellParser = patternInput[1];
|
|
101
|
+
const l = (0, Array_js_1.item)(0, columns).length | 0;
|
|
102
|
+
if (l === 1) {
|
|
103
|
+
return [header, (0, ArcTableAux_js_1.ColumnValueRefs_Sparse)(cells)];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
for (let i = 1; i <= (l - 1); i++) {
|
|
107
|
+
const strings = (0, Array_js_1.map)((c_1) => (0, Array_js_1.item)(i, c_1), columns);
|
|
108
|
+
const hash_2 = (0, Seq_js_1.reduce)(HashCodes_js_1.mergeHashes, (0, Seq_js_1.map)(Util_js_1.stringHash, strings)) | 0;
|
|
109
|
+
let matchValue;
|
|
110
|
+
let patternInput_1;
|
|
111
|
+
let outArg = (0, Util_js_1.defaultOf)();
|
|
112
|
+
patternInput_1 = [(0, MapUtil_js_1.tryGetValue)(hashMap, hash_2, new Types_js_1.FSharpRef(() => outArg, (v) => {
|
|
113
|
+
outArg = (v | 0);
|
|
114
|
+
})), outArg];
|
|
115
|
+
matchValue = (patternInput_1[0] ? patternInput_1[1] : undefined);
|
|
116
|
+
if (matchValue == null) {
|
|
117
|
+
if (i === 1) {
|
|
118
|
+
const cellHash_3 = (0, ArcTableAux_js_1.ensureCellHashInValueMap)(cellParser(strings), valueMap) | 0;
|
|
119
|
+
hashMap.set(hash_2, cellHash_3);
|
|
120
|
+
cells.set(i - 1, cellHash_3);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if (constant) {
|
|
124
|
+
constant = false;
|
|
125
|
+
for (let j = 0; j <= (i - 1); j++) {
|
|
126
|
+
const cellHash_4 = (0, MapUtil_js_1.getItemFromDict)(cells, 0) | 0;
|
|
127
|
+
cells.set(j, cellHash_4);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const cellHash_5 = (0, ArcTableAux_js_1.ensureCellHashInValueMap)(cellParser(strings), valueMap) | 0;
|
|
131
|
+
hashMap.set(hash_2, cellHash_5);
|
|
132
|
+
cells.set(i - 1, cellHash_5);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if ((cellHash = ((0, Option_js_1.value)(matchValue) | 0), constant)) {
|
|
136
|
+
const cellHash_1 = (0, Option_js_1.value)(matchValue) | 0;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
const cellHash_2 = (0, Option_js_1.value)(matchValue) | 0;
|
|
140
|
+
cells.set(i - 1, cellHash_2);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (constant) {
|
|
144
|
+
return [header, (0, ArcTableAux_js_1.ColumnValueRefs_Constant)((0, MapUtil_js_1.getItemFromDict)(cells, 0))];
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return [header, (0, ArcTableAux_js_1.ColumnValueRefs_Sparse)(cells)];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -31,11 +31,11 @@ const Option_js_1 = require("@fable-org/fable-library-js/Option.js");
|
|
|
31
31
|
const Collections_js_1 = require("../Core/Helper/Collections.js");
|
|
32
32
|
const Seq2_js_1 = require("@fable-org/fable-library-js/Seq2.js");
|
|
33
33
|
const ArcTypes_js_1 = require("../Core/ArcTypes.js");
|
|
34
|
+
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
34
35
|
const OntologySourceReference_js_1 = require("./Metadata/OntologySourceReference.js");
|
|
35
36
|
const Publication_js_1 = require("./Metadata/Publication.js");
|
|
36
37
|
const Contacts_js_1 = require("./Metadata/Contacts.js");
|
|
37
38
|
const Study_js_1 = require("./Metadata/Study.js");
|
|
38
|
-
const Seq_js_1 = require("@fable-org/fable-library-js/Seq.js");
|
|
39
39
|
const Map_js_1 = require("@fable-org/fable-library-js/Map.js");
|
|
40
40
|
const FsWorksheet_fs_js_1 = require("../fable_modules/FsSpreadsheet.6.3.1/FsWorksheet.fs.js");
|
|
41
41
|
const FsWorkbook_fs_js_1 = require("../fable_modules/FsSpreadsheet.6.3.1/FsWorkbook.fs.js");
|
|
@@ -108,6 +108,9 @@ function ArcInvestigation_fromParts(investigationInfo, ontologySourceReference,
|
|
|
108
108
|
return ArcTypes_js_1.ArcInvestigation.make(investigationInfo.Identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications_1, contacts_1, assays_1, studies_1, [], [], registeredStudyIdentifiers, comments, remarks_1);
|
|
109
109
|
}
|
|
110
110
|
function ArcInvestigation_fromRows(rows) {
|
|
111
|
+
if ((0, Seq_js_1.isEmpty)(rows)) {
|
|
112
|
+
throw new Error("isa_investigation sheet in Investigation file is empty");
|
|
113
|
+
}
|
|
111
114
|
const en = (0, Util_js_1.getEnumerator)(rows);
|
|
112
115
|
const emptyInvestigationInfo = ArcInvestigation_InvestigationInfo_create("", "", "", "", "", (0, List_js_1.empty)());
|
|
113
116
|
const loop = (lastLine_mut, ontologySourceReferences_mut, investigationInfo_mut, publications_mut, contacts_mut, studies_mut, remarks_mut, lineNumber_mut) => {
|
|
@@ -226,25 +229,38 @@ function ArcInvestigation_fromRows(rows) {
|
|
|
226
229
|
continue loop;
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
|
-
default:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
default:
|
|
233
|
+
if (en["System.Collections.IEnumerator.MoveNext"]()) {
|
|
234
|
+
lastLine_mut = (0, SparseTable_js_1.SparseRowModule_tryGetValueAt)(0, en["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
235
|
+
ontologySourceReferences_mut = ontologySourceReferences;
|
|
236
|
+
investigationInfo_mut = investigationInfo;
|
|
237
|
+
publications_mut = publications;
|
|
238
|
+
contacts_mut = contacts;
|
|
239
|
+
studies_mut = studies;
|
|
240
|
+
remarks_mut = remarks;
|
|
241
|
+
lineNumber_mut = lineNumber;
|
|
242
|
+
continue loop;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
let patternInput_5;
|
|
246
|
+
const tupledArg = (0, List_js_1.unzip)(studies);
|
|
247
|
+
patternInput_5 = [(0, List_js_1.reverse)(tupledArg[0]), (0, Seq2_js_1.List_distinctBy)((a_1) => a_1.Identifier, (0, List_js_1.concat)(tupledArg[1]), {
|
|
248
|
+
Equals: (x, y) => (x === y),
|
|
249
|
+
GetHashCode: Util_js_1.stringHash,
|
|
250
|
+
})];
|
|
251
|
+
return ArcInvestigation_fromParts(investigationInfo, ontologySourceReferences, publications, contacts, patternInput_5[0], patternInput_5[1], remarks);
|
|
252
|
+
}
|
|
238
253
|
}
|
|
239
254
|
break;
|
|
240
255
|
}
|
|
241
256
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
throw new Error("
|
|
257
|
+
let arcInvestigation;
|
|
258
|
+
en["System.Collections.IEnumerator.MoveNext"]();
|
|
259
|
+
arcInvestigation = loop((0, SparseTable_js_1.SparseRowModule_tryGetValueAt)(0, en["System.Collections.Generic.IEnumerator`1.get_Current"]()), (0, List_js_1.empty)(), emptyInvestigationInfo, (0, List_js_1.empty)(), (0, List_js_1.empty)(), (0, List_js_1.empty)(), (0, List_js_1.empty)(), 1);
|
|
260
|
+
if (arcInvestigation.Identifier === "") {
|
|
261
|
+
throw new Error("Mandatory Investigation identifier is not present");
|
|
247
262
|
}
|
|
263
|
+
return arcInvestigation;
|
|
248
264
|
}
|
|
249
265
|
function ArcInvestigation_toRows(investigation) {
|
|
250
266
|
let remarks, rows;
|
|
@@ -476,5 +476,5 @@ function fromFsCells(cells) {
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
function toFsCells(commentKeys) {
|
|
479
|
-
return (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Data"), new FsCell_fs_js_1.FsCell("Data Format"), new FsCell_fs_js_1.FsCell("Data Selector Format")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Explication"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Unit"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Object Type"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Description")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Generated By")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Label")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((ck) => (new FsCell_fs_js_1.FsCell(ck)), commentKeys)))))))))))))))));
|
|
479
|
+
return (0, Seq_js_1.toList)((0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Data"), new FsCell_fs_js_1.FsCell("Data Format"), new FsCell_fs_js_1.FsCell("Data Selector Format")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Explication"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Unit"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Object Type"), new FsCell_fs_js_1.FsCell("Term Source REF"), new FsCell_fs_js_1.FsCell("Term Accession Number")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Description")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Generated By")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.append)([new FsCell_fs_js_1.FsCell("Label")], (0, Seq_js_1.delay)(() => (0, Seq_js_1.map)((ck) => (new FsCell_fs_js_1.FsCell(`Comment [${ck}]`)), commentKeys)))))))))))))))));
|
|
480
480
|
}
|
|
@@ -36,7 +36,7 @@ const Types_js_1 = require("@fable-org/fable-library-js/Types.js");
|
|
|
36
36
|
const Reflection_js_1 = require("@fable-org/fable-library-js/Reflection.js");
|
|
37
37
|
const CollectionAux_js_1 = require("../CollectionAux.js");
|
|
38
38
|
const MapUtil_js_1 = require("@fable-org/fable-library-js/MapUtil.js");
|
|
39
|
-
const
|
|
39
|
+
const Collections_js_1 = require("../../Core/Helper/Collections.js");
|
|
40
40
|
const String_js_1 = require("@fable-org/fable-library-js/String.js");
|
|
41
41
|
const Comment_js_1 = require("../../Core/Comment.js");
|
|
42
42
|
const Comment_js_2 = require("./Comment.js");
|
|
@@ -319,10 +319,7 @@ function SparseTable__TryGetValueDefault_5BAE6133(this$, defaultValue, key) {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
function SparseTable_Create_Z2192E64B(matrix, keys, commentKeys, length) {
|
|
322
|
-
return new SparseTable((0, Option_js_1.defaultArg)(matrix,
|
|
323
|
-
Equals: Util_js_1.equalArrays,
|
|
324
|
-
GetHashCode: Util_js_1.arrayHash,
|
|
325
|
-
})), (0, Option_js_1.defaultArg)(keys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(commentKeys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(length, 0));
|
|
322
|
+
return new SparseTable((0, Option_js_1.defaultArg)(matrix, (0, Collections_js_1.Dictionary_init)()), (0, Option_js_1.defaultArg)(keys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(commentKeys, (0, List_js_1.empty)()), (0, Option_js_1.defaultArg)(length, 0));
|
|
326
323
|
}
|
|
327
324
|
function SparseTable_AddRow(key, values, matrix) {
|
|
328
325
|
(0, Seq_js_1.iterate)((tupledArg) => {
|