Show/Hide Toolbars

Navigation: » No topics above this level «

Interlab (Version 4)

Scroll Prev Up Next More

Interlab is a file format for the transfer of analytical data between database systems, e.g. from water and food laboratories to other database systems. The initiative for the creation of file format was taken by the then Swedish Water and Waste Water Association, VAV (now Swedish Water) in the early 1990s. The first version was published in 1995. Redbex Supports Interlab version 4.0.

For a full documentation of the Interlab standard please refer to the original Interlab specification. This chapter discusses aspects of the Interlab that are relevant for understanding how Redbex will import data from Interlab files.

Syntactical aspects

File name

The Interlab Standard specifies that .lab is the only valid extension for Interlab files. Redbex however does not check the extension for Interlab files but inspects the file contents to check if the file is an Interlab file.

Text encoding

According to the Interlab standard Interlab files can be encoded using UTF-8, UTF-16 or UTF-32. The actual encoding used may optionally be specified in the header of Interlab files using the #Tecken control sequence. Redbex will not use this information in from the header of the Interlab files but will detect the actually used encoding by inspecting Interlab files on a byte level. This approach is more reliable since the actual encoding of a file might easily change while the header of the Interlab file is probably not changed accordingly.

Redbex supports Interlab files in UTF-8 (with or without BOM), UTF-16 or UTF-32 encoding (both little-endian and big-endian).

Line

While not specified in the Interlab standard Redbex defines a line in an Interlab file as a sequence of characters followed by a line feed character (U+000A, UTF-8: 0x0A, typical for Unix, Linux, Android, Mac OS X, BSD, and other operating systems), a carriage return (U+000D, UTF-8: 0x0D typical for Mac OS till Version 9 and other operating systems), or a carriage return immediately followed by a line feed (typical for Windows operating systems).

Trimming lines

When reading Interlab files Redbex will ignore leading and trailing white space characters of each line in the file. White space characters are defined as shown in table 1.

Empty lines

When reading Interlab files Redbex will always skip any empty lines or lines that contain only white space characters (see table 1).

Class

Members

Space Separators

SPACE (U+0020), OGHAM SPACE MARK (U+1680), MONGOLIAN VOWEL SEPARATOR (U+180E), EN QUAD (U+2000), EM QUAD (U+2001), EN SPACE (U+2002), EM SPACE (U+2003), THREE-PER-EM SPACE (U+2004), FOUR-PER-EM SPACE (U+2005), SIX-PER-EM SPACE (U+2006), FIGURE SPACE (U+2007), PUNCTUATION SPACE (U+2008), THIN SPACE (U+2009), HAIR SPACE (U+200A), NARROW NO-BREAK SPACE (U+202F), MEDIUM MATHEMATICAL SPACE (U+205F), and IDEOGRAPHIC SPACE (U+3000)

Line Separator

LINE SEPARATOR character (U+2028)

Other

CHARACTER TABULATION (U+0009), LINE FEED (U+000A), LINE TABULATION (U+000B), FORM FEED (U+000C), CARRIAGE RETURN (U+000D), NEXT LINE (U+0085), and NO-BREAK SPACE (U+00A0).

Table 1: White space characters

Comment lines

The Interlab standard does not specify a possibility to add comments to an Interlab file. Deviating from the standard Redbex will interpret every line starting with a $ character as a comment line, and will therefore not parse this line.

Control sequences

Interlab files contain control sequences that advice the reading software product on how to read and interpret the data in the Interlab file. Control sequences always start with a # character followed by a sequence of characters. Control sequences are case insensitive.

Header

An Interlab file always contains a header. The header is a series of control sequences starting with the #interlab control sequence and ending at the first #provadm control sequence.

Data section

A data section consists of a provadm section and a provdat section. A valid data section must always have a provadm and a provdat section, one Interlab file may have multiple data sections. each provadm and provdat section contains one header line, and one or more data lines.

Each line is a sequence of semicolon separated cells of data. According to the Interlab standard the last data cell must also be terminated by a semicolon. Redbex will determine if the last cell is terminated by a semicolon by inspecting the first data line in the first provadm section of the file.

The first line in a provdat or provadm section is the header line, all following lines are data lines. The header line specifies which kind of data is to be found in the cells of the following lines. The type of data is specified in header lines by using strings that are defined in the Interlab standard. Redbex compares these strings case insensitive.

The number of data cells in the header line must match the number of data cells in each data line.

A provadm section starts with the #provadm control sequence a provdat section starts with the #provdat control sequence. The provadm section ends with the #provdat control sequence. The provdat section ends with the #provadm section of the next data section or with the #slut control sequence.

Semantic aspects

Feature name

Interlab uses the Lablittera cell to give each sample a unique id, however multiple samples may belong to the same Redbex feature, this association of sample IDs to features is not defined in the Interlab format. To still be able to import data from Interlab to Redbex, Redbex therefore uses the Specific provplats cell. This cell is optional according to the Interlab standard but Redbex defines it a mandatory and each line in provadm sections must have a non empty Specific provplats cell.

Null

Empty cells are considered as null. Cells containing only a single dash - are also considered as null cells.

Mapping of sample types to feature types

The data in Interlab formats is imported into features of different types according to the value of the provtyp cell in the provadm section setting. Table 1 shows the mapping of provtyp to feature types that is used by the import. The import settings allow you to add additional provtyp identifiers for each supported feature type.

Provtyp

Feature type

Avloppsvatten

Dricksvatten

Grundvatten

Ytvatten

Dagvatten/dräneringsvatten

Lakvatten

Länshållningsvatten

Processvatten

Spolvatten

Släckvatten

Tunnelavloppsvatten

Water analysis

Sediment

Slam

Jord

Bergkross

Asfalt

Betong

Sulfidjord

Industri och gruvslagg

Soil analysis

Porgas

Övrig luft

Air Analysis

Table 2: Mapping of provtypes to feature types

Import settings

Setting

Description

Coordinate system

Interlab files do not contain spatial information, however this setting can be used to create new features with the right spatial reference system

Create classification elements

If set the import will try to create missing classification elements.

Note that this is only possible if the user executing the import has appropriate permissions and if a classification is set as





Table 3: Settings of the import type Interlab

© 2021 AFRY Austria GmbH, www.redbex.com