@nfdi4plants/arctrl 2.2.0 → 2.2.2

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.
@@ -7,7 +7,7 @@ import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encode
7
7
  import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_2, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_2 } from "./MaterialAttributeValue.js";
8
8
  import { context_jsonvalue } from "../context/rocrate/isa_material_context.js";
9
9
  import { map as map_1 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
10
- import { list as list_2, string, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
10
+ import { list as list_2, string, unit, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
11
11
  import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
12
12
  import { Material } from "../../Core/Process/Material.js";
13
13
  import { encode } from "../IDTable.js";
@@ -38,23 +38,47 @@ export function ROCrate_encoder(oa) {
38
38
  Encode(helpers_1) {
39
39
  return helpers_1.encodeString("Material");
40
40
  },
41
- }))], tryInclude("name", (value_2) => ({
41
+ }))], ["additionalType", {
42
42
  Encode(helpers_2) {
43
- return helpers_2.encodeString(value_2);
43
+ return helpers_2.encodeString("Material");
44
+ },
45
+ }], tryInclude("name", (value_3) => ({
46
+ Encode(helpers_3) {
47
+ return helpers_3.encodeString(value_3);
44
48
  },
45
49
  }), oa.Name), tryInclude("type", ROCrate_encoder_1, oa.MaterialType), tryIncludeListOpt("characteristics", ROCrate_encoder_2, oa.Characteristics), tryIncludeListOpt("derivesFrom", ROCrate_encoder, oa.DerivesFrom), ["@context", context_jsonvalue]]));
46
50
  return {
47
- Encode(helpers_3) {
48
- const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_3)], values);
49
- return helpers_3.encodeObject(arg);
51
+ Encode(helpers_4) {
52
+ const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_4)], values);
53
+ return helpers_4.encodeObject(arg);
50
54
  },
51
55
  };
52
56
  }
53
57
 
54
58
  export const ROCrate_decoder = (() => {
55
59
  const decode = () => object((get$) => {
56
- let objectArg, objectArg_1, objectArg_2, arg_7, objectArg_3, arg_9, objectArg_4;
57
- return new Material((objectArg = get$.Optional, objectArg.Field("@id", Decode_uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("type", ROCrate_decoder_1)), (arg_7 = list_2(ROCrate_decoder_2), (objectArg_3 = get$.Optional, objectArg_3.Field("characteristics", arg_7))), (arg_9 = list_2(decode()), (objectArg_4 = get$.Optional, objectArg_4.Field("derivesFrom", arg_9))));
60
+ let objectArg_2, objectArg_3, objectArg_4, arg_11, objectArg_5, arg_13, objectArg_6;
61
+ let matchValue;
62
+ const objectArg = get$.Optional;
63
+ matchValue = objectArg.Field("additionalType", Decode_uri);
64
+ let matchResult;
65
+ if (matchValue == null) {
66
+ matchResult = 0;
67
+ }
68
+ else if (matchValue === "Material") {
69
+ matchResult = 0;
70
+ }
71
+ else {
72
+ matchResult = 1;
73
+ }
74
+ switch (matchResult) {
75
+ case 1: {
76
+ const objectArg_1 = get$.Required;
77
+ objectArg_1.Field("FailBecauseNotSample", unit);
78
+ break;
79
+ }
80
+ }
81
+ return new Material((objectArg_2 = get$.Optional, objectArg_2.Field("@id", Decode_uri)), (objectArg_3 = get$.Optional, objectArg_3.Field("name", string)), (objectArg_4 = get$.Optional, objectArg_4.Field("type", ROCrate_decoder_1)), (arg_11 = list_2(ROCrate_decoder_2), (objectArg_5 = get$.Optional, objectArg_5.Field("characteristics", arg_11))), (arg_13 = list_2(decode()), (objectArg_6 = get$.Optional, objectArg_6.Field("derivesFrom", arg_13))));
58
82
  });
59
83
  return decode();
60
84
  })();
@@ -1,7 +1,7 @@
1
- import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_1 } from "./Sample.js";
1
+ import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_1 } from "./Sample.js";
2
2
  import { ISAJson_decoder as ISAJson_decoder_3, ISAJson_encoder as ISAJson_encoder_2, ROCrate_decoder as ROCrate_decoder_3, ROCrate_encoder as ROCrate_encoder_2 } from "../Data.js";
