Skip to content

Latest commit

 

History

History
221 lines (177 loc) · 4.5 KB

Common-FCA-File-Formats-for-Formal-Contexts.org

File metadata and controls

221 lines (177 loc) · 4.5 KB

Supported File Formats for Formal Contexts

The aim of this page is to present and discuss commonly used file formats in FCA software. It may also serve as a platform to design new formats not yet implemented in any program.

Burmeister Format

This file format is the file format of Burmeisters ConImp, and is supported by a number of programs. It is easily recognizable, human readable and small.

Burmeister’s format is supported by ConImp, ConExp, conexp-clj.

Structure

The file format is structured as follows:

  • the first line consists of a single B
  • the second line contains the name of the context (note that some programs ignore this)
  • the third and fourth line consist of the object and attribute count, respectively
  • the fifth line is empty or contains a comment
  • after that, all objects and all attributes are listed, each on a separate line
  • finally, the context is given as a combination of . and X, each row on a separate line.

There are no restrictions on the context.

Example

B
name
2
2

a
b
1
2
.X
XX

corresponds to the context

   | 1  2
---+------
 a | .  X 
 b | X  X

Colibri

Example

a: 1
b: 1,2

ConExp

Example

<?xml version="1.0" encoding="UTF-8"?>
<ConceptualSystem>
  <Version MajorNumber="1" MinorNumber="0"/>
  <Contexts>
    <Context Type="Binary" Identifier="0">
      <Attributes>
        <Attribute Identifier="1">
          <Name>2</Name>
        </Attribute>
        <Attribute Identifier="0">
          <Name>1</Name>
        </Attribute>
      </Attributes>
      <Objects>
        <Object>
          <Name>a</Name>
          <Intent>
            <HasAttribute AttributeIdentifier="1"/>
          </Intent>
        </Object>
        <Object>
          <Name>b</Name>
          <Intent>
             <HasAttribute AttributeIdentifier="0"/>
             <HasAttribute AttributeIdentifier="1"/>
          </Intent>
        </Object>
      </Objects>
    </Context>
  </Contexts>
</ConceptualSystem>

corresponds to the context

   | 1 2 
---+-----
 a | . x
 b | x x

CSV

Example

a,2
b,1
b,2

FIMI

Used by Galicia and Galicia2.

Example

<Galicia_Document>
  <BinaryContext numberObj="2" numberAtt="2">
    <Name>Context</Name>
    <Object>a</Object>
    <Object>b</Object>
    <Attribute>1</Attribute>
    <Attribute>2</Attribute>
    <BinRel idxO="0" idxA="1"></BinRel>
    <BinRel idxO="1" idxA="0"></BinRel>
    <BinRel idxO="1" idxA="1"></BinRel>
  </BinaryContext>
</Galicia_Document>

Anonymous Burmeister

This file format is specific to conexp-clj and it’s main purpose is to provide some idea of an unrestricted anonymous format for formal contexts. Essentially, one leaves out in the Burmeister format the name of the context, the names of the objects, and the names of the attributes.

Example

A
3
2
.X
XX
.X

FCALGS

Example

2
1 2

Python Pandas

Pandas is a python framework to manage tabular data structures and is often used in data analysis. A common I/O format of conexp-clj and pandas is CSV and Named-CSV.

Example

context

   | 1 2 
---+-----
 a | . x
 b | x x

Named-Binary-CSV format

objects,1,2 
a,0,1
b,1,1

Conexp-clj I/O

(write-context :named-binary-csv context "path/to/context.csv")
(read-context "path/to/context.csv" :named-binary-csv)
context = pandas.read_table("path/to/context.csv",index_col=0,delimiter=",")
context.to_csv("path/to/context.csv")

JSON

The detailed structure of the json format is given at context_schema_v1.0.json.

Example

{
  "formal_context":[
    {
      "object":"a",
      "attributes":[2]
    },
    {
      "object":"b",
      "attributes":[1,2]
    }
  ]
}

There are also formats for lattices (lattice_schema_v1.0.json), implication sets (implications_schema_v1.0.json) and an fca (fca_schema_v1.0.json) that can contain all context, lattice and implication sets.