@nfdi4plants/arctrl 2.3.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARC.js +103 -12
- package/CWL/CWLTypes.js +2 -2
- package/CWL/Decode.js +2 -2
- package/CWL/Inputs.js +2 -2
- package/CWL/Outputs.js +2 -2
- package/CWL/Requirements.js +2 -2
- package/CWL/ToolDescription.js +1 -1
- package/CWL/WorkflowDescription.js +1 -1
- package/CWL/WorkflowSteps.js +1 -1
- package/ColumnIndex.js +258 -0
- package/Conversion.js +1679 -0
- package/Core/Data.js +28 -3
- package/Core/DataFile.js +19 -3
- package/Core/Helper/Collections.js +107 -4
- package/Core/Helper/DateTime.js +17 -0
- package/Core/Helper/ORCID.js +39 -0
- package/Core/Table/ArcTable.js +6 -0
- package/Core/Table/CompositeHeader.js +4 -0
- package/Json/Assay.js +1 -1
- package/Json/Decode.js +3 -3
- package/Json/Encode.js +9 -0
- package/Json/Investigation.js +5 -4
- package/Json/OntologySourceReference.js +4 -4
- package/Json/ROCrate/LDContext.js +121 -0
- package/Json/ROCrate/LDGraph.js +87 -0
- package/Json/{LDObject.js → ROCrate/LDNode.js} +55 -46
- package/Json/ROCrate/LDRef.js +25 -0
- package/Json/ROCrate/LDValue.js +66 -0
- package/Json/Study.js +5 -4
- package/Json/context/rocrate/isa_investigation_context.js +2 -2
- package/Json/context/rocrate/isa_study_context.js +15 -11
- package/Json/context/rocrate/rocrate_context.js +1 -1
- package/JsonIO/LDObject.js +30 -5
- package/README.md +12 -3
- package/ROCrate/ArcROCrateMetadata.js +14 -13
- package/ROCrate/Generic/Comment.js +115 -0
- package/ROCrate/Generic/Dataset.js +669 -0
- package/ROCrate/Generic/DefinedTerm.js +115 -0
- package/ROCrate/Generic/File.js +200 -0
- package/ROCrate/Generic/LabProcess.js +238 -0
- package/ROCrate/Generic/LabProtocol.js +275 -0
- package/ROCrate/Generic/Organization.js +71 -0
- package/ROCrate/Generic/Person.js +411 -0
- package/ROCrate/Generic/PostalAddress.js +159 -0
- package/ROCrate/Generic/PropertyValue.js +548 -0
- package/ROCrate/Generic/Sample.js +139 -0
- package/ROCrate/Generic/ScholarlyArticle.js +187 -0
- package/ROCrate/Helper.js +6 -0
- package/ROCrate/ISAProfile/Assay.js +3 -3
- package/ROCrate/ISAProfile/Data.js +7 -7
- package/ROCrate/ISAProfile/Dataset.js +7 -6
- package/ROCrate/ISAProfile/Investigation.js +3 -3
- package/ROCrate/ISAProfile/LabProcess.js +7 -7
- package/ROCrate/ISAProfile/LabProtocol.js +7 -7
- package/ROCrate/ISAProfile/Person.js +7 -7
- package/ROCrate/ISAProfile/PropertyValue.js +7 -7
- package/ROCrate/ISAProfile/Sample.js +7 -7
- package/ROCrate/ISAProfile/ScholarlyArticle.js +7 -7
- package/ROCrate/ISAProfile/Study.js +3 -3
- package/ROCrate/LDContext.js +283 -0
- package/ROCrate/LDObject.js +902 -36
- package/ROCrate/ROCrateContext.js +44 -0
- package/ROCrateIO.js +62 -0
- package/Spreadsheet/DataMap.js +11 -3
- package/Spreadsheet/DataMapTable/DataMapHeader.js +3 -2
- package/Xlsx.js +21 -8
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs +31 -1
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs.js +30 -1
- package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs +1025 -0
- package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +433 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs +16 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FablePy.fs +14 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs +15 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs.js +4 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/DynamicObj.AssemblyInfo.fs +1 -1
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/DynamicObj.AssemblyInfo.fs +3 -3
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
- package/Json/ARC.js +0 -31
- package/JsonIO/ARC.js +0 -31
- package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs +0 -310
- package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js +0 -166
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynamicObj.fableproj +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs.js +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs.js +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs.js +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
- /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,411 @@
|
|
|
1
|
+
import { bind, some, map, value as value_1, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
|
|
2
|
+
import { LDOrganization } from "./Organization.js";
|
|
3
|
+
import { LDRef, LDNode } from "../LDObject.js";
|
|
4
|
+
import { LDDefinedTerm } from "./DefinedTerm.js";
|
|
5
|
+
import { LDPostalAddress } from "./PostalAddress.js";
|
|
6
|
+
import { ResizeArray_map } from "../../Core/Helper/Collections.js";
|
|
7
|
+
import { clean } from "../Helper.js";
|
|
8
|
+
import { tryGetOrcidURL } from "../../Core/Helper/ORCID.js";
|
|
9
|
+
import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
|
|
10
|
+
|
|
11
|
+
export class LDPerson {
|
|
12
|
+
constructor() {
|
|
13
|
+
}
|
|
14
|
+
static get schemaType() {
|
|
15
|
+
return "http://schema.org/Person";
|
|
16
|
+
}
|
|
17
|
+
static get givenName() {
|
|
18
|
+
return "http://schema.org/givenName";
|
|
19
|
+
}
|
|
20
|
+
static get affiliation() {
|
|
21
|
+
return "http://schema.org/affiliation";
|
|
22
|
+
}
|
|
23
|
+
static get email() {
|
|
24
|
+
return "http://schema.org/email";
|
|
25
|
+
}
|
|
26
|
+
static get familyName() {
|
|
27
|
+
return "http://schema.org/familyName";
|
|
28
|
+
}
|
|
29
|
+
static get identifier() {
|
|
30
|
+
return "http://schema.org/identifier";
|
|
31
|
+
}
|
|
32
|
+
static get jobTitle() {
|
|
33
|
+
return "http://schema.org/jobTitle";
|
|
34
|
+
}
|
|
35
|
+
static get additionalName() {
|
|
36
|
+
return "http://schema.org/additionalName";
|
|
37
|
+
}
|
|
38
|
+
static get address() {
|
|
39
|
+
return "http://schema.org/address";
|
|
40
|
+
}
|
|
41
|
+
static get disambiguatingDescription() {
|
|
42
|
+
return "http://schema.org/disambiguatingDescription";
|
|
43
|
+
}
|
|
44
|
+
static get faxNumber() {
|
|
45
|
+
return "http://schema.org/faxNumber";
|
|
46
|
+
}
|
|
47
|
+
static get telephone() {
|
|
48
|
+
return "http://schema.org/telephone";
|
|
49
|
+
}
|
|
50
|
+
static tryGetGivenNameAsString(p, context) {
|
|
51
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.givenName, unwrap(context));
|
|
52
|
+
let matchResult, n;
|
|
53
|
+
if (matchValue != null) {
|
|
54
|
+
if (typeof value_1(matchValue) === "string") {
|
|
55
|
+
matchResult = 0;
|
|
56
|
+
n = value_1(matchValue);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
matchResult = 1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
matchResult = 1;
|
|
64
|
+
}
|
|
65
|
+
switch (matchResult) {
|
|
66
|
+
case 0:
|
|
67
|
+
return n;
|
|
68
|
+
default:
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
static getGivenNameAsString(p, context) {
|
|
73
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.givenName, unwrap(context));
|
|
74
|
+
if (matchValue != null) {
|
|
75
|
+
if (typeof value_1(matchValue) === "string") {
|
|
76
|
+
const n = value_1(matchValue);
|
|
77
|
+
return n;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error(`Property of \`givenName\` of object with @id \`${p.Id}\` was not a string`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
throw new Error(`Could not access property \`givenName\` of object with @id \`${p.Id}\``);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
static setGivenNameAsString(p, n, context) {
|
|
88
|
+
return p.SetProperty(LDPerson.givenName, n, unwrap(context));
|
|
89
|
+
}
|
|
90
|
+
static tryGetAffiliation(p, graph, context) {
|
|
91
|
+
let n;
|
|
92
|
+
const matchValue = p.TryGetPropertyAsSingleNode(LDPerson.affiliation, unwrap(graph), unwrap(context));
|
|
93
|
+
let matchResult, n_1;
|
|
94
|
+
if (matchValue != null) {
|
|
95
|
+
if ((n = matchValue, LDOrganization.validate(n, unwrap(context)))) {
|
|
96
|
+
matchResult = 0;
|
|
97
|
+
n_1 = matchValue;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
matchResult = 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
matchResult = 1;
|
|
105
|
+
}
|
|
106
|
+
switch (matchResult) {
|
|
107
|
+
case 0:
|
|
108
|
+
return n_1;
|
|
109
|
+
default:
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
static setAffiliation(p, a, context) {
|
|
114
|
+
return p.SetProperty(LDPerson.affiliation, a, unwrap(context));
|
|
115
|
+
}
|
|
116
|
+
static tryGetEmailAsString(p, context) {
|
|
117
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.email, unwrap(context));
|
|
118
|
+
let matchResult, e;
|
|
119
|
+
if (matchValue != null) {
|
|
120
|
+
if (typeof value_1(matchValue) === "string") {
|
|
121
|
+
matchResult = 0;
|
|
122
|
+
e = value_1(matchValue);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
matchResult = 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
matchResult = 1;
|
|
130
|
+
}
|
|
131
|
+
switch (matchResult) {
|
|
132
|
+
case 0:
|
|
133
|
+
return e;
|
|
134
|
+
default:
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
static setEmailAsString(p, e, context) {
|
|
139
|
+
return p.SetProperty(LDPerson.email, e, unwrap(context));
|
|
140
|
+
}
|
|
141
|
+
static tryGetFamilyNameAsString(p, context) {
|
|
142
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.familyName, unwrap(context));
|
|
143
|
+
let matchResult, n;
|
|
144
|
+
if (matchValue != null) {
|
|
145
|
+
if (typeof value_1(matchValue) === "string") {
|
|
146
|
+
matchResult = 0;
|
|
147
|
+
n = value_1(matchValue);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
matchResult = 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
matchResult = 1;
|
|
155
|
+
}
|
|
156
|
+
switch (matchResult) {
|
|
157
|
+
case 0:
|
|
158
|
+
return n;
|
|
159
|
+
default:
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
static getFamilyNameAsString(p, context) {
|
|
164
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.familyName, unwrap(context));
|
|
165
|
+
if (matchValue != null) {
|
|
166
|
+
if (typeof value_1(matchValue) === "string") {
|
|
167
|
+
const n = value_1(matchValue);
|
|
168
|
+
return n;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
throw new Error(`Property of \`familyName\` of object with @id \`${p.Id}\` was not a string`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
throw new Error(`Could not access property \`familyName\` of object with @id \`${p.Id}\``);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
static setFamilyNameAsString(p, n, context) {
|
|
179
|
+
return p.SetProperty(LDPerson.familyName, n, unwrap(context));
|
|
180
|
+
}
|
|
181
|
+
static tryGetIdentifier(p, context) {
|
|
182
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.identifier, unwrap(context));
|
|
183
|
+
let matchResult, i;
|
|
184
|
+
if (matchValue != null) {
|
|
185
|
+
if (value_1(matchValue) instanceof LDNode) {
|
|
186
|
+
matchResult = 0;
|
|
187
|
+
i = value_1(matchValue);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
matchResult = 1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
matchResult = 1;
|
|
195
|
+
}
|
|
196
|
+
switch (matchResult) {
|
|
197
|
+
case 0:
|
|
198
|
+
return i;
|
|
199
|
+
default:
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
static setIdentifier(p, i, context) {
|
|
204
|
+
return p.SetProperty(LDPerson.identifier, i, unwrap(context));
|
|
205
|
+
}
|
|
206
|
+
static getJobTitlesAsDefinedTerm(p, graph, context) {
|
|
207
|
+
return p.GetPropertyNodes(LDPerson.jobTitle, (ldObject, context_1) => LDDefinedTerm.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
208
|
+
}
|
|
209
|
+
static setJobTitleAsDefinedTerm(p, j, context) {
|
|
210
|
+
return p.SetProperty(LDPerson.jobTitle, j, unwrap(context));
|
|
211
|
+
}
|
|
212
|
+
static tryGetAdditionalNameAsString(p, context) {
|
|
213
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.additionalName, unwrap(context));
|
|
214
|
+
let matchResult, n;
|
|
215
|
+
if (matchValue != null) {
|
|
216
|
+
if (typeof value_1(matchValue) === "string") {
|
|
217
|
+
matchResult = 0;
|
|
218
|
+
n = value_1(matchValue);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
matchResult = 1;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
matchResult = 1;
|
|
226
|
+
}
|
|
227
|
+
switch (matchResult) {
|
|
228
|
+
case 0:
|
|
229
|
+
return n;
|
|
230
|
+
default:
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
static setAdditionalNameAsString(p, n, context) {
|
|
235
|
+
return p.SetProperty(LDPerson.additionalName, n, unwrap(context));
|
|
236
|
+
}
|
|
237
|
+
static tryGetAddress(p, graph, context) {
|
|
238
|
+
let r;
|
|
239
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.address, unwrap(context));
|
|
240
|
+
let matchResult, r_1, a, s;
|
|
241
|
+
if (matchValue != null) {
|
|
242
|
+
if (value_1(matchValue) instanceof LDRef) {
|
|
243
|
+
if ((r = value_1(matchValue), graph != null)) {
|
|
244
|
+
matchResult = 0;
|
|
245
|
+
r_1 = value_1(matchValue);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
matchResult = 3;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else if (value_1(matchValue) instanceof LDNode) {
|
|
252
|
+
matchResult = 1;
|
|
253
|
+
a = value_1(matchValue);
|
|
254
|
+
}
|
|
255
|
+
else if (typeof value_1(matchValue) === "string") {
|
|
256
|
+
matchResult = 2;
|
|
257
|
+
s = value_1(matchValue);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
matchResult = 3;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
matchResult = 3;
|
|
265
|
+
}
|
|
266
|
+
switch (matchResult) {
|
|
267
|
+
case 0:
|
|
268
|
+
return map((value) => value, value_1(graph).TryGetNode(r_1.Id));
|
|
269
|
+
case 1:
|
|
270
|
+
return some(a);
|
|
271
|
+
case 2:
|
|
272
|
+
return some(s);
|
|
273
|
+
default:
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
static tryGetAddressAsPostalAddress(p, graph, context) {
|
|
278
|
+
let n;
|
|
279
|
+
const matchValue = p.TryGetPropertyAsSingleNode(LDPerson.address, unwrap(graph), unwrap(context));
|
|
280
|
+
let matchResult, n_1;
|
|
281
|
+
if (matchValue != null) {
|
|
282
|
+
if ((n = matchValue, LDPostalAddress.validate(n, unwrap(context)))) {
|
|
283
|
+
matchResult = 0;
|
|
284
|
+
n_1 = matchValue;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
matchResult = 1;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
matchResult = 1;
|
|
292
|
+
}
|
|
293
|
+
switch (matchResult) {
|
|
294
|
+
case 0:
|
|
295
|
+
return n_1;
|
|
296
|
+
default:
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
static tryGetAddressAsString(p, context) {
|
|
301
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.address, unwrap(context));
|
|
302
|
+
let matchResult, a;
|
|
303
|
+
if (matchValue != null) {
|
|
304
|
+
if (typeof value_1(matchValue) === "string") {
|
|
305
|
+
matchResult = 0;
|
|
306
|
+
a = value_1(matchValue);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
matchResult = 1;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
matchResult = 1;
|
|
314
|
+
}
|
|
315
|
+
switch (matchResult) {
|
|
316
|
+
case 0:
|
|
317
|
+
return a;
|
|
318
|
+
default:
|
|
319
|
+
return undefined;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
static setAddressAsPostalAddress(p, a, context) {
|
|
323
|
+
return p.SetProperty(LDPerson.address, a, unwrap(context));
|
|
324
|
+
}
|
|
325
|
+
static setAddressAsString(p, a, context) {
|
|
326
|
+
return p.SetProperty(LDPerson.address, a, unwrap(context));
|
|
327
|
+
}
|
|
328
|
+
static getDisambiguatingDescriptionsAsString(p, context) {
|
|
329
|
+
return ResizeArray_map((v) => v, p.GetPropertyValues(LDPerson.disambiguatingDescription, (value, context_1) => (typeof value === "string"), unwrap(context)));
|
|
330
|
+
}
|
|
331
|
+
static setDisambiguatingDescriptionsAsString(p, d, context) {
|
|
332
|
+
return p.SetProperty(LDPerson.disambiguatingDescription, d, unwrap(context));
|
|
333
|
+
}
|
|
334
|
+
static tryGetFaxNumberAsString(p, context) {
|
|
335
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.faxNumber, unwrap(context));
|
|
336
|
+
let matchResult, f;
|
|
337
|
+
if (matchValue != null) {
|
|
338
|
+
if (typeof value_1(matchValue) === "string") {
|
|
339
|
+
matchResult = 0;
|
|
340
|
+
f = value_1(matchValue);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
matchResult = 1;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
matchResult = 1;
|
|
348
|
+
}
|
|
349
|
+
switch (matchResult) {
|
|
350
|
+
case 0:
|
|
351
|
+
return f;
|
|
352
|
+
default:
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
static setFaxNumberAsString(p, f, context) {
|
|
357
|
+
return p.SetProperty(LDPerson.faxNumber, f, unwrap(context));
|
|
358
|
+
}
|
|
359
|
+
static tryGetTelephoneAsString(p, context) {
|
|
360
|
+
const matchValue = p.TryGetPropertyAsSingleton(LDPerson.telephone, unwrap(context));
|
|
361
|
+
let matchResult, t;
|
|
362
|
+
if (matchValue != null) {
|
|
363
|
+
if (typeof value_1(matchValue) === "string") {
|
|
364
|
+
matchResult = 0;
|
|
365
|
+
t = value_1(matchValue);
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
matchResult = 1;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
matchResult = 1;
|
|
373
|
+
}
|
|
374
|
+
switch (matchResult) {
|
|
375
|
+
case 0:
|
|
376
|
+
return t;
|
|
377
|
+
default:
|
|
378
|
+
return undefined;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
static setTelephoneAsString(p, t, context) {
|
|
382
|
+
return p.SetProperty(LDPerson.telephone, t, unwrap(context));
|
|
383
|
+
}
|
|
384
|
+
static genId(givenName, orcid, familyName) {
|
|
385
|
+
let matchValue;
|
|
386
|
+
return clean((matchValue = bind(tryGetOrcidURL, orcid), (matchValue == null) ? ((familyName == null) ? (`#Person_${givenName}`) : (`#Person_${givenName}_${value_1(familyName)}`)) : matchValue));
|
|
387
|
+
}
|
|
388
|
+
static validate(p, context) {
|
|
389
|
+
return p.HasType(LDPerson.schemaType, unwrap(context)) && p.HasProperty(LDPerson.givenName, unwrap(context));
|
|
390
|
+
}
|
|
391
|
+
static create(givenName, orcid, id, affiliation, email, familyName, identifier, jobTitles, additionalName, address, disambiguatingDescriptions, faxNumber, telephone, context) {
|
|
392
|
+
const person = new LDNode((id == null) ? LDPerson.genId(givenName, unwrap(orcid), unwrap(familyName)) : id, [LDPerson.schemaType], undefined, unwrap(context));
|
|
393
|
+
person.SetProperty(LDPerson.givenName, givenName, unwrap(context));
|
|
394
|
+
person.SetOptionalProperty(LDPerson.affiliation, affiliation, unwrap(context));
|
|
395
|
+
person.SetOptionalProperty(LDPerson.email, email, unwrap(context));
|
|
396
|
+
person.SetOptionalProperty(LDPerson.familyName, familyName, unwrap(context));
|
|
397
|
+
person.SetOptionalProperty(LDPerson.identifier, identifier, unwrap(context));
|
|
398
|
+
person.SetOptionalProperty(LDPerson.jobTitle, jobTitles, unwrap(context));
|
|
399
|
+
person.SetOptionalProperty(LDPerson.additionalName, additionalName, unwrap(context));
|
|
400
|
+
person.SetOptionalProperty(LDPerson.address, address, unwrap(context));
|
|
401
|
+
person.SetOptionalProperty(LDPerson.disambiguatingDescription, disambiguatingDescriptions, unwrap(context));
|
|
402
|
+
person.SetOptionalProperty(LDPerson.faxNumber, faxNumber, unwrap(context));
|
|
403
|
+
person.SetOptionalProperty(LDPerson.telephone, telephone, unwrap(context));
|
|
404
|
+
return person;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export function LDPerson_$reflection() {
|
|
409
|
+
return class_type("ARCtrl.ROCrate.LDPerson", undefined, LDPerson);
|
|
410
|
+
}
|
|
411
|
+
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { value, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
|
|
2
|
+
import { empty, singleton, append, delay, toList } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
|
|
3
|
+
import { clean } from "../Helper.js";
|
|
4
|
+
import { reduce, isEmpty } from "../../fable_modules/fable-library-js.4.24.0/List.js";
|
|
5
|
+
import { createMissingIdentifier } from "../../Core/Helper/Identifier.js";
|
|
6
|
+
import { printf, toText } from "../../fable_modules/fable-library-js.4.24.0/String.js";
|
|
7
|
+
import { LDNode } from "../LDObject.js";
|
|
8
|
+
import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
|
|
9
|
+
|
|
10
|
+
export class LDPostalAddress {
|
|
11
|
+
constructor() {
|
|
12
|
+
}
|
|
13
|
+
static get schemaType() {
|
|
14
|
+
return "http://schema.org/PostalAddress";
|
|
15
|
+
}
|
|
16
|
+
static get addressCountry() {
|
|
17
|
+
return "http://schema.org/addressCountry";
|
|
18
|
+
}
|
|
19
|
+
static get postalCode() {
|
|
20
|
+
return "http://schema.org/postalCode";
|
|
21
|
+
}
|
|
22
|
+
static get streetAddress() {
|
|
23
|
+
return "http://schema.org/streetAddress";
|
|
24
|
+
}
|
|
25
|
+
static tryGetAddressCountryAsString(s, context) {
|
|
26
|
+
const matchValue = s.TryGetPropertyAsSingleton(LDPostalAddress.addressCountry, unwrap(context));
|
|
27
|
+
let matchResult, n;
|
|
28
|
+
if (matchValue != null) {
|
|
29
|
+
if (typeof value(matchValue) === "string") {
|
|
30
|
+
matchResult = 0;
|
|
31
|
+
n = value(matchValue);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
matchResult = 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
matchResult = 1;
|
|
39
|
+
}
|
|
40
|
+
switch (matchResult) {
|
|
41
|
+
case 0:
|
|
42
|
+
return n;
|
|
43
|
+
default:
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
static getAddressCountryAsString(s, context) {
|
|
48
|
+
const matchValue = s.TryGetPropertyAsSingleton(LDPostalAddress.addressCountry, unwrap(context));
|
|
49
|
+
if (matchValue == null) {
|
|
50
|
+
throw new Error(`Could not access property \`addressCountry\` of object with @id \`${s.Id}\``);
|
|
51
|
+
}
|
|
52
|
+
else if (typeof value(matchValue) === "string") {
|
|
53
|
+
const n = value(matchValue);
|
|
54
|
+
return n;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
throw new Error(`Value of property \`addressCountry\` of object with @id \`${s.Id}\` should have been a string`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static setAddressCountryAsString(s, n) {
|
|
61
|
+
s.SetProperty(LDPostalAddress.addressCountry, n);
|
|
62
|
+
}
|
|
63
|
+
static tryGetPostalCodeAsString(s, context) {
|
|
64
|
+
const matchValue = s.TryGetPropertyAsSingleton(LDPostalAddress.postalCode, unwrap(context));
|
|
65
|
+
let matchResult, n;
|
|
66
|
+
if (matchValue != null) {
|
|
67
|
+
if (typeof value(matchValue) === "string") {
|
|
68
|
+
matchResult = 0;
|
|
69
|
+
n = value(matchValue);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
matchResult = 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
matchResult = 1;
|
|
77
|
+
}
|
|
78
|
+
switch (matchResult) {
|
|
79
|
+
case 0:
|
|
80
|
+
return n;
|
|
81
|
+
default:
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
static getPostalCodeAsString(s, context) {
|
|
86
|
+
const matchValue = s.TryGetPropertyAsSingleton(LDPostalAddress.postalCode, unwrap(context));
|
|
87
|
+
if (matchValue == null) {
|
|
88
|
+
throw new Error(`Could not access property \`postalCode\` of object with @id \`${s.Id}\``);
|
|
89
|
+
}
|
|
90
|
+
else if (typeof value(matchValue) === "string") {
|
|
91
|
+
const n = value(matchValue);
|
|
92
|
+
return n;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throw new Error(`Value of property \`postalCode\` of object with @id \`${s.Id}\` should have been a string`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
static setPostalCodeAsString(s, n) {
|
|
99
|
+
s.SetProperty(LDPostalAddress.postalCode, n);
|
|
100
|
+
}
|
|
101
|
+
static tryGetStreetAddressAsString(s, context) {
|
|
102
|
+
const matchValue = s.TryGetPropertyAsSingleton(LDPostalAddress.streetAddress, unwrap(context));
|
|
103
|
+
let matchResult, n;
|
|
104
|
+
if (matchValue != null) {
|
|
105
|
+
if (typeof value(matchValue) === "string") {
|
|
106
|
+
matchResult = 0;
|
|
107
|
+
n = value(matchValue);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
matchResult = 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
matchResult = 1;
|
|
115
|
+
}
|
|
116
|
+
switch (matchResult) {
|
|
117
|
+
case 0:
|
|
118
|
+
return n;
|
|
119
|
+
default:
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
static getStreetAddressAsString(s, context) {
|
|
124
|
+
const matchValue = s.TryGetPropertyAsSingleton(LDPostalAddress.streetAddress, unwrap(context));
|
|
125
|
+
if (matchValue == null) {
|
|
126
|
+
throw new Error(`Could not access property \`streetAddress\` of object with @id \`${s.Id}\``);
|
|
127
|
+
}
|
|
128
|
+
else if (typeof value(matchValue) === "string") {
|
|
129
|
+
const n = value(matchValue);
|
|
130
|
+
return n;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
throw new Error(`Value of property \`streetAddress\` of object with @id \`${s.Id}\` should have been a string`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
static setStreetAddressAsString(s, n) {
|
|
137
|
+
s.SetProperty(LDPostalAddress.streetAddress, n);
|
|
138
|
+
}
|
|
139
|
+
static genID(addressCountry, postalCode, streetAddress) {
|
|
140
|
+
let arg;
|
|
141
|
+
const items = toList(delay(() => append((addressCountry != null) ? singleton("addressCountry") : empty(), delay(() => append((postalCode != null) ? singleton("postalCode") : empty(), delay(() => ((streetAddress != null) ? singleton("streetAddress") : empty())))))));
|
|
142
|
+
return clean(isEmpty(items) ? createMissingIdentifier() : ((arg = reduce((acc, x) => (`${acc}_${x}`), items), toText(printf("#%s"))(arg))));
|
|
143
|
+
}
|
|
144
|
+
static validate(o, context) {
|
|
145
|
+
return o.HasType(LDPostalAddress.schemaType, unwrap(context));
|
|
146
|
+
}
|
|
147
|
+
static create(id, addressCountry, postalCode, streetAddress, context) {
|
|
148
|
+
const s = new LDNode((id == null) ? LDPostalAddress.genID(unwrap(addressCountry), unwrap(postalCode), unwrap(streetAddress)) : id, [LDPostalAddress.schemaType], undefined, unwrap(context));
|
|
149
|
+
s.SetOptionalProperty(LDPostalAddress.addressCountry, addressCountry);
|
|
150
|
+
s.SetOptionalProperty(LDPostalAddress.postalCode, postalCode);
|
|
151
|
+
s.SetOptionalProperty(LDPostalAddress.streetAddress, streetAddress);
|
|
152
|
+
return s;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function LDPostalAddress_$reflection() {
|
|
157
|
+
return class_type("ARCtrl.ROCrate.LDPostalAddress", undefined, LDPostalAddress);
|
|
158
|
+
}
|
|
159
|
+
|