General properties

Within AFD 2.0 and the API framework, the afsTableStructure is used to define the structure of tabular data that is exchanged via the afsTable entity.
It enables parties to define and distribute reusable table structures, such as domain-specific tables or codelists, which can be consumed by applications (for example for use in user interfaces or validations). These structures are typically retrieved during the initialization or periodic update of an application, avoiding the need to duplicate and locally maintain such data.

An afsTableStructure defines:

  • the identity of a table via a fixed tableName
  • the set of columns contained in the table

Each table structure is defined in the corresponding JSON Schema as a separate entity definition. The tableName attribute is used to distinguish between different table structures.
The data itself is exchanged using the afsTable entity, where each column is represented as an attribute containing an array of values. The structure defined in afsTableStructure determines how these arrays should be interpreted.

Representation of tabular data

Tabular data is represented as a set of column-based arrays. Each column is defined as an attribute in the table structure, and contains an ordered list of values.

A row is formed by combining the values at the same index position across all columns. This implies that:

  • all columns must contain the same number of values
  • each index position represents a single row in the table

The example below shows a simplified table structure with multiple columns:

occupation occupationDescription elaborationOnOccupation maximumEndAgeAov occupationalClassification professionSynonyms
0100 Scheikundigen Scheikundigen, natuurkundigen, verwante technici 68 1 Chemici
0200 Architecten Architecten, ingenieurs en verwante technici, tekenaars 67 3 Bouwkundigen

This structure can be used to exchange a table in which each column contains an array of values, and each row is derived by aligning values with the same index.

Mandatory components

An afsTableStructure must define at least:

  • one afsTable definition identified by a fixed tableName
  • one or more column attributes, each defined as an array

More information about functions related to table is available in chapter Domain specific functions – SIVI API-framework under Table.

Name Occur. Type Description
afsTableStructure 1..1 entity Structure for exchanging tabular data.
afsTable 1..n entity Entity representing a table definition and its data.
entityType 1..1 string Set to ‘customTable’.
tableName 1..1 string Identifying name of the table. Defined as a constant value within the schema and used to distinguish between table definitions.
attributeName 1..n array Column definition containing the values for a specific column. The attribute name represents the column name. Each position in the array corresponds to a row in the table.

JSON example

Below is an example of an afsTableStructure, corresponding with the example table above of a profession table. Note that at the top level within JSON, the afsTableStructure entity is not explicitly mentioned.

{
	"commonFunctional": [ {
		"entityType": "default",
		"dataCatalogVersion": "46E",
		"porCompany": "C103"
		} ],
	"afsTable": [ {
		"entityType": "customTable",
		"tableName": "ProfessionTable",
		"occupation": ["0100", "0200"],
		"occupationDescription": ["Scheikundigen", "Architecten"],
		"elaborationOnOccupation": [
			"Scheikundigen, natuurkundigen, verwante technici", 
			"Architecten, ingenieurs en verwante technici, tekenaars"
		],
		"maximumEndAgeAov": ["68", "67"],
		"occupationalClassification": ["1", "3"],
		"professionSynonyms": ["Chemici", "Bouwkundigen"]
	} ]
}

Note: Values within a column array may be of any supported type within AFD 2.0 (string, integer, decimal, boolean, time or date), as defined in the corresponding schema. All values within a single column must conform to the same data type.