Skip to content

Commit f65d414

Browse files
committed
start reworking ARCtrl.json project
1 parent b568074 commit f65d414

File tree

106 files changed

+800
-913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+800
-913
lines changed

src/ARCtrl/ARC.fs

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
open ARCtrl.FileSystem
44
open ARCtrl.Contract
5-
open ARCtrl.ISA
6-
open ARCtrl.ISA.Spreadsheet
5+
open ARCtrl
6+
open ARCtrl.Helper
7+
open ARCtrl.Spreadsheet
78
open FsSpreadsheet
89
open Fable.Core
910

@@ -48,7 +49,7 @@ module ARCAux =
4849
fs.Union(tree)
4950

5051
[<AttachMembers>]
51-
type ARC(?isa : ISA.ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSystem) =
52+
type ARC(?isa : ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSystem) =
5253

5354
let mutable _isa = isa
5455
let mutable _cwl = cwl
@@ -264,7 +265,7 @@ type ARC(?isa : ISA.ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSyste
264265
let workbooks = System.Collections.Generic.Dictionary<string, DTOType*FsWorkbook>()
265266
match this.ISA with
266267
| Some inv ->
267-
let investigationConverter = if isLight then ISA.Spreadsheet.ArcInvestigation.toLightFsWorkbook else ISA.Spreadsheet.ArcInvestigation.toFsWorkbook
268+
let investigationConverter = if isLight then Spreadsheet.ArcInvestigation.toLightFsWorkbook else Spreadsheet.ArcInvestigation.toFsWorkbook
268269
workbooks.Add (Path.InvestigationFileName, (DTOType.ISA_Investigation, investigationConverter inv))
269270
inv.StaticHash <- inv.GetLightHashCode()
270271
inv.Studies
@@ -280,12 +281,12 @@ type ARC(?isa : ISA.ArcInvestigation, ?cwl : CWL.CWL, ?fs : FileSystem.FileSyste
280281
a.StaticHash <- a.GetHashCode()
281282
workbooks.Add (
282283
Identifier.Assay.fileNameFromIdentifier a.Identifier,
283-
(DTOType.ISA_Assay, ISA.Spreadsheet.ArcAssay.toFsWorkbook a))
284+
(DTOType.ISA_Assay, Spreadsheet.ArcAssay.toFsWorkbook a))
284285
)
285286

286287
| None ->
287288
//printfn "ARC contains no ISA part."
288-
workbooks.Add (Path.InvestigationFileName, (DTOType.ISA_Investigation, ISA.Spreadsheet.ArcInvestigation.toLightFsWorkbook (ArcInvestigation.create(Identifier.MISSING_IDENTIFIER))))
289+
workbooks.Add (Path.InvestigationFileName, (DTOType.ISA_Investigation, Spreadsheet.ArcInvestigation.toLightFsWorkbook (ArcInvestigation.create(Identifier.MISSING_IDENTIFIER))))
289290

290291
// Iterates over filesystem and creates a write contract for every file. If possible, include DTO.
291292
_fs.Tree.ToFilePaths(true)

src/ARCtrl/ARCtrl.fsproj

-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818
<None Include="../../build/logo.png" Pack="true" PackagePath="\" />
1919
</ItemGroup>
2020
<ItemGroup>
21-
<Compile Include="SemVer.fs" />
2221
<Compile Include="WebRequest\WebRequest.Node.fs" />
2322
<Compile Include="WebRequest\WebRequest.Py.fs" />
2423
<Compile Include="WebRequest\WebRequest.fs" />
2524
<Compile Include="Contracts\Contracts.ArcTypes.fs" />
2625
<Compile Include="Contracts\Contracts.Git.fs" />
2726
<Compile Include="Contracts\Contracts.ARCtrl.fs" />
28-
<Compile Include="Templates\Template.fs" />
2927
<Compile Include="Templates\Templates.fs" />
3028
<Compile Include="Templates\Template.Json.fs" />
3129
<Compile Include="Templates\Template.Spreadsheet.fs" />

src/ARCtrl/Contracts/Contracts.ArcTypes.fs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
open ARCtrl.FileSystem
44
open ARCtrl.Path
5-
open ARCtrl.ISA.Spreadsheet
6-
open ARCtrl.ISA
5+
open ARCtrl.Spreadsheet
6+
open ARCtrl
7+
open ARCtrl.Helper
78
open FsSpreadsheet
89

910

src/ARCtrl/SemVer.fs

-64
This file was deleted.

src/ARCtrl/Templates/Template.Json.fs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module ARCtrl.Template.Json
22

33
open ARCtrl.Template
4-
open ARCtrl.ISA
4+
open ARCtrl
55
open System
66
open ARCtrl
77

88
open Thoth.Json.Core
9-
open ARCtrl.ISA.Json
9+
open ARCtrl.Json
1010

1111
//https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders
1212

@@ -26,8 +26,8 @@ module Template =
2626

2727

2828
let encode (template: Template) =
29-
let personEncoder = ARCtrl.ISA.Json.Person.encoder (ConverterOptions())
30-
let oaEncoder = ARCtrl.ISA.Json.OntologyAnnotation.encoder (ConverterOptions())
29+
let personEncoder = ARCtrl.Json.Person.encoder (ConverterOptions())
30+
let oaEncoder = ARCtrl.Json.OntologyAnnotation.encoder (ConverterOptions())
3131
Encode.object [
3232
"id", Encode.guid template.Id
3333
"table", ArcTable.encoder template.Table
@@ -48,8 +48,8 @@ module Template =
4848
]
4949

