Tabular Views Over Process Graphs
ProcessCore.Table exposes ISA-like table views over a process graph. A table groups processes by name, and each row is backed by a live LabProcess.
dataset.Tables groups processes with the same name. Here both processes become rows in one Growth table.
let tableNames =
dataset.Tables.TableNames
|> Seq.toList
tableNames
|
let growth = dataset.Tables.GetTable("Growth")
let initialShape =
[ "rows", growth.RowCount
"columns", growth.ColumnCount ]
initialShape
|
Headers and cells are typed. They preserve whether a column represents input/output, protocol metadata, or annotation values.
let headers =
growth.Headers
|> Seq.map (sprintf "%A")
|> Seq.toList
headers
|
let firstRow =
growth.GetRow(0)
|> Seq.map (sprintf "%A")
|> Seq.toList
firstRow
|
Adding an annotation column writes PropertyValue objects into the appropriate graph slot. Parameter columns go to LabProcess.ParameterValue.
growth.AddColumn(
CompositeHeader.Parameter("light intensity", None),
ResizeArray([
CompositeCell.Unitized("120", "umol m-2 s-1", None)
CompositeCell.Unitized("150", "umol m-2 s-1", None)
])
)
let processParameters =
growth.Processes
|> Seq.map (fun p ->
p.ParameterValue
|> Seq.map (fun pv -> pv.Name + "=" + pv.ValueWithUnitText)
|> Seq.toList)
|> Seq.toList
processParameters
|
Adding a row creates a new LabProcess in both the table and the parent dataset. Empty cells use the table's current headers as a template.
growth.AppendRow()
let afterAppend =
[ "table rows", growth.RowCount
"dataset processes", dataset.Processes.Count ]
afterAppend
|
The table is a view, not a detached copy. Querying the dataset after a table edit sees the edited process graph.
let allParameterNames =
dataset.AllPropertyValues()
|> Seq.map (fun pv -> pv.Name)
|> Seq.distinct
|> Seq.toList
allParameterNames
|
What To Use When
Task |
API |
|---|---|
List tables |
|
Open a named table |
|
Inspect column roles |
|
Read a row |
|
Add annotation columns |
|
Add rows/processes |
|
Edit the graph through cells |
|
type Material = inherit DynamicObj new: name: string * ?additionalType: string * ?additionalProperty: PropertyValue seq -> Material member AddAdditionalProperty: pv: PropertyValue -> unit member AllConnectedNodes: ?scope: ResizeArray<LabProcess> -> ResizeArray<IONode> member AllConnectedProcesses: ?scope: ResizeArray<LabProcess> -> ResizeArray<LabProcess> member AllPropertyValues: ?scope: ResizeArray<LabProcess> -> ResizeArray<PropertyValue> member ConnectedData: ?scope: ResizeArray<LabProcess> -> ResizeArray<Data> member ConnectedMaterials: ?scope: ResizeArray<LabProcess> -> ResizeArray<Material> member DownstreamData: ?scope: ResizeArray<LabProcess> -> ResizeArray<Data> member DownstreamMaterials: ?scope: ResizeArray<LabProcess> -> ResizeArray<Material> ...
<summary> Input or output biological, chemical, or digital material in the process graph. bioschemas.org/Sample </summary>
--------------------
new: name: string * ?additionalType: string * ?additionalProperty: PropertyValue seq -> Material
type LabProtocol = inherit DynamicObj new: ?name: string * ?description: string * ?version: string * ?url: string * ?intendedUse: DefinedTerm * ?additionalType: string * ?parameters: FormalParameter seq * ?labEquipment: PropertyValue seq * ?additionalProperty: PropertyValue seq -> LabProtocol member AddAdditionalProperty: pv: PropertyValue -> unit member AddLabEquipment: pv: PropertyValue -> unit member AddParameter: fp: FormalParameter -> unit override Equals: obj: obj -> bool override GetHashCode: unit -> int member RemoveAdditionalProperty: pv: PropertyValue -> unit member RemoveLabEquipment: pv: PropertyValue -> unit member RemoveParameter: fp: FormalParameter -> unit ...
<summary> Description of a planned procedure. bioschemas.org/LabProtocol </summary>
--------------------
new: ?name: string * ?description: string * ?version: string * ?url: string * ?intendedUse: DefinedTerm * ?additionalType: string * ?parameters: FormalParameter seq * ?labEquipment: PropertyValue seq * ?additionalProperty: PropertyValue seq -> LabProtocol
type PropertyValue = inherit DynamicObj new: name: string * ?value: string * ?unit: string * ?nameTAN: string * ?valueTAN: string * ?unitTAN: string * ?additionalType: string * ?instanceOf: FormalParameter -> PropertyValue override Equals: obj: obj -> bool override GetHashCode: unit -> int member AdditionalType: string option with get, set member InstanceOf: FormalParameter option with get, set member Name: string with get, set member NameTAN: string option with get, set member NameText: string member Unit: string option with get, set ...
<summary> Extensible key-value-unit triple. Primary extension mechanism of ProcessCore. schema.org/PropertyValue </summary>
--------------------
new: name: string * ?value: string * ?unit: string * ?nameTAN: string * ?valueTAN: string * ?unitTAN: string * ?additionalType: string * ?instanceOf: FormalParameter -> PropertyValue
type LabProcess = inherit DynamicObj new: name: string * ?executesProtocol: LabProtocol * ?additionalType: string * ?inputs: IONode seq * ?outputs: IONode seq * ?parameterValue: PropertyValue seq -> LabProcess member AddInput: node: IONode -> unit member AddInputData: d: Data -> unit member AddInputMaterial: m: Material -> unit member AddOutput: node: IONode -> unit member AddOutputData: d: Data -> unit member AddOutputMaterial: m: Material -> unit member AddParameterValue: pv: PropertyValue -> unit member CanonicalizeAllNodes: ds: Dataset -> unit ...
<summary> Core transformation node. Connects inputs to outputs via a protocol. bioschemas.org/LabProcess </summary>
--------------------
new: name: string * ?executesProtocol: LabProtocol * ?additionalType: string * ?inputs: IONode seq * ?outputs: IONode seq * ?parameterValue: PropertyValue seq -> LabProcess
type Dataset = inherit DynamicObj new: identifier: string * ?name: string * ?description: string * ?additionalType: string * ?processes: LabProcess seq * ?hasPart: Dataset seq * ?additionalProperty: PropertyValue seq -> Dataset member AddAdditionalProperty: pv: PropertyValue -> unit member AddPart: child: Dataset -> unit member AddProcess: proc: LabProcess -> unit member AllConnectedNodes: node: IONode -> ResizeArray<IONode> member AllData: unit -> ResizeArray<Data> member AllMaterials: unit -> ResizeArray<Material> member AllNodes: unit -> ResizeArray<IONode> member AllProcesses: unit -> ResizeArray<LabProcess> ...
<summary> Container and context for data and processes. schema.org/Dataset </summary>
--------------------
new: identifier: string * ?name: string * ?description: string * ?additionalType: string * ?processes: LabProcess seq * ?hasPart: Dataset seq * ?additionalProperty: PropertyValue seq -> Dataset
<summary> A live tabular view of all processes in this dataset, grouped by process name. </summary>
<summary> Names of all tables in order. </summary>
<summary> Number of visible rows in the table projection. </summary>
<summary> Number of columns (derived from current process state). </summary>
<summary> Derive headers from the current process state. </summary>
<summary> Typed column header. Carries the column role and, for annotation columns, the ontology term identifying what is being described. </summary>
<summary> Typed cell value. </summary>
<summary> Numeric value with unit term </summary>
<summary> The underlying process nodes this table projects. </summary>
ProcessCore