diff --git a/src/Client/OfficeInterop/Functions/BuildingBlockFunctions.fs b/src/Client/OfficeInterop/Functions/BuildingBlockFunctions.fs index c7f732fe..259b712e 100644 --- a/src/Client/OfficeInterop/Functions/BuildingBlockFunctions.fs +++ b/src/Client/OfficeInterop/Functions/BuildingBlockFunctions.fs @@ -298,10 +298,10 @@ let toTermSearchable (buildingBlock:BuildingBlock) = // get all units from cells |> Array.map (fun cell -> cell.Unit, cell.Index) // filter units to unique - |> Array.choose (fun (unitName,rowInd) -> if unitName.IsSome then Some (unitName.Value,rowInd) else None) + |> Array.choose (fun (unitName, rowInd) -> if unitName.IsSome then Some (unitName.Value, rowInd) else None) |> Array.groupBy fst // get only units where unit.isSome - |> Array.map (fun (unitTerm,cellInfoArr) -> + |> Array.map (fun (unitTerm, cellInfoArr) -> let cellRowIndices = cellInfoArr |> Array.map snd |> Array.distinct // will not contain termAccession TermSearchable.create unitTerm None true colIndex cellRowIndices @@ -314,10 +314,10 @@ let toTermSearchable (buildingBlock:BuildingBlock) = // get all terms from cells |> Array.map (fun cell -> cell.Value, cell.Index) // get only values where value.isSome - |> Array.choose (fun (valueName,rowInd) -> if valueName.IsSome then Some (valueName.Value,rowInd) else None) + |> Array.choose (fun (valueName, rowInd) -> if valueName.IsSome then Some (valueName.Value, rowInd) else None) |> Array.groupBy fst // filter terms to unique - |> Array.map (fun (valueName,cellInfoArr) -> + |> Array.map (fun (valueName, cellInfoArr) -> let cellRowIndices = cellInfoArr |> Array.map snd |> Array.distinct let tryFindAccession = buildingBlock.TAN.Value.Cells diff --git a/src/Client/OfficeInterop/OfficeInterop.fs b/src/Client/OfficeInterop/OfficeInterop.fs index 39a9d4b9..cedee097 100644 --- a/src/Client/OfficeInterop/OfficeInterop.fs +++ b/src/Client/OfficeInterop/OfficeInterop.fs @@ -49,12 +49,10 @@ module OfficeInteropExtensions = /// /// /// - let getChosenBuildingBlock (table: Table) (columnIndex: float) (context: RequestContext) = + let getBuildingBlockByIndex (table: Table) (columnIndex: float) (context: RequestContext) = promise { - let selectedRange = context.workbook.getSelectedRange().load(U2.Case2 (ResizeArray[|"columnIndex"|])) - let headerRange = table.getHeaderRowRange() let _ = headerRange.load(U2.Case2 (ResizeArray [|"columnIndex"; "values"; "columnCount"|])) |> ignore @@ -104,6 +102,14 @@ module OfficeInteropExtensions = |> Seq.map (snd >> Seq.map snd >> Seq.toArray) |> Seq.toArray + /// + /// Add a new column at the given index + /// + /// + /// + /// + /// + /// static member addColumn (index:float) (excelTable:Table) name rowCount value = let col = createMatrixForTables 1 rowCount value @@ -225,18 +231,17 @@ module OfficeInteropExtensions = /// /// static member tryGetFromExcelTable (excelTable:Table, context:RequestContext) = - promise { //Get headers and body let headerRange = excelTable.getHeaderRowRange() let bodyRowRange = excelTable.getDataBodyRange() + let _ = excelTable.load(U2.Case2 (ResizeArray [|"name"|])) |> ignore - headerRange.load(U2.Case2 (ResizeArray [|"columnIndex"; "values"; "columnCount"|])) |> ignore - bodyRowRange.load(U2.Case2 (ResizeArray [|"values"; "numberFormat"|])) |> ignore + bodyRowRange.load(U2.Case2 (ResizeArray [|"numberFormat"; "values";|])) |> ignore + headerRange.load(U2.Case2 (ResizeArray [|"columnCount"; "columnIndex"; "rowIndex"; "values"; |])) let! inMemoryTable = context.sync().``then``(fun _ -> - let headers = headerRange.values.[0] |> Seq.map (fun item -> @@ -245,7 +250,6 @@ module OfficeInteropExtensions = |> Option.defaultValue "" |> (fun s -> s.TrimEnd()) ) - let bodyRows = bodyRowRange.values |> Seq.map (fun items -> @@ -256,7 +260,6 @@ module OfficeInteropExtensions = |> Option.defaultValue "" ) ) - ArcTable.fromStringSeqs(excelTable.name, headers, bodyRows) ) return inMemoryTable @@ -1136,14 +1139,13 @@ let replaceOutputColumn (excelTableName:string) (existingOutputColumn: BuildingB () ) - let! fit = autoFitTableByTable excelTable context + let! _ = autoFitTableByTable excelTable context + let warningMsg = $"Found existing output column \"{existingOutputColumn.MainColumn.Header.SwateColumnHeader}\". Changed output column to \"{newOutputcolumn.ColumnHeader.toAnnotationTableHeader()}\"." let msg = InteropLogging.Msg.create InteropLogging.Warning warningMsg - let loggingList = [ - msg - ] + let loggingList = [ msg ] return loggingList } @@ -1183,9 +1185,7 @@ let updateInputColumn (excelTable:Table) (arcTable:ArcTable) (newBB:CompositeCol let msg = InteropLogging.Msg.create InteropLogging.Warning warningMsg - let loggingList = [ - msg - ] + let loggingList = [ msg ] loggingList else @@ -1215,9 +1215,7 @@ let addInputColumn (excelTable:Table) (arcTable:ArcTable) (newBB:CompositeColumn let msg = InteropLogging.Msg.create InteropLogging.Info $"Added new input column: {newBB.Header}" - let loggingList = [ - msg - ] + let loggingList = [ msg ] loggingList @@ -1255,9 +1253,7 @@ let updateOutputColumn (excelTable:Table) (arcTable:ArcTable) (newBB:CompositeCo let msg = InteropLogging.Msg.create InteropLogging.Warning warningMsg - let loggingList = [ - msg - ] + let loggingList = [ msg ] loggingList else @@ -1288,9 +1284,7 @@ let addOutputColumn (excelTable:Table) (arcTable:ArcTable) (newBB:CompositeColum let msg = InteropLogging.Msg.create InteropLogging.Info $"Added new output column: {newBB.Header}" - let loggingList = [ - msg - ] + let loggingList = [ msg ] loggingList @@ -1347,13 +1341,15 @@ let addBuildingBlock (excelTable:Table) (arcTable:ArcTable) (newBB:CompositeColu buildingBlockCells |> List.iteri(fun i bbCell -> - let mutable newHeader = bbCell.Head - //check and extend header to avoid duplicates - newHeader <- Indexing.extendName (headers |> List.toArray) bbCell.Head + //check and extend header to avoid duplicates + let newHeader = Indexing.extendName (headers |> List.toArray) bbCell.Head let calIndex = if targetIndex >= 0 then targetIndex + (float) i else AppendIndex - let column = ExcelHelper.addColumn calIndex excelTable newHeader rowCount bbCell.Tail.Head + let value = + if bbCell.Tail.IsEmpty then "" + else bbCell.Tail.Head + let column = ExcelHelper.addColumn calIndex excelTable newHeader rowCount value newHeader::headers |> ignore column.getRange().format.autofitColumns() @@ -1363,9 +1359,7 @@ let addBuildingBlock (excelTable:Table) (arcTable:ArcTable) (newBB:CompositeColu let msg = InteropLogging.Msg.create InteropLogging.Info $"Added new term column: {newBB.Header}" - let loggingList = [ - msg - ] + let loggingList = [ msg ] loggingList @@ -1942,24 +1936,142 @@ let validateSelectedAndNeighbouringBuildingBlocks () = /// /// Checks whether the selected building block and those next to it are valid /// -let validateAnnotationTable () = +let validateAnnotationTable context = + promise { + + let! excelTable = getActiveAnnotationTable context + let! indexedErrors = ArcTable.validateExcelTable(excelTable, context) + + let messages = + if indexedErrors.Length > 0 then + indexedErrors + |> List.ofArray + |> List.collect (fun (ex, header ) -> + [InteropLogging.Msg.create InteropLogging.Warning + $"Table is not a valid ARC table / ISA table: {ex.Message}. The column {header} is not valid! It needs further inspection what causes the error."; + ]) + else + [] + + if messages.IsEmpty then + return Result.Ok excelTable + else + return Result.Error messages + } + +/// +/// Validates the arc table of the currently selected work sheet +/// When the validations returns an error, an error is returned to the user +/// When the arc table is valid one or more of the following processes happen: +/// * When the main column of term or unit is empty, then the Term Source REF and Term Accession Number are emptied +/// * When the main column of term or unit contains a value, the Term Source REF and Term Accession Number are filled +/// with the correct value +/// The later is not implemented yet +/// +let rectifyTermColumns () = Excel.run(fun context -> promise { + let! result = validateAnnotationTable context - let! excelTable = getActiveAnnotationTable context - let! indexedErrors = ArcTable.validateExcelTable(excelTable, context) + //When there are messages, then there is an error and further processes can be skipped because the annotation table is not valid + match result with + | Result.Error messages -> return messages + | Result.Ok excelTable -> + //Arctable enables a fast check for term and unit building blocks + let! arcTable = ArcTable.tryGetFromExcelTable(excelTable, context) - let messages = - if indexedErrors.Length > 0 then - indexedErrors - |> List.ofArray - |> List.collect (fun (ex, header ) -> - [InteropLogging.Msg.create InteropLogging.Warning $"Table is not a valid ARC table / ISA table: {ex.Message}. The column {header} is not valid! It needs further inspection what causes the error."; - ]) - else - [InteropLogging.Msg.create InteropLogging.Warning $"The annotation table {excelTable.name} is valid"] + let arcTable = arcTable.Value + let columns = arcTable.Columns + let _ = excelTable.columns.load(propertyNames = U2.Case2 (ResizeArray[|"items"; "values"; "rowCount"|])) - return messages + do! context.sync().``then``(fun _ -> ()) + let items = excelTable.columns.items + do! context.sync().``then``(fun _ -> ()) + + let termAndUnitHeaders = columns |> Array.choose (fun item -> if item.Header.IsTermColumn then Some (item.Header.ToString()) else None) + + let columns = + items + |> Array.ofSeq + |> Array.map (fun c -> + c.values + |> Array.ofSeq + |> Array.collect (fun cc -> + cc + |> Array.ofSeq + |> Array.choose (fun r -> if r.IsSome then Some (r.ToString()) else None) + ) + ) + + let body = excelTable.getDataBodyRange() + + let _ = body.load(propertyNames = U2.Case2 (ResizeArray[|"values"|])) + + do! context.sync().``then``(fun _ -> ()) + + for i in 0..columns.Length-1 do + let column = columns.[i] + if Array.contains (column.[0].Trim()) termAndUnitHeaders then + let! potBuildingBlock = getBuildingBlockByIndex excelTable i context + let buildingBlock = potBuildingBlock |> Array.ofSeq + + // Check whether building block is unit or not + // When it is unit, then delete the property column values only when the unit is empty, independent of the main column + // When it is a term, then delete the property column values when the main column is empty + let mainColumn = + if snd buildingBlock.[1] = "Unit" then + excelTable.columns.items.Item (fst buildingBlock.[1]) + else excelTable.columns.items.Item (fst buildingBlock.[0]) + let potPropertyColumns = + buildingBlock.[1..] + |> Array.map (fun (index, _) -> index, excelTable.columns.items.Item index) + + let propertyColumns = + potPropertyColumns + |> Array.map (fun (index, c) -> + index, + c.values + |> Array.ofSeq + |> Array.collect (fun pc -> + pc + |> Array.ofSeq + |> Array.choose (fun pcv -> if pcv.IsSome then Some (pcv.ToString()) else None) + ) + ) + + let mainColumnHasValues = + mainColumn.values + |> Array.ofSeq + |> Array.collect (fun c -> + c + |> Array.ofSeq + |> Array.choose (fun cc -> if cc.IsSome then Some (cc.ToString()) else None) + |> Array.map (fun cv -> cv, String.IsNullOrEmpty(cv)) + ) + + //Check whether value of property colum is fitting for value of main column and adapt if not + //Delete values of property columns when main column is empty + propertyColumns + |> Array.iter (fun (pIndex, pcv) -> + let values = Array.create (arcTable.RowCount + 1) "" + mainColumnHasValues + |> Array.iteri (fun mainIndex (mc, isNull) -> + //if isNull for main column, then use empty string as value for properties + if not isNull then + values.[mainIndex] <- pcv.[mainIndex] + ) + + let bodyValues = + values + |> Array.map (box >> Some) + |> Array.map (fun c -> ResizeArray[c]) + |> ResizeArray + excelTable.columns.items.[pIndex].values <- bodyValues + ) + + do! ExcelHelper.adoptTableFormats(excelTable, context, true) + + return [InteropLogging.Msg.create InteropLogging.Warning $"The annotation table {excelTable.name} is valid"] } ) @@ -1997,7 +2109,7 @@ let private createColumnBodyValues (insertBB:InsertBuildingBlock) (tableRowCount let tans = createList rowCount (insertBB.Rows |> Array.map (fun tm -> tm.accessionToTAN)) [|termNames; tsrs; tans|] -let addAnnotationBlocksToTable (buildingBlocks:InsertBuildingBlock [], table:Table,context:RequestContext) = +let addAnnotationBlocksToTable (buildingBlocks:InsertBuildingBlock [], table:Table, context:RequestContext) = promise { let excelTable = table @@ -2009,7 +2121,7 @@ let addAnnotationBlocksToTable (buildingBlocks:InsertBuildingBlock [], table:Tab /// alreadyExistingBBs -> will be used for logging let newBuildingBlocks, alreadyExistingBBs = let newSet = buildingBlocks |> Array.map (fun x -> x.ColumnHeader) |> Set.ofArray - let prevSet = existingBuildingBlocks |> Array.choose (fun x -> x.MainColumn.Header.toBuildingBlockNamePrePrint )|> Set.ofArray + let prevSet = existingBuildingBlocks |> Array.choose (fun x -> x.MainColumn.Header.toBuildingBlockNamePrePrint) |> Set.ofArray let bbsToAdd = Set.difference newSet prevSet |> Set.toArray // These building blocks do not exist in table and will be added let newBuildingBlocks = @@ -2394,8 +2506,7 @@ let checkForDeprecation (buildingBlocks:BuildingBlock []) = let message = InteropLogging.Msg.create InteropLogging.Warning m msgList <- message::msgList buildingBlocks - | None -> - buildingBlocks + | None -> buildingBlocks // Chain all deprecation checks buildingBlocks |> deprecated_DataFileName diff --git a/src/Client/SidebarComponents/Navbar.fs b/src/Client/SidebarComponents/Navbar.fs index 32ac5280..3180a113 100644 --- a/src/Client/SidebarComponents/Navbar.fs +++ b/src/Client/SidebarComponents/Navbar.fs @@ -55,8 +55,7 @@ let private shortCutIconList model dispatch = Html.i [prop.className "fa-solid fa-pen"] ], (fun _ -> - SpreadsheetInterface.ValidateAnnotationTable |> InterfaceMsg |> dispatch - SpreadsheetInterface.UpdateTermColumns |> InterfaceMsg |> dispatch + SpreadsheetInterface.RectifyTermColumns |> InterfaceMsg |> dispatch ) ) QuickAccessButton.create( diff --git a/src/Client/States/OfficeInteropState.fs b/src/Client/States/OfficeInteropState.fs index 2f4a8cd0..644b2356 100644 --- a/src/Client/States/OfficeInteropState.fs +++ b/src/Client/States/OfficeInteropState.fs @@ -47,7 +47,7 @@ type Msg = | GetParentTerm // table+database interconnected functions /// - | FillHiddenColsRequest + | RectifyTermColumns /// | FillHiddenColumns of TermSearchable [] /// diff --git a/src/Client/States/Spreadsheet.fs b/src/Client/States/Spreadsheet.fs index 5b6b5364..5cd7e533 100644 --- a/src/Client/States/Spreadsheet.fs +++ b/src/Client/States/Spreadsheet.fs @@ -188,7 +188,7 @@ type Msg = | InitFromArcFile of ArcFiles | InsertOntologyAnnotation of OntologyAnnotation | InsertOntologyAnnotations of OntologyAnnotation [] -| UpdateTermColumns +| RectifyTermColumns | UpdateTermColumnsResponse of TermTypes.TermSearchable [] /// Starts chain to export active table to isa json | ExportJson of ArcFiles * JsonExportFormat diff --git a/src/Client/States/SpreadsheetInterface.fs b/src/Client/States/SpreadsheetInterface.fs index 056fb6e7..72725516 100644 --- a/src/Client/States/SpreadsheetInterface.fs +++ b/src/Client/States/SpreadsheetInterface.fs @@ -9,7 +9,6 @@ open ARCtrl type Msg = | Initialize of Swatehost | CreateAnnotationTable of tryUsePrevOutput:bool -| ValidateAnnotationTable | RemoveBuildingBlock | UpdateDatamap of DataMap option | UpdateDataMapDataContextAt of index: int * DataContext @@ -31,5 +30,5 @@ type Msg = /// Starts chain to export active table to isa json | ExportJson of ArcFiles * JsonExportFormat | UpdateUnitForCells -| UpdateTermColumns +| RectifyTermColumns | UpdateTermColumnsResponse of TermTypes.TermSearchable [] \ No newline at end of file diff --git a/src/Client/Update/InterfaceUpdate.fs b/src/Client/Update/InterfaceUpdate.fs index e5e05869..25c89bec 100644 --- a/src/Client/Update/InterfaceUpdate.fs +++ b/src/Client/Update/InterfaceUpdate.fs @@ -92,15 +92,6 @@ module Interface = let cmd = Spreadsheet.CreateAnnotationTable usePrevOutput |> SpreadsheetMsg |> Cmd.ofMsg model, cmd | _ -> failwith "not implemented" - | ValidateAnnotationTable -> - match host with - | Some Swatehost.Excel -> - let cmd = OfficeInterop.ValidateAnnotationTable |> OfficeInteropMsg |> Cmd.ofMsg - model, cmd - //| Some Swatehost.Browser | Some Swatehost.ARCitect -> - // let cmd = Spreadsheet.CreateAnnotationTable usePrevOutput |> SpreadsheetMsg |> Cmd.ofMsg - // model, cmd - | _ -> failwith "not implemented" | UpdateDatamap datamapOption -> match host with | Some Swatehost.Excel -> @@ -274,13 +265,13 @@ module Interface = let cmd = OfficeInterop.UpdateUnitForCells |> OfficeInteropMsg |> Cmd.ofMsg model, cmd | _ -> failwith "not implemented" - | UpdateTermColumns -> + | RectifyTermColumns -> match host with | Some Swatehost.Excel -> - let cmd = OfficeInterop.FillHiddenColsRequest |> OfficeInteropMsg |> Cmd.ofMsg + let cmd = OfficeInterop.RectifyTermColumns |> OfficeInteropMsg |> Cmd.ofMsg model, cmd | Some Swatehost.Browser | Some Swatehost.ARCitect -> - let cmd = Spreadsheet.UpdateTermColumns |> SpreadsheetMsg |> Cmd.ofMsg + let cmd = Spreadsheet.RectifyTermColumns |> SpreadsheetMsg |> Cmd.ofMsg model, cmd | _ -> failwith "not implemented" | UpdateTermColumnsResponse terms -> diff --git a/src/Client/Update/OfficeInteropUpdate.fs b/src/Client/Update/OfficeInteropUpdate.fs index 013da5fe..73e76d5b 100644 --- a/src/Client/Update/OfficeInteropUpdate.fs +++ b/src/Client/Update/OfficeInteropUpdate.fs @@ -7,7 +7,6 @@ open OfficeInterop open Shared open OfficeInteropTypes open Model -open ARCtrl module OfficeInterop = let update (state: OfficeInterop.Model) (model:Model) (msg: OfficeInterop.Msg) : OfficeInterop.Model * Model * Cmd = @@ -126,16 +125,6 @@ module OfficeInterop = (curry GenericInteropLogs (AnnotationtableCreated |> OfficeInteropMsg |> Cmd.ofMsg) >> DevMsg) //success (curry GenericError Cmd.none >> DevMsg) //error state, model,cmd - - | ValidateAnnotationTable -> - let cmd = - Cmd.OfPromise.either - OfficeInterop.Core.validateAnnotationTable - () - (curry GenericInteropLogs (AnnotationtableCreated |> OfficeInteropMsg |> Cmd.ofMsg) >> DevMsg) //success - (curry GenericError Cmd.none >> DevMsg) //error - state, model,cmd - | AnnotationtableCreated -> let nextState = { model.ExcelState with @@ -159,14 +148,14 @@ module OfficeInterop = (fun tmin -> tmin |> Option.map (fun t -> ARCtrl.OntologyAnnotation.fromTerm t.toTerm) |> TermSearch.UpdateParentTerm |> TermSearchMsg) (curry GenericError Cmd.none >> DevMsg) state, model, cmd - // - | FillHiddenColsRequest -> - failwith "FillHiddenColsRequest Not implemented yet" + + | RectifyTermColumns -> + //failwith "FillHiddenColsRequest Not implemented yet" //let cmd = // Cmd.OfPromise.either // OfficeInterop.Core.getAllAnnotationBlockDetails // () - // (fun (searchTerms,deprecationLogs) -> + // (fun (searchTerms, deprecationLogs) -> // // Push possible deprecation messages by piping through "GenericInteropLogs" // GenericInteropLogs ( // // This will be executed after "deprecationLogs" are handled by "GenericInteropLogs" @@ -179,7 +168,13 @@ module OfficeInterop = // (curry GenericError (UpdateFillHiddenColsState FillHiddenColsState.Inactive |> OfficeInteropMsg |> Cmd.ofMsg) >> DevMsg) //let stateCmd = UpdateFillHiddenColsState FillHiddenColsState.ExcelCheckHiddenCols |> OfficeInteropMsg |> Cmd.ofMsg //let cmds = Cmd.batch [cmd; stateCmd] - state, model, Cmd.none + let cmd = + Cmd.OfPromise.either + OfficeInterop.Core.rectifyTermColumns + () + (curry GenericInteropLogs Cmd.none >> DevMsg) + (curry GenericError Cmd.none >> DevMsg) + state, model, cmd | FillHiddenColumns (termsWithSearchResult) -> let nextState = { diff --git a/src/Client/Update/SpreadsheetUpdate.fs b/src/Client/Update/SpreadsheetUpdate.fs index c71fcac0..d3a6284f 100644 --- a/src/Client/Update/SpreadsheetUpdate.fs +++ b/src/Client/Update/SpreadsheetUpdate.fs @@ -4,11 +4,9 @@ open Messages open Elmish open Spreadsheet open LocalHistory -open Spreadsheet open Model open Shared open Fable.Remoting.Client -open FsSpreadsheet open FsSpreadsheet.Js open ARCtrl open ARCtrl.Spreadsheet @@ -17,10 +15,6 @@ open ARCtrl.Json module Spreadsheet = module Helper = - open Browser - open Fable.Core - open Fable.Core.JS - open Fable.Core.JsInterop let download(filename, bytes:byte []) = bytes.SaveFileAs(filename) @@ -382,7 +376,7 @@ module Spreadsheet = | ExportXlsxDownload (name,xlsxBytes) -> let _ = Helper.download (name ,xlsxBytes) state, model, Cmd.none - | UpdateTermColumns -> + | RectifyTermColumns -> //let getUpdateTermColumns() = promise { // return Controller.getUpdateTermColumns state //} diff --git a/src/Shared/Shared.fs b/src/Shared/Shared.fs index 9594afbd..9fe9b6e8 100644 --- a/src/Shared/Shared.fs +++ b/src/Shared/Shared.fs @@ -13,7 +13,7 @@ module SorensenDice = let inline calculateDistance (x : Set<'T>) (y : Set<'T>) = match (x.Count, y.Count) with - | (0,0) -> 1. + | (0, 0) -> 1. | (xCount,yCount) -> (2. * (Set.intersect x y |> Set.count |> float)) / ((xCount + yCount) |> float) let createBigrams (s:string) = @@ -47,18 +47,18 @@ type IDagAPIv1 = { } type IISADotNetCommonAPIv1 = { - toAssayJson : byte [] -> Async - toSwateTemplateJson : byte [] -> Async - toInvestigationJson : byte [] -> Async - toProcessSeqJson : byte [] -> Async + toAssayJson : byte [] -> Async + toSwateTemplateJson : byte [] -> Async + toInvestigationJson : byte [] -> Async + toProcessSeqJson : byte [] -> Async //toTableJson : byte [] -> Async - toAssayJsonStr : byte [] -> Async - toSwateTemplateJsonStr : byte [] -> Async - toInvestigationJsonStr : byte [] -> Async - toProcessSeqJsonStr : byte [] -> Async + toAssayJsonStr : byte [] -> Async + toSwateTemplateJsonStr : byte [] -> Async + toInvestigationJsonStr : byte [] -> Async + toProcessSeqJsonStr : byte [] -> Async //toTableJsonStr : byte [] -> Async - testPostNumber : int -> Async - getTestNumber : unit -> Async + testPostNumber : int -> Async + getTestNumber : unit -> Async } type ISwateJsonAPIv1 = { @@ -74,16 +74,16 @@ type ISwateJsonAPIv1 = { } type IExportAPIv1 = { - toAssayXlsx : (string * OfficeInteropTypes.BuildingBlock []) [] -> Async + toAssayXlsx : (string * OfficeInteropTypes.BuildingBlock []) [] -> Async } /// Deprecated type IOntologyAPIv1 = { // Development - getTestNumber : unit -> Async + getTestNumber : unit -> Async // Ontology related requests - getAllOntologies : unit -> Async + getAllOntologies : unit -> Async // Term related requests /// @@ -104,26 +104,26 @@ type IOntologyAPIv1 = { type IOntologyAPIv2 = { // Development - getTestNumber : unit -> Async + getTestNumber : unit -> Async // Ontology related requests - getAllOntologies : unit -> Async + getAllOntologies : unit -> Async // Term related requests /// - getTermSuggestions : {| n: int; query: string; ontology: string option|} -> Async + getTermSuggestions : {| n: int; query: string; ontology: string option|} -> Async /// (nOfReturnedResults*queryString*parentOntology). If parentOntology = "" then isNull -> Error. - getTermSuggestionsByParentTerm : {| n: int; query: string; parent_term: TermMinimal |} -> Async - getAllTermsByParentTerm : TermMinimal -> Async + getTermSuggestionsByParentTerm : {| n: int; query: string; parent_term: TermMinimal |} -> Async + getAllTermsByParentTerm : TermMinimal -> Async /// (nOfReturnedResults*queryString*parentOntology). If parentOntology = "" then isNull -> Error. - getTermSuggestionsByChildTerm : {| n: int; query: string; child_term: TermMinimal |} -> Async - getAllTermsByChildTerm : TermMinimal -> Async - getTermsForAdvancedSearch : (AdvancedSearchTypes.AdvancedSearchOptions) -> Async + getTermSuggestionsByChildTerm : {| n: int; query: string; child_term: TermMinimal |} -> Async + getAllTermsByChildTerm : TermMinimal -> Async + getTermsForAdvancedSearch : (AdvancedSearchTypes.AdvancedSearchOptions) -> Async getUnitTermSuggestions : {| n: int; query: string|} -> Async - getTermsByNames : TermSearchable [] -> Async + getTermsByNames : TermSearchable [] -> Async // Tree related requests - getTreeByAccession : string -> Async + getTreeByAccession : string -> Async } type IOntologyAPIv3 = { @@ -131,12 +131,12 @@ type IOntologyAPIv3 = { getTestNumber : unit -> Async searchTerms: - {| limit: int; query: string; ontologies: string list |} -> Async + {| limit: int; query: string; ontologies: string list |} -> Async /// ontologies currently unused searchTermsByParent: - {| limit: int; query: string; parentTAN: string |} -> Async + {| limit: int; query: string; parentTAN: string |} -> Async getTermById: - string -> Async + string -> Async } type ITemplateAPIv1 = { @@ -144,5 +144,3 @@ type ITemplateAPIv1 = { getTemplates : unit -> Async getTemplateById : string -> Async } - - \ No newline at end of file