@nfdi4plants/arctrl 2.4.0 → 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.
Files changed (79) hide show
  1. package/ARC.js +103 -12
  2. package/CWL/CWLTypes.js +2 -2
  3. package/CWL/Decode.js +2 -2
  4. package/CWL/Inputs.js +2 -2
  5. package/CWL/Outputs.js +2 -2
  6. package/CWL/Requirements.js +2 -2
  7. package/CWL/ToolDescription.js +1 -1
  8. package/CWL/WorkflowDescription.js +1 -1
  9. package/CWL/WorkflowSteps.js +1 -1
  10. package/ColumnIndex.js +258 -0
  11. package/Conversion.js +1679 -0
  12. package/Core/Data.js +28 -3
  13. package/Core/DataFile.js +19 -3
  14. package/Core/Helper/Collections.js +107 -4
  15. package/Core/Helper/DateTime.js +17 -0
  16. package/Core/Helper/ORCID.js +39 -0
  17. package/Json/Decode.js +3 -3
  18. package/Json/Encode.js +9 -0
  19. package/Json/OntologySourceReference.js +4 -4
  20. package/Json/ROCrate/LDContext.js +121 -0
  21. package/Json/ROCrate/LDGraph.js +87 -0
  22. package/Json/{LDObject.js → ROCrate/LDNode.js} +55 -46
  23. package/Json/ROCrate/LDRef.js +25 -0
  24. package/Json/ROCrate/LDValue.js +66 -0
  25. package/JsonIO/LDObject.js +30 -5
  26. package/ROCrate/ArcROCrateMetadata.js +14 -13
  27. package/ROCrate/Generic/Comment.js +115 -0
  28. package/ROCrate/Generic/Dataset.js +669 -0
  29. package/ROCrate/Generic/DefinedTerm.js +115 -0
  30. package/ROCrate/Generic/File.js +200 -0
  31. package/ROCrate/Generic/LabProcess.js +238 -0
  32. package/ROCrate/Generic/LabProtocol.js +275 -0
  33. package/ROCrate/Generic/Organization.js +71 -0
  34. package/ROCrate/Generic/Person.js +411 -0
  35. package/ROCrate/Generic/PostalAddress.js +159 -0
  36. package/ROCrate/Generic/PropertyValue.js +548 -0
  37. package/ROCrate/Generic/Sample.js +139 -0
  38. package/ROCrate/Generic/ScholarlyArticle.js +187 -0
  39. package/ROCrate/Helper.js +6 -0
  40. package/ROCrate/ISAProfile/Assay.js +3 -3
  41. package/ROCrate/ISAProfile/Data.js +7 -7
  42. package/ROCrate/ISAProfile/Dataset.js +7 -6
  43. package/ROCrate/ISAProfile/Investigation.js +3 -3
  44. package/ROCrate/ISAProfile/LabProcess.js +7 -7
  45. package/ROCrate/ISAProfile/LabProtocol.js +7 -7
  46. package/ROCrate/ISAProfile/Person.js +7 -7
  47. package/ROCrate/ISAProfile/PropertyValue.js +7 -7
  48. package/ROCrate/ISAProfile/Sample.js +7 -7
  49. package/ROCrate/ISAProfile/ScholarlyArticle.js +7 -7
  50. package/ROCrate/ISAProfile/Study.js +3 -3
  51. package/ROCrate/LDContext.js +283 -0
  52. package/ROCrate/LDObject.js +902 -36
  53. package/ROCrate/ROCrateContext.js +44 -0
  54. package/ROCrateIO.js +62 -0
  55. package/Spreadsheet/DataMapTable/DataMapHeader.js +3 -2
  56. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs +31 -1
  57. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs.js +30 -1
  58. package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs +1025 -0
  59. package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +433 -0
  60. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs +16 -0
  61. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FablePy.fs +14 -0
  62. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs +15 -0
  63. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs.js +4 -0
  64. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/DynamicObj.AssemblyInfo.fs +1 -1
  65. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/DynamicObj.AssemblyInfo.fs +3 -3
  66. package/fable_modules/project_cracked.json +1 -1
  67. package/package.json +1 -1
  68. package/Json/ARC.js +0 -31
  69. package/JsonIO/ARC.js +0 -31
  70. package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs +0 -310
  71. package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js +0 -166
  72. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynamicObj.fableproj +0 -0
  73. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs.js +0 -0
  74. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs +0 -0
  75. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs.js +0 -0
  76. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs +0 -0
  77. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs.js +0 -0
  78. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  79. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
@@ -1,15 +1,18 @@
1
- import { dateTime } from "./Encode.js";
2
- import { LDObject } from "../ROCrate/LDObject.js";
3
- import { int32ToString, disposeSafe, getEnumerator, isIterable, defaultOf, equals } from "../fable_modules/fable-library-js.4.24.0/Util.js";
4
- import { list } from "../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
5
- import { empty, singleton, append, choose, enumerateFromFunctions, map, delay, toList } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
6
- import { value as value_10 } from "../fable_modules/fable-library-js.4.24.0/Option.js";
7
- import { decimal, int, oneOf, map as map_1, Getters$2__get_Errors, string, Getters$2_$ctor_Z4BE6C149 } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
8
- import { ofArray, head, length, isEmpty } from "../fable_modules/fable-library-js.4.24.0/List.js";
9
- import { ErrorReason$1 } from "../fable_modules/Thoth.Json.Core.0.4.0/Types.fs.js";
10
- import { FSharpResult$2 } from "../fable_modules/fable-library-js.4.24.0/Result.js";
11
- import { fold } from "../fable_modules/fable-library-js.4.24.0/Array.js";
12
- import { Helpers_prependPath } from "./Decode.js";
1
+ import { resizeArrayOrSingleton, dateTime } from "../Encode.js";
2
+ import { LDNode, LDRef, LDValue } from "../../ROCrate/LDObject.js";
3
+ import { decoder as decoder_2, encoder as encoder_1 } from "./LDValue.js";
4
+ import { decoder as decoder_3, encoder as encoder_2 } from "./LDRef.js";
5
+ import { int32ToString, disposeSafe, getEnumerator, isIterable, defaultOf, equals } from "../../fable_modules/fable-library-js.4.24.0/Util.js";
6
+ import { list } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
7
+ import { collect, empty, singleton, append, enumerateFromFunctions, map, delay, toList } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
8
+ import { decoder as decoder_1, encoder as encoder_3 } from "./LDContext.js";
9
+ import { decimal, int, oneOf, map as map_1, Getters$2__get_Errors, string, Getters$2_$ctor_Z4BE6C149 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
10
+ import { Helpers_prependPath, Decode_resizeArrayOrSingleton } from "../Decode.js";
11
+ import { value as value_12, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
12
+ import { ofArray, head, length, isEmpty } from "../../fable_modules/fable-library-js.4.24.0/List.js";
13
+ import { ErrorReason$1 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Types.fs.js";
14
+ import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.24.0/Result.js";
15
+ import { fold } from "../../fable_modules/fable-library-js.4.24.0/Array.js";
13
16
 
14
17
  export function genericEncoder(obj) {
15
18
  if (typeof obj === "string") {
@@ -43,7 +46,13 @@ export function genericEncoder(obj) {
43
46
  else if (obj instanceof Date) {
44
47
  return dateTime(obj);
45
48
  }
46
- else if (obj instanceof LDObject) {
49
+ else if (obj instanceof LDValue) {
50
+ return encoder_1(obj);
51
+ }
52
+ else if (obj instanceof LDRef) {
53
+ return encoder_2(obj);
54
+ }
55
+ else if (obj instanceof LDNode) {
47
56
  return encoder(obj);
48
57
  }
49
58
  else if (equals(obj, defaultOf())) {
@@ -63,38 +72,28 @@ export function genericEncoder(obj) {
63
72
  }
64
73
 
65
74
  export function encoder(obj) {
66
- let values;
67
- const source_2 = choose((kv) => {
68
- const l = kv[0].toLocaleLowerCase();
69
- if (((l !== "id") && (l !== "schematype")) && (l !== "additionaltype")) {
70
- return [kv[0], genericEncoder(kv[1])];
71
- }
72
- else {
73
- return undefined;
74
- }
75
- }, obj.GetProperties(true));
76
- values = append(toList(delay(() => {
75
+ const values = toList(delay(() => {
77
76
  let value;
78
77
  return append(singleton(["@id", (value = obj.Id, {
79
78
  Encode(helpers) {
80
79
  return helpers.encodeString(value);
81
80
  },
82
- })]), delay(() => {
83
- let value_1;
84
- return append(singleton(["@type", (value_1 = obj.SchemaType, {
85
- Encode(helpers_1) {
86
- return helpers_1.encodeString(value_1);
87
- },
88
- })]), delay(() => {
89
- let value_2;
90
- return (obj.AdditionalType != null) ? singleton(["additionalType", (value_2 = value_10(obj.AdditionalType), {
91
- Encode(helpers_2) {
92
- return helpers_2.encodeString(value_2);
93
- },
94
- })]) : empty();
95
- }));
96
- }));
97
- })), source_2);
81
+ })]), delay(() => append(singleton(["@type", resizeArrayOrSingleton((value_1) => ({
82
+ Encode(helpers_1) {
83
+ return helpers_1.encodeString(value_1);
84
+ },
85
+ }), obj.SchemaType)]), delay(() => append((obj.AdditionalType.length !== 0) ? singleton(["additionalType", resizeArrayOrSingleton((value_3) => ({
86
+ Encode(helpers_2) {
87
+ return helpers_2.encodeString(value_3);
88
+ },
89
+ }), obj.AdditionalType)]) : empty(), delay(() => {
90
+ let matchValue;
91
+ return append((matchValue = obj.TryGetContext(), (matchValue != null) ? singleton(["@context", encoder_3(matchValue)]) : (empty())), delay(() => collect((kv) => {
92
+ const l = kv[0].toLocaleLowerCase();
93
+ return ((((((l !== "id") && (l !== "schematype")) && (l !== "additionaltype")) && (l !== "@context")) && !l.startsWith("init@")) && !l.startsWith("init_")) ? singleton([kv[0], genericEncoder(kv[1])]) : empty();
94
+ }, obj.GetProperties(true))));
95
+ }))))));
96
+ }));
98
97
  return {
99
98
  Encode(helpers_3) {
100
99
  const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_3)], values);
@@ -112,28 +111,38 @@ export function getDecoder(expectObject) {
112
111
  const decode = (expectObject_1) => {
113
112
  const decodeObject = {
114
113
  Decode(helpers, value) {
115
- let objectArg_1, arg_5, objectArg_2;
114
+ let arg_7, objectArg_3, arg_9, objectArg_4;
116
115
  if (helpers.isObject(value)) {
117
116
  const getters = Getters$2_$ctor_Z4BE6C149(helpers, value);
118
117
  const properties = helpers.getProperties(value);
119
118
  let result;
120
119
  const get$ = getters;
121
120
  let t;
121
+ const arg_1 = Decode_resizeArrayOrSingleton(string);
122
122
  const objectArg = get$.Required;
123
- t = objectArg.Field("@type", string);
124
- const o = new LDObject((objectArg_1 = get$.Required, objectArg_1.Field("@id", string)), t);
123
+ t = objectArg.Field("@type", arg_1);
124
+ let id;
125
+ const objectArg_1 = get$.Required;
126
+ id = objectArg_1.Field("@id", string);
127
+ let context;
128
+ const objectArg_2 = get$.Optional;
129
+ context = objectArg_2.Field("@context", decoder_1);
130
+ const o = new LDNode(id, t, unwrap((arg_7 = Decode_resizeArrayOrSingleton(string), (objectArg_3 = get$.Optional, objectArg_3.Field("additionalType", arg_7)))));
125
131
  const enumerator = getEnumerator(properties);
126
132
  try {
127
133
  while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
128
134
  const property = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
129
- if ((property !== "@id") && (property !== "@type")) {
130
- o.SetProperty(property, (arg_5 = decode(false), (objectArg_2 = get$.Required, objectArg_2.Field(property, arg_5))));
135
+ if (((property !== "@id") && (property !== "@type")) && (property !== "@context")) {
136
+ o.SetProperty(property, (arg_9 = decode(false), (objectArg_4 = get$.Required, objectArg_4.Field(property, arg_9))));
131
137
  }
132
138
  }
133
139
  }
134
140
  finally {
135
141
  disposeSafe(enumerator);
136
142
  }
143
+ if (context != null) {
144
+ o.SetContext(value_12(context));
145
+ }
137
146
  result = o;
138
147
  const matchValue = Getters$2__get_Errors(getters);
139
148
  if (!isEmpty(matchValue)) {
@@ -183,7 +192,7 @@ export function getDecoder(expectObject) {
183
192
  return map_1((value_4) => value_4, decodeObject);
184
193
  }
185
194
  else {
186
- return oneOf(ofArray([map_1((value_5) => value_5, decodeObject), map_1((value_6) => value_6, resizeArray), map_1((value_7) => value_7, string), map_1((value_8) => value_8, int), map_1((value_9) => value_9, decimal)]));
195
+ return oneOf(ofArray([map_1((value_5) => value_5, decoder_2), map_1((value_6) => value_6, decodeObject), map_1((value_7) => value_7, decoder_3), map_1((value_8) => value_8, resizeArray), map_1((value_9) => value_9, string), map_1((value_10) => value_10, int), map_1((value_11) => value_11, decimal)]));
187
196
  }
188
197
  };
189
198
  return decode(expectObject);
@@ -0,0 +1,25 @@
1
+ import { string, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
2
+ import { LDRef } from "../../ROCrate/LDObject.js";
3
+ import { singleton } from "../../fable_modules/fable-library-js.4.24.0/List.js";
4
+ import { map } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
5
+
6
+ export const decoder = object((decoders) => {
7
+ let objectArg;
8
+ return new LDRef((objectArg = decoders.Required, objectArg.Field("@id", string)));
9
+ });
10
+
11
+ export function encoder(r) {
12
+ let value;
13
+ const values = singleton(["@id", (value = r.Id, {
14
+ Encode(helpers) {
15
+ return helpers.encodeString(value);
16
+ },
17
+ })]);
18
+ return {
19
+ Encode(helpers_1) {
20
+ const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_1)], values);
21
+ return helpers_1.encodeObject(arg);
22
+ },
23
+ };
24
+ }
25
+
@@ -0,0 +1,66 @@
1
+ import { object, decimal, int, string, map, oneOf } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
2
+ import { ofArray } from "../../fable_modules/fable-library-js.4.24.0/List.js";
3
+ import { dateTime } from "../Encode.js";
4
+ import { LDValue } from "../../ROCrate/LDObject.js";
5
+ import { unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
6
+ import { map as map_1 } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
7
+
8
+ export const genericDecoder = oneOf(ofArray([map((value) => value, string), map((value_1) => value_1, int), map((value_2) => value_2, decimal)]));
9
+
10
+ export function genericEncoder(value) {
11
+ if (typeof value === "string") {
12
+ return {
13
+ Encode(helpers) {
14
+ return helpers.encodeString(value);
15
+ },
16
+ };
17
+ }
18
+ else if (typeof value === "number") {
19
+ return {
20
+ Encode(helpers_1) {
21
+ return helpers_1.encodeSignedIntegralNumber(value);
22
+ },
23
+ };
24
+ }
25
+ else if (typeof value === "boolean") {
26
+ return {
27
+ Encode(helpers_2) {
28
+ return helpers_2.encodeBool(value);
29
+ },
30
+ };
31
+ }
32
+ else if (typeof value === "number") {
33
+ return {
34
+ Encode(helpers_3) {
35
+ return helpers_3.encodeDecimalNumber(value);
36
+ },
37
+ };
38
+ }
39
+ else if (value instanceof Date) {
40
+ return dateTime(value);
41
+ }
42
+ else {
43
+ throw new Error("Unknown type");
44
+ }
45
+ }
46
+
47
+ export const decoder = object((decoders) => {
48
+ let objectArg, objectArg_1;
49
+ return new LDValue((objectArg = decoders.Required, objectArg.Field("@value", genericDecoder)), unwrap((objectArg_1 = decoders.Optional, objectArg_1.Field("@type", string))));
50
+ });
51
+
52
+ export function encoder(v) {
53
+ let value;
54
+ const values = ofArray([["@value", genericEncoder(v.Value)], ["@type", (value = v.ValueType, {
55
+ Encode(helpers) {
56
+ return helpers.encodeString(value);
57
+ },
58
+ })]]);
59
+ return {
60
+ Encode(helpers_1) {
61
+ const arg = map_1((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_1)], values);
62
+ return helpers_1.encodeObject(arg);
63
+ },
64
+ };
65
+ }
66
+
@@ -1,11 +1,12 @@
1
1
  import { fromString } from "../fable_modules/Thoth.Json.JavaScript.0.3.0/Decode.fs.js";
2
- import { encoder, decoder as decoder_1 } from "../Json/LDObject.js";
2
+ import { encoder, decoder as decoder_1 } from "../Json/ROCrate/LDNode.js";
3
3
  import { printf, toText } from "../fable_modules/fable-library-js.4.24.0/String.js";
4
4
  import { toString } from "../fable_modules/Thoth.Json.JavaScript.0.3.0/Encode.fs.js";
5
5
  import { defaultSpaces } from "../Json/Encode.js";
6
6
  import { unwrap } from "../fable_modules/fable-library-js.4.24.0/Option.js";
7
+ import { encoder as encoder_1, decoder as decoder_2 } from "../Json/ROCrate/LDGraph.js";
7
8
 
8
- export function ARCtrl_ROCrate_LDObject__LDObject_fromROCrateJsonString_Static_Z721C83C5(s) {
9
+ export function ARCtrl_ROCrate_LDNode__LDNode_fromROCrateJsonString_Static_Z721C83C5(s) {
9
10
  const matchValue = fromString(decoder_1, s);
10
11
  if (matchValue.tag === 1) {
11
12
  throw new Error(toText(printf("Error decoding string: %O"))(matchValue.fields[0]));
@@ -18,14 +19,38 @@ export function ARCtrl_ROCrate_LDObject__LDObject_fromROCrateJsonString_Static_Z
18
19
  /**
19
20
  * exports in json-ld format
20
21
  */
21
- export function ARCtrl_ROCrate_LDObject__LDObject_toROCrateJsonString_Static_71136F3F(spaces) {
22
+ export function ARCtrl_ROCrate_LDNode__LDNode_toROCrateJsonString_Static_71136F3F(spaces) {
22
23
  return (obj) => {
23
24
  const value = encoder(obj);
24
25
  return toString(defaultSpaces(spaces), value);
25
26
  };
26
27
  }
27
28
 
28
- export function ARCtrl_ROCrate_LDObject__LDObject_ToROCrateJsonString_71136F3F(this$, spaces) {
29
- return ARCtrl_ROCrate_LDObject__LDObject_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
29
+ export function ARCtrl_ROCrate_LDNode__LDNode_ToROCrateJsonString_71136F3F(this$, spaces) {
30
+ return ARCtrl_ROCrate_LDNode__LDNode_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
31
+ }
32
+
33
+ export function ARCtrl_ROCrate_LDGraph__LDGraph_fromROCrateJsonString_Static_Z721C83C5(s) {
34
+ const matchValue = fromString(decoder_2, s);
35
+ if (matchValue.tag === 1) {
36
+ throw new Error(toText(printf("Error decoding string: %O"))(matchValue.fields[0]));
37
+ }
38
+ else {
39
+ return matchValue.fields[0];
40
+ }
41
+ }
42
+
43
+ /**
44
+ * exports in json-ld format
45
+ */
46
+ export function ARCtrl_ROCrate_LDGraph__LDGraph_toROCrateJsonString_Static_71136F3F(spaces) {
47
+ return (obj) => {
48
+ const value = encoder_1(obj);
49
+ return toString(defaultSpaces(spaces), value);
50
+ };
51
+ }
52
+
53
+ export function ARCtrl_ROCrate_LDGraph__LDGraph_ToROCrateJsonString_71136F3F(this$, spaces) {
54
+ return ARCtrl_ROCrate_LDGraph__LDGraph_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
30
55
  }
31
56
 
@@ -1,13 +1,14 @@
1
1
  import { defaultOf } from "../fable_modules/fable-library-js.4.24.0/Util.js";
2
2
  import { FSharpRef } from "../fable_modules/fable-library-js.4.24.0/Types.js";
3
- import { setOptionalProperty } from "../fable_modules/DynamicObj.4.0.3/DynObj.fs.js";
4
- import { DynamicObj } from "../fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js";
5
- import { LDObject_$reflection, LDObject, LDContext_$ctor } from "./LDObject.js";
3
+ import { setOptionalProperty } from "../fable_modules/DynamicObj.7.0.1/DynObj.fs.js";
4
+ import { DynamicObj } from "../fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js";
5
+ import { LDContext } from "./LDContext.js";
6
+ import { LDNode_$reflection, LDNode } from "./LDObject.js";
6
7
  import { class_type } from "../fable_modules/fable-library-js.4.24.0/Reflection.js";
7
8
 
8
- export class ArcROCrateMetadata extends LDObject {
9
+ export class ArcROCrateMetadata extends LDNode {
9
10
  constructor(about) {
10
- super("ro-crate-metadata", "CreativeWork");
11
+ super("ro-crate-metadata", ["CreativeWork"]);
11
12
  const this$ = new FSharpRef(defaultOf());
12
13
  this$.contents = this;
13
14
  this["init@5"] = 1;
@@ -15,21 +16,21 @@ export class ArcROCrateMetadata extends LDObject {
15
16
  const conformsTo = new DynamicObj();
16
17
  conformsTo.SetProperty("@id", "https://w3id.org/ro/crate/1.1");
17
18
  this$.contents.SetProperty("conformsTo", conformsTo);
18
- const context = LDContext_$ctor();
19
- context.SetProperty("sdo", "http://schema.org/");
20
- context.SetProperty("arc", "http://purl.org/nfdi4plants/ontology/");
21
- context.SetProperty("CreativeWork", "sdo:CreativeWork");
22
- context.SetProperty("about", "sdo:about");
23
- context.SetProperty("conformsTo", "sdo:conformsTo");
19
+ const context = new LDContext();
20
+ context.AddMapping("sdo", "http://schema.org/");
21
+ context.AddMapping("arc", "http://purl.org/nfdi4plants/ontology/");
22
+ context.AddMapping("CreativeWork", "sdo:CreativeWork");
23
+ context.AddMapping("about", "sdo:about");
24
+ context.AddMapping("conformsTo", "sdo:conformsTo");
24
25
  this$.contents.SetProperty("@context", context);
25
26
  }
26
27
  }
27
28
 
28
29
  export function ArcROCrateMetadata_$reflection() {
29
- return class_type("ARCtrl.ROCrate.ArcROCrateMetadata", undefined, ArcROCrateMetadata, LDObject_$reflection());
30
+ return class_type("ARCtrl.ROCrate.ArcROCrateMetadata", undefined, ArcROCrateMetadata, LDNode_$reflection());
30
31
  }
31
32
 
32
- export function ArcROCrateMetadata_$ctor_Z475E1643(about) {
33
+ export function ArcROCrateMetadata_$ctor_Z7020538(about) {
33
34
  return new ArcROCrateMetadata(about);
34
35
  }
35
36
 
@@ -0,0 +1,115 @@
1
+ import { value, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
2
+ import { clean } from "../Helper.js";
3
+ import { LDNode } from "../LDObject.js";
4
+ import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
5
+
6
+ export class LDComment {
7
+ constructor() {
8
+ }
9
+ static get schemaType() {
10
+ return "http://schema.org/Comment";
11
+ }
12
+ static get text() {
13
+ return "http://schema.org/text";
14
+ }
15
+ static get name() {
16
+ return "http://schema.org/name";
17
+ }
18
+ static tryGetTextAsString(dt, context) {
19
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.text, unwrap(context));
20
+ let matchResult, tc;
21
+ if (matchValue != null) {
22
+ if (typeof value(matchValue) === "string") {
23
+ matchResult = 0;
24
+ tc = value(matchValue);
25
+ }
26
+ else {
27
+ matchResult = 1;
28
+ }
29
+ }
30
+ else {
31
+ matchResult = 1;
32
+ }
33
+ switch (matchResult) {
34
+ case 0:
35
+ return tc;
36
+ default:
37
+ return undefined;
38
+ }
39
+ }
40
+ static getTextAsString(dt, context) {
41
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.text, unwrap(context));
42
+ if (matchValue != null) {
43
+ if (typeof value(matchValue) === "string") {
44
+ const tc = value(matchValue);
45
+ return tc;
46
+ }
47
+ else {
48
+ throw new Error(`Property of \`text\` of object with @id \`${dt.Id}\` was not a string`);
49
+ }
50
+ }
51
+ else {
52
+ throw new Error(`Could not access property \`text\` of object with @id \`${dt.Id}\``);
53
+ }
54
+ }
55
+ static setTextAsString(dt, text, context) {
56
+ return dt.SetProperty(LDComment.text, text, unwrap(context));
57
+ }
58
+ static tryGetNameAsString(dt, context) {
59
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.name, unwrap(context));
60
+ let matchResult, n;
61
+ if (matchValue != null) {
62
+ if (typeof value(matchValue) === "string") {
63
+ matchResult = 0;
64
+ n = value(matchValue);
65
+ }
66
+ else {
67
+ matchResult = 1;
68
+ }
69
+ }
70
+ else {
71
+ matchResult = 1;
72
+ }
73
+ switch (matchResult) {
74
+ case 0:
75
+ return n;
76
+ default:
77
+ return undefined;
78
+ }
79
+ }
80
+ static getNameAsString(dt, context) {
81
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.name, unwrap(context));
82
+ if (matchValue != null) {
83
+ if (typeof value(matchValue) === "string") {
84
+ const n = value(matchValue);
85
+ return n;
86
+ }
87
+ else {
88
+ throw new Error(`Property of \`name\` of object with @id \`${dt.Id}\` was not a string`);
89
+ }
90
+ }
91
+ else {
92
+ throw new Error(`Could not access property \`name\` of object with @id \`${dt.Id}\``);
93
+ }
94
+ }
95
+ static setNameAsString(dt, name, context) {
96
+ return dt.SetProperty(LDComment.name, name, unwrap(context));
97
+ }
98
+ static genID(name, text) {
99
+ return clean((text == null) ? (`#LDComment_${name}`) : (`#LDComment_${name}_${text}`));
100
+ }
101
+ static validate(dt, context) {
102
+ return dt.HasType(LDComment.schemaType, unwrap(context)) && dt.HasProperty(LDComment.name, unwrap(context));
103
+ }
104
+ static create(name, id, text, context) {
105
+ const dt = new LDNode((id == null) ? LDComment.genID(name, unwrap(text)) : id, [LDComment.schemaType], undefined, unwrap(context));
106
+ dt.SetProperty(LDComment.name, name, unwrap(context));
107
+ dt.SetOptionalProperty(LDComment.text, text, unwrap(context));
108
+ return dt;
109
+ }
110
+ }
111
+
112
+ export function LDComment_$reflection() {
113
+ return class_type("ARCtrl.ROCrate.LDComment", undefined, LDComment);
114
+ }
115
+