3
3
  import { ISAJson_decoder as ISAJson_decoder_4, ISAJson_encoder as ISAJson_encoder_3, ROCrate_decoder as ROCrate_decoder_4, ROCrate_encoder as ROCrate_encoder_3 } from "./Material.js";
4
- import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_4, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_4 } from "./Source.js";
4
+ import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_4, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_4 } from "./Source.js";
5
5
  import { map, oneOf } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
6
6
  import { ProcessInput } from "../../Core/Process/ProcessInput.js";
7
7
  import { ofArray } from "../../fable_modules/fable-library-js.4.22.0/List.js";
@@ -19,7 +19,7 @@ export function ROCrate_encoder(value) {
19
19
  }
20
20
  }
21
21
 
22
- export const ROCrate_decoder = oneOf(ofArray([map((Item) => (new ProcessInput(0, [Item])), ROCrate_decoder_1), map((Item_1) => (new ProcessInput(1, [Item_1])), ROCrate_decoder_2), map((Item_2) => (new ProcessInput(2, [Item_2])), ROCrate_decoder_3), map((Item_3) => (new ProcessInput(3, [Item_3])), ROCrate_decoder_4)]));
22
+ export const ROCrate_decoder = oneOf(ofArray([map((Item) => (new ProcessInput(1, [Item])), ROCrate_decoder_1), map((Item_1) => (new ProcessInput(0, [Item_1])), ROCrate_decoder_2), map((Item_2) => (new ProcessInput(2, [Item_2])), ROCrate_decoder_3), map((Item_3) => (new ProcessInput(3, [Item_3])), ROCrate_decoder_4)]));
23
23
 
24
24
  export function ISAJson_encoder(idMap, value) {
25
25
  switch (value.tag) {
@@ -1,5 +1,5 @@
1
1
  import { replace } from "../../fable_modules/fable-library-js.4.22.0/String.js";
2
- import { ofArray, singleton, choose, append, empty, map } from "../../fable_modules/fable-library-js.4.22.0/List.js";
2
+ import { tail, head, isEmpty, ofArray, singleton, choose, append, empty, map } from "../../fable_modules/fable-library-js.4.22.0/List.js";
3
3
  import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_1 } from "./MaterialAttributeValue.js";
4
4
  import { map as map_1, defaultArg } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
5
5
  import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_2, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_2 } from "./FactorValue.js";
@@ -7,10 +7,10 @@ import { list as list_5 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode
7
7
  import { tryIncludeListOpt, tryIncludeList, tryInclude } from "../Encode.js";
8
8
  import { context_jsonvalue } from "../context/rocrate/isa_sample_context.js";
9
9
  import { map as map_2 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
10
- import { list as list_6, object, string } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
10
+ import { list as list_6, unit, object, string } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
11
11
  import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.22.0/Result.js";
12
- import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
13
12
  import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
13
+ import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
14
14
  import { ISAJson_decoder as ISAJson_decoder_3, ISAJson_encoder as ISAJson_encoder_3, ROCrate_decoder as ROCrate_decoder_3 } from "./Source.js";
15
15
  import { Sample } from "../../Core/Process/Sample.js";
16
16
  import { encode } from "../IDTable.js";
@@ -44,15 +44,19 @@ export function ROCrate_encoder(oa) {
44
44
  Encode(helpers_1) {
45
45
  return helpers_1.encodeString("Sample");
46
46
  },
47
- }))], tryInclude("name", (value_4) => ({
47
+ }))], ["additionalType", {
48
48
  Encode(helpers_2) {
49
- return helpers_2.encodeString(value_4);
49
+ return helpers_2.encodeString("Sample");
50
+ },
51
+ }], tryInclude("name", (value_5) => ({
52
+ Encode(helpers_3) {
53
+ return helpers_3.encodeString(value_5);
50
54
  },
51
55
  }), oa.Name), tryIncludeList("additionalProperties", (x) => x, additionalProperties), ["@context", context_jsonvalue]]));
52
56
  return {
53
- Encode(helpers_3) {
54
- const arg = map_2((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_3)], values);
55
- return helpers_3.encodeObject(arg);
57
+ Encode(helpers_4) {
58
+ const arg = map_2((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_4)], values);
59
+ return helpers_4.encodeObject(arg);
56
60
  },
57
61
  };
58
62
  }
@@ -72,11 +76,62 @@ export const ROCrate_additionalPropertyDecoder = {
72
76
  };
73
77
 
74
78
  export const ROCrate_decoder = object((get$) => {
75
- let objectArg_1, objectArg_2, arg_7, objectArg_3;
76
- let additionalProperties;
77
- const arg_1 = list_6(ROCrate_additionalPropertyDecoder);
79
+ let objectArg_5, objectArg_6, arg_15, objectArg_7;
80
+ let matchValue;
78
81
  const objectArg = get$.Optional;
79
- additionalProperties = objectArg.Field("additionalProperties", arg_1);
82
+ matchValue = objectArg.Field("additionalType", Decode_uri);
83
+ let matchResult;
84
+ if (matchValue == null) {
85
+ matchResult = 0;
86
+ }
87
+ else if (matchValue === "Sample") {
88
+ matchResult = 0;
89
+ }
90
+ else {
91
+ matchResult = 1;
92
+ }
93
+ switch (matchResult) {
94
+ case 1: {
95
+ const objectArg_1 = get$.Required;
96
+ objectArg_1.Field("FailBecauseNotSample", unit);
97
+ break;
98
+ }
99
+ }
100
+ let matchValue_1;
101
+ const arg_5 = list_6(string);
102
+ const objectArg_2 = get$.Optional;
103
+ matchValue_1 = objectArg_2.Field("@type", arg_5);
104
+ let matchResult_1;
105
+ if (matchValue_1 == null) {
106
+ matchResult_1 = 0;
107
+ }
108
+ else if (!isEmpty(matchValue_1)) {
109
+ if (head(matchValue_1) === "Sample") {
110
+ if (isEmpty(tail(matchValue_1))) {
111
+ matchResult_1 = 0;
112
+ }
113
+ else {
114
+ matchResult_1 = 1;
115
+ }
116
+ }
117
+ else {
118
+ matchResult_1 = 1;
119
+ }
120
+ }
121
+ else {
122
+ matchResult_1 = 1;
123
+ }
124
+ switch (matchResult_1) {
125
+ case 1: {
126
+ const objectArg_3 = get$.Required;
127
+ objectArg_3.Field("FailBecauseNotSample", unit);
128
+ break;
129
+ }
130
+ }
131
+ let additionalProperties;
132
+ const arg_9 = list_6(ROCrate_additionalPropertyDecoder);
133
+ const objectArg_4 = get$.Optional;
134
+ additionalProperties = objectArg_4.Field("additionalProperties", arg_9);
80
135
  let patternInput;
81
136
  if (additionalProperties != null) {
82
137
  const additionalProperties_1 = additionalProperties;
@@ -85,7 +140,7 @@ export const ROCrate_decoder = object((get$) => {
85
140
  else {
86
141
  patternInput = [undefined, undefined];
87
142
  }
88
- return new Sample((objectArg_1 = get$.Optional, objectArg_1.Field("@id", Decode_uri)), (objectArg_2 = get$.Optional, objectArg_2.Field("name", string)), patternInput[0], patternInput[1], (arg_7 = list_6(ROCrate_decoder_3), (objectArg_3 = get$.Optional, objectArg_3.Field("derivesFrom", arg_7))));
143
+ return new Sample((objectArg_5 = get$.Optional, objectArg_5.Field("@id", Decode_uri)), (objectArg_6 = get$.Optional, objectArg_6.Field("name", string)), patternInput[0], patternInput[1], (arg_15 = list_6(ROCrate_decoder_3), (objectArg_7 = get$.Optional, objectArg_7.Field("derivesFrom", arg_15))));
89
144
  });
90
145
 
91
146
  export function ISAJson_encoder(idMap, oa) {
@@ -1,13 +1,13 @@
1
1
  import { replace } from "../../fable_modules/fable-library-js.4.22.0/String.js";
2
2
  import { URIModule_toString } from "../../Core/URI.js";
3
- import { ofArray, singleton, choose } from "../../fable_modules/fable-library-js.4.22.0/List.js";
3
+ import { tail, head, isEmpty, ofArray, singleton, choose } from "../../fable_modules/fable-library-js.4.22.0/List.js";
4
4
  import { map } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
5
5
  import { list as list_1 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
6
6
  import { tryIncludeListOpt, tryInclude } from "../Encode.js";
7
7
  import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_1 } from "./MaterialAttributeValue.js";
8
8
  import { context_jsonvalue } from "../context/rocrate/isa_source_context.js";
9
9
  import { map as map_1 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
10
- import { list as list_2, string, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
10
+ import { string, list as list_2, unit, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
11
11
  import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
12
12
  import { Source } from "../../Core/Process/Source.js";
13
13
  import { encode } from "../IDTable.js";
@@ -38,22 +38,77 @@ export function ROCrate_encoder(oa) {
38
38
  Encode(helpers_1) {
39
39
  return helpers_1.encodeString("Source");
40
40
  },
41
- }))], tryInclude("name", (value_2) => ({
41
+ }))], ["additionalType", {
42
42
  Encode(helpers_2) {
43
- return helpers_2.encodeString(value_2);
43
+ return helpers_2.encodeString("Source");
44
+ },
45
+ }], tryInclude("name", (value_3) => ({
46
+ Encode(helpers_3) {
47
+ return helpers_3.encodeString(value_3);
44
48
  },
45
49
  }), oa.Name), tryIncludeListOpt("characteristics", ROCrate_encoder_1, oa.Characteristics), ["@context", context_jsonvalue]]));
46
50
  return {
47
- Encode(helpers_3) {
48
- const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_3)], values);
49
- return helpers_3.encodeObject(arg);
51
+ Encode(helpers_4) {
52
+ const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_4)], values);
53
+ return helpers_4.encodeObject(arg);
50
54
  },
51
55
  };
52
56
  }
53
57
 
54
58
  export const ROCrate_decoder = object((get$) => {
55
- let objectArg, objectArg_1, arg_5, objectArg_2;
56
- return new Source((objectArg = get$.Optional, objectArg.Field("@id", Decode_uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (arg_5 = list_2(ROCrate_decoder_1), (objectArg_2 = get$.Optional, objectArg_2.Field("characteristics", arg_5))));
59
+ let objectArg_4, objectArg_5, arg_13, objectArg_6;
60
+ let matchValue;
61
+ const objectArg = get$.Optional;
62
+ matchValue = objectArg.Field("additionalType", Decode_uri);
63
+ let matchResult;
64
+ if (matchValue == null) {
65
+ matchResult = 0;
66
+ }
67
+ else if (matchValue === "Source") {
68
+ matchResult = 0;
69
+ }
70
+ else {
71
+ matchResult = 1;
72
+ }
73
+ switch (matchResult) {
74
+ case 1: {
75
+ const objectArg_1 = get$.Required;
76
+ objectArg_1.Field("FailBecauseNotSample", unit);
77
+ break;
78
+ }
79
+ }
80
+ let matchValue_1;
81
+ const arg_5 = list_2(string);
82
+ const objectArg_2 = get$.Optional;
83
+ matchValue_1 = objectArg_2.Field("@type", arg_5);
84
+ let matchResult_1;
85
+ if (matchValue_1 == null) {
86
+ matchResult_1 = 0;
87
+ }
88
+ else if (!isEmpty(matchValue_1)) {
89
+ if (head(matchValue_1) === "Source") {
90
+ if (isEmpty(tail(matchValue_1))) {
91
+ matchResult_1 = 0;
92
+ }
93
+ else {
94
+ matchResult_1 = 1;
95
+ }
96
+ }
97
+ else {
98
+ matchResult_1 = 1;
99
+ }
100
+ }
101
+ else {
102
+ matchResult_1 = 1;
103
+ }
104
+ switch (matchResult_1) {
105
+ case 1: {
106
+ const objectArg_3 = get$.Required;
107
+ objectArg_3.Field("FailBecauseNotSample", unit);
108
+ break;
109
+ }
110
+ }
111
+ return new Source((objectArg_4 = get$.Optional, objectArg_4.Field("@id", Decode_uri)), (objectArg_5 = get$.Optional, objectArg_5.Field("name", string)), (arg_13 = list_2(ROCrate_decoder_1), (objectArg_6 = get$.Optional, objectArg_6.Field("characteristics", arg_13))));
57
112
  });
58
113
 
59
114
  export function ISAJson_encoder(idMap, oa) {
@@ -3,7 +3,7 @@ import { record_type, string_type } from "../../../fable_modules/fable-library-j
3
3
  import { map } from "../../../fable_modules/fable-library-js.4.22.0/Seq.js";
4
4
 
5
5
  export class IContext extends Record {
6
- constructor(sdo, arc, Assay, ArcAssay, measurementType, technologyType, technologyPlatform, dataFiles, materials, otherMaterials, samples, characteristicCategories, processSequences, unitCategories, comments, filename) {
6
+ constructor(sdo, arc, Assay, ArcAssay, measurementType, technologyType, technologyPlatform, dataFiles, materials, otherMaterials, samples, characteristicCategories, processSequence, unitCategories, comments, filename) {
7
7
  super();
8
8
  this.sdo = sdo;
9
9
  this.arc = arc;
@@ -17,7 +17,7 @@ export class IContext extends Record {
17
17
  this.otherMaterials = otherMaterials;
18
18
  this.samples = samples;
19
19
  this.characteristicCategories = characteristicCategories;
20
- this.processSequences = processSequences;
20
+ this.processSequence = processSequence;
21
21
  this.unitCategories = unitCategories;
22
22
  this.comments = comments;
23
23
  this.filename = filename;
@@ -25,7 +25,7 @@ export class IContext extends Record {
25
25
  }
26
26
 
27
27
  export function IContext_$reflection() {
28
- return record_type("ARCtrl.Json.ROCrateContext.Assay.IContext", [], IContext, () => [["sdo", string_type], ["arc", string_type], ["Assay", string_type], ["ArcAssay", string_type], ["measurementType", string_type], ["technologyType", string_type], ["technologyPlatform", string_type], ["dataFiles", string_type], ["materials", string_type], ["otherMaterials", string_type], ["samples", string_type], ["characteristicCategories", string_type], ["processSequences", string_type], ["unitCategories", string_type], ["comments", string_type], ["filename", string_type]]);
28
+ return record_type("ARCtrl.Json.ROCrateContext.Assay.IContext", [], IContext, () => [["sdo", string_type], ["arc", string_type], ["Assay", string_type], ["ArcAssay", string_type], ["measurementType", string_type], ["technologyType", string_type], ["technologyPlatform", string_type], ["dataFiles", string_type], ["materials", string_type], ["otherMaterials", string_type], ["samples", string_type], ["characteristicCategories", string_type], ["processSequence", string_type], ["unitCategories", string_type], ["comments", string_type], ["filename", string_type]]);
29
29
  }
30
30
 
31
31
  export const context_jsonvalue = (() => {
@@ -65,7 +65,7 @@ export const context_jsonvalue = (() => {
65
65
  Encode(helpers_8) {
66
66
  return helpers_8.encodeString("sdo:creator");
67
67
  },
68
- }], ["processSequences", {
68
+ }], ["processSequence", {
69
69
  Encode(helpers_9) {
70
70
  return helpers_9.encodeString("sdo:about");
71
71
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nfdi4plants/arctrl",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Top level ARC DataModel and API function descriptions.",
5
5
  "type": "module",
6
6
  "main": "index.js",