Skip to content

Display-Lab/bit-stomach

Repository files navigation

Bit Stomach

DOI

A command line application that processes performance data to make assertions about performer attributes.

An animated SVG screen cast demonstration is in the screen cast directory.

Input Requirements

The application expects a spek, tabular input data, and annotation functions.

Input Spek

JSON-LD description of project. It includes:

  • any apriori assertions about performers.
  • description of performance data column names and uses.
  • descriptions of performance measures and comparators.

Input Data

Tabular data (csv) with performance data.
These usually include: performer, timepoint, and performance value or counts.

Annotation Specification

An R file containing functions which provide situation specific interpretation of the performance values.
Specified by collaborator or domain expert.
Format and use of annotations is convention instead of configuration.

  • The annotate_X functions need to return a table with the id column and one column per annotation.
  • The short name of the annotation can be used.
  • It is looked up and resolved to an IRI per the mapping in package_constants.R
  • A cache of values can be generated by providing a setup_cache function.
  • See vert-ramp-affirmation project for exampe vignettes.

Snippet of an annotation.r that assesses the positive gap annotation. The setup_cache has been omitted for brevity.

library(dplyr, warn.conflicts = FALSE)
library(rlang, warn.conflicts = FALSE)
library(tidyr, warn.conflicts = FALSE)

annotate_positive_gap <- function(data, spek){
  rate <- cache$rate_col_sym
  time <- cache$time_col_sym
  id <- cache$id_col_sym

  data %>%
    dplyr::filter(!!time == max(!!time)) %>%
    group_by(!!id) %>%
    summarize(positive_gap = (!!rate > cache$comparator))
}

Resulting Annotations

Functions to process input data and determine if attribute is present or not.
Each function is called with the performance data and a column spec as args. It is expected to return a table of the id and boolean value of the attribute. Returned table must be grouped by id. e.g the result of annotate_capability_barier:

id positive_gap
Alice TRUE
Bob FALSE
Carol FALSE

The IRI is substituted for the attribute short name.

id http://purl.obolibrary.org/obo/psdo_0000104
Alice TRUE

The performer and attribute is emitted as part of the output JSON-LD.

{
  "@id": "_:pAlice",
  "http://purl.obolibrary.org/obo/RO_0000091": [
    {
      "@type": "http://purl.obolibrary.org/obo/psdo_0000104",
      "http://example.com/slowmo#RegardingMeasure": {
        "@id": "_:m1"
      }
    }
  ],
  "@type": "http://purl.obolibrary.org/obo/psdo_0000085"
}