5050
let decode : Decoder<Template> =
51-
let personDecoder = ARCtrl.ISA.Json.Person.decoder (ConverterOptions())
52-
let oaDecoder = ARCtrl.ISA.Json.OntologyAnnotation.decoder (ConverterOptions())
51+
let personDecoder = ARCtrl.Json.Person.decoder (ConverterOptions())
52+
let oaDecoder = ARCtrl.Json.OntologyAnnotation.decoder (ConverterOptions())
5353
Decode.object(fun get ->
5454
Template.create(
5555
get.Required.Field "id" Decode.guid,
@@ -74,7 +74,7 @@ module Template =
7474
| exn -> failwithf "Error. Given json string cannot be parsed to Template: %A" exn
7575

7676
let toJsonString (spaces: int) (template:Template) =
77-
GEncode.toJsonString spaces (encode template)
77+
Encode.toJsonString spaces (encode template)
7878

7979
module Templates =
8080

@@ -93,7 +93,7 @@ module Templates =
9393
| exn -> failwithf "Error. Given json string cannot be parsed to Templates map: %A" exn
9494

9595
let toJsonString (spaces: int) (templateList: (string*Template) []) =
96-
GEncode.toJsonString spaces (encode templateList)
96+
Encode.toJsonString spaces (encode templateList)
9797

9898

9999
[<AutoOpen>]

src/ARCtrl/Templates/Template.Spreadsheet.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module ARCtrl.Template.Spreadsheet
22

33
open FsSpreadsheet
4-
open ARCtrl.ISA.Aux
5-
open ARCtrl.ISA.Spreadsheet
6-
open ARCtrl.ISA
4+
open ARCtrl.Aux
5+
open ARCtrl.Spreadsheet
6+
open ARCtrl
77
open System.Collections.Generic
88

99
exception TemplateReadError of string

src/ARCtrl/Templates/Template.Web.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ARCtrl.Template.Web
22

33
open ARCtrl.Template
4-
open ARCtrl.ISA
4+
open ARCtrl
55
open Fable.Core
66

77

src/ARCtrl/Templates/Template.fs

-96
This file was deleted.

src/ARCtrl/Templates/Templates.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace ARCtrl.Template
22

3-
open ARCtrl.ISA
3+
open ARCtrl
44
open Fable.Core
55

66
/// This module contains unchecked helper functions for templates

src/Json/ARCtrl.Json.fsproj

+19-18
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,35 @@
3030
<Compile Include="context\rocrate\rocrate_context.fs" />
3131
<Compile Include="ConverterOptions.fs" />
3232
<Compile Include="Decode.fs" />
33-
<Compile Include="GEncode.fs" />
33+
<Compile Include="Encode.fs" />
3434
<Compile Include="ROCrateHelper.fs" />
3535
<Compile Include="Comment.fs" />
3636
<Compile Include="StringTable.fs" />
37-
<Compile Include="Ontology.fs" />
38-
<Compile Include="Factor.fs" />
39-
<Compile Include="Protocol.fs" />
40-
<Compile Include="Material.fs" />
41-
<Compile Include="Data.fs" />
42-
<Compile Include="Process.fs" />
37+
<Compile Include="OntologyAnnotation.fs" />
38+
<Compile Include="OntologySourceReference.fs" />
4339
<Compile Include="Publication.fs" />
4440
<Compile Include="Person.fs" />
41+
<Compile Include="Process\Factor.fs" />
42+
<Compile Include="Process\Protocol.fs" />
43+
<Compile Include="Process\Material.fs" />
44+
<Compile Include="Process\Data.fs" />
45+
<Compile Include="Process\Process.fs" />
46+
<Compile Include="Table\OATable.fs" />
47+
<Compile Include="Table\CompositeCell.fs" />
48+
<Compile Include="Table\CellTable.fs" />
49+
<Compile Include="Table\IOType.fs" />
50+
<Compile Include="Table\CompositeHeader.fs" />
51+
<Compile Include="Table\ArcTable.fs" />
4552
<Compile Include="Assay.fs" />
4653
<Compile Include="Study.fs" />
4754
<Compile Include="Investigation.fs" />
48-
<Compile Include="ArcTypes\OATable.fs" />
49-
<Compile Include="ArcTypes\CompositeCell.fs" />
50-
<Compile Include="ArcTypes\CellTable.fs" />
51-
<Compile Include="ArcTypes\IOType.fs" />
52-
<Compile Include="ArcTypes\CompositeHeader.fs" />
53-
<Compile Include="ArcTypes\ArcTable.fs" />
54-
<Compile Include="ArcTypes\ArcAssay.fs" />
55-
<Compile Include="ArcTypes\ArcStudy.fs" />
56-
<Compile Include="ArcTypes\ArcInvestigation.fs" />
57-
<None Include="../../../build/logo.png" Pack="true" PackagePath="\" />
55+
<Compile Include="ArcAssay.fs" />
56+
<Compile Include="ArcStudy.fs" />
57+
<Compile Include="ArcInvestigation.fs" />
5858
</ItemGroup>
5959
<ItemGroup>
60-
<Content Include="*.fsproj; **\*.fs; **\*.fsi" PackagePath="fable\" />
60+
<Folder Include="Table\" />
61+
<Folder Include="Process\" />
6162
</ItemGroup>
6263
<ItemGroup>
6364
<PackageReference Include="NJsonSchema" Version="10.8.0" />

0 commit comments

Comments
 (0)