Matrix Parsers
  • 27 Jul 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Matrix Parsers

  • Dark
    Light
  • PDF

Article summary

The matrix parser is the abstract parent type for other parsers which load data from multiple rows and columns in a source data table.

As an abstract type, it is not possible to instantiate a matrix type parser - only its child types.

Parser types which inherit from the matrix type are designed to create and load data into a numeric-matrix or categorical-matrix variable within a collection.

Attribute - collection

The collection attribute is required.

{
  "parser_type": "tttt",
  
  // Here, the collection attribute defines a 
  // constant collection name.
  //
  "collection": "collection_name",
  
  "variable": "variable_name",
  "parser": {...}
}

Attribute - variable

The variable attribute is required.

{
  "parser_type": "tttt",
  "collection": "collection_name",
  
  // Here, the variable attribute defines a 
  // constant variable name.
  //
  "variable": "variable_name",
  
  "parser": {...}
}

Attribute - parser

The parser attribute is required.

{
  "parser_type": "tttt",
  "collection": "collection_name",
  "variable": "variable_name",
  
  // The parser does all the work to load the data into a single
  // collection with multiple variables. These will then be converted
  // into a matrix in post-processing.
  "parser": {...}
}

Attribute - compress

The compress attribute is optional. It will default to "dense".

{
  "parser_type": "tttt",
  "collection": "collection_name",
  "variable": "variable_name",
  "parser": {...},
  
  // Instructs the parser to produce a matrix
  // with the specified level of compression.
  //
  // Options include:
  // "dense"
  // "sparse"
  // "sparse-zero" - i.e. sparse, but 0 is the default value
  //
  "compress": "sparse"
}

Was this article helpful?