Context formats

Mondher reads and writes five formats. The CLI auto-detects format from the file extension or content sniffing on the first bytes.

FormatExtensionNotes
Burmeister.cxtThe FCA standard. Plain-text, named objects and attributes.
CSV / TSV.csv, .tsvHeader row, one object per data row.
FIMI.datTransactional format from the FIMI benchmark repository.
FCA-XML.xmlLegacy XML used by ConExp and related tools.
Native JSON.jsonMondher's diff-friendly interchange format.

Burmeister .cxt

The de facto FCA standard. Plain text:

B

<n_objects>
<n_attributes>

<object names>
<attribute names>
<incidence rows: X = present, . = absent>

A 3×3 example:

B

3
3

bird
fish
dog
can-fly
swims
warm-blooded
X.X
.X.
..X

CSV / TSV

A header row of attribute names; one row per object. The first column is the object name; remaining columns are 0/1 (or false/true, or X/., or any of several truthy values).

,can-fly,swims,warm-blooded
bird,1,0,1
fish,0,1,0
dog,0,0,1

Mondher auto-detects the delimiter (comma vs tab) from the first line.

FIMI .dat

The transactional format used by the FIMI itemset-mining benchmark collection. One line per object; each line is the space-separated IDs of the attributes that object has.

0 2
1
2

No names. Mondher synthesizes g0, g1, ..., m0, m1, ... when it reads a FIMI file. Use CSV or .cxt if you need named objects.

FCA-XML

Legacy XML used by ConExp and other tools from the 2000s:

<ConceptualSystem>
  <Context>
    <Attributes>
      <Attribute Name="can-fly"/>
      ...
    </Attributes>
    <Objects>
      <Object>
        <Name>bird</Name>
        <Intent>
          <HasAttribute AttributeIdentifier="0"/>
          ...
        </Intent>
      </Object>
      ...
    </Objects>
  </Context>
</ConceptualSystem>

Verbose, but useful for interop with older datasets.

Native JSON

Mondher's own format, version-tagged and forward-compatible. Best for storing contexts as Git-tracked data.

{
  "mondher_version": "0.1.0",
  "context": {
    "objects": ["bird", "fish", "dog"],
    "attributes": ["can-fly", "swims", "warm-blooded"],
    "incidence": [[true, false, true], [false, true, false], [false, false, true]]
  }
}

Auto-detection

You never have to tell Mondher which format you're using — every subcommand calls the auto-detector. Extension first; content sniffing as fallback.