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 Process.
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 Annotation objects into the appropriate graph slot. Parameter columns go to Process.ParameterValue.
growth.AddColumn(
CompositeHeader.Parameter(DefinedTerm("light intensity")),
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 Process 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.AllAnnotations()
|> 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 Sample = inherit DynamicObj new: name: string * ?additionalType: string * ?additionalProperty: Annotation seq -> Sample member AddAdditionalProperty: pv: Annotation -> unit member AllAnnotations: ?scope: ResizeArray<Process> -> ResizeArray<Annotation> member AllConnectedNodes: ?scope: ResizeArray<Process> -> ResizeArray<IONode> member AllConnectedProcesses: ?scope: ResizeArray<Process> -> ResizeArray<Process> member ConnectedData: ?scope: ResizeArray<Process> -> ResizeArray<Data> member ConnectedSamples: ?scope: ResizeArray<Process> -> ResizeArray<Sample> member DownstreamAnnotations: ?recipeName: string * ?scope: ResizeArray<Process> -> ResizeArray<Annotation> member DownstreamData: ?scope: ResizeArray<Process> -> ResizeArray<Data> ...
<summary> Input or output biological, chemical, or digital sample in the process graph. bioschemas.org/Sample </summary>
--------------------
new: name: string * ?additionalType: string * ?additionalProperty: Annotation seq -> Sample
type Recipe = inherit DynamicObj new: ?name: string * ?description: string * ?version: string * ?url: string * ?intendedUse: DefinedTerm * ?additionalType: string * ?parameters: FormalParameter seq * ?components: Annotation seq * ?additionalProperty: Annotation seq -> Recipe member AddAdditionalProperty: pv: Annotation -> unit member AddComponent: pv: Annotation -> unit member AddParameter: fp: FormalParameter -> unit override Equals: obj: obj -> bool override GetHashCode: unit -> int member RemoveAdditionalProperty: pv: Annotation -> unit member RemoveComponent: pv: Annotation -> 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 * ?components: Annotation seq * ?additionalProperty: Annotation seq -> Recipe
type Annotation = inherit DynamicObj new: name: string * ?value: string * ?unit: string * ?nameTAN: string * ?valueTAN: string * ?unitTAN: string * ?additionalType: string * ?instanceOf: FormalParameter -> Annotation override Equals: obj: obj -> bool override GetHashCode: unit -> int member NameEquals: term: DefinedTerm -> bool 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 ...
<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 -> Annotation
type Process = inherit DynamicObj new: name: string * ?executesRecipe: Recipe * ?additionalType: string * ?input: IONode * ?output: IONode * ?parameterValue: Annotation seq -> Process member AddParameterValue: pv: Annotation -> unit member AnnotationsByName: name: string -> ResizeArray<Annotation> member CanonicalizeAllNodes: ds: Dataset -> unit member ClearInput: unit -> unit member ClearOutput: unit -> unit override Equals: obj: obj -> bool override GetHashCode: unit -> int member GetParameterValue: name: string -> Annotation ...
<summary> Core transformation node. Connects inputs to outputs by executing a recipe. bioschemas.org/LabProcess </summary>
--------------------
new: name: string * ?executesRecipe: Recipe * ?additionalType: string * ?input: IONode * ?output: IONode * ?parameterValue: Annotation seq -> Process
type Dataset = inherit DynamicObj new: identifier: string * ?title: string * ?description: string * ?additionalType: string * ?license: string * ?datePublished: string * ?dateCreated: string * ?dateModified: string * ?processes: Process seq * ?hasPart: Dataset seq * ?dataFiles: Data seq * ?agents: Agent seq * ?citations: ScholarlyArticle seq * ?dataContexts: DataContext seq * ?additionalProperty: Annotation seq -> Dataset member AddAdditionalProperty: pv: Annotation -> unit member AddAgent: agent: Agent -> unit member AddCitation: article: ScholarlyArticle -> unit member AddDataContext: dataContext: DataContext -> unit member AddDataFile: data: Data -> unit member AddPart: child: Dataset -> unit member AddProcess: proc: Process -> unit member AllAgents: unit -> ResizeArray<Agent> ...
<summary> Container and context for data, processes, administrative metadata, and datamap entries. schema.org/Dataset </summary>
--------------------
new: identifier: string * ?title: string * ?description: string * ?additionalType: string * ?license: string * ?datePublished: string * ?dateCreated: string * ?dateModified: string * ?processes: Process seq * ?hasPart: Dataset seq * ?dataFiles: Data seq * ?agents: Agent seq * ?citations: ScholarlyArticle seq * ?dataContexts: DataContext seq * ?additionalProperty: Annotation 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; every row is exactly one process. </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>
type DefinedTerm = inherit DynamicObj new: name: string * ?tan: string * ?inDefinedTermSet: string -> DefinedTerm override Equals: obj: obj -> bool override GetHashCode: unit -> int member SemanticallyEquals: other: DefinedTerm -> bool member TermAccessionShort: unit -> string member TryGetTSR: unit -> string option member InDefinedTermSet: string option with get, set member Name: string with get, set member TAN: string option with get, set
<summary> Ontology annotation referencing a term in a controlled vocabulary or ontology. schema.org/DefinedTerm </summary>
--------------------
new: name: string * ?tan: string * ?inDefinedTermSet: string -> DefinedTerm
<summary> Typed cell value. </summary>
<summary> Numeric value with unit term </summary>
<summary> The underlying process nodes this table projects. </summary>
ProcessCore