I/O Specification

A CLAMS app must be able to take a MMIF JSON as input as well as to return a MMIF JSON as output. MMIF is a JSON-based open source data format (with some JSON-LD components). For more details and discussions, please visit the MMIF website and the issue tracker.

To learn more about MMIF, please visit MMIF specification documentation.

mmif package

mmif-python PyPI package comes together with the installation of clams-python, and with it, you can use mmif python package.

import mmif
from mmif.serialize import Mmif
new_mmif = Mmif()
# this will fail because an empty MMIF will fail to validate under the MMIF JSON schema

Because API’s of the mmif package is well documented in the mmif-python website, we won’t go into more details here. Please refer to the website.

MMIF version and CLAMS apps

As some parts of clams-python implementation is relying on structure of MMIF, it is possible that a MMIF file of a specific version does not work with a CLAMS app that is based on a incompatible version of mmif-python.

As we saw in the above, when using Mmif class, the MMIF JSON string is automatically validated under the MMIF JSON schema (shipped with the mmif-python). So in most cases you don’t have to worry about the compatibility issue, but it is still important to understand the versioning scheme of MMIF + mmif-python and clams-python, because all clams-python distributions are depending on specific versions of mmif-python as a Python library.

import mmif
mmif.__specver__

And when an app targets a specific version, it means:

  1. The app can only process input MMIF files that are valid under the jsonschema of mmif-python version.

  2. The app will output MMIF files exactly versioned as the target version.

However, also take these into consideration

  1. Not all MMIF updates are about the jsonschema. That means, some MMIF versions share the same schema, hence the syntactic validation process can pass for differently versioned MMIF files.

  2. Changing jsonschema is actually a big change in MMIF, and we will try to avoid it as much as possible. When it’s unavoidable, we will release the new MMIF and mmif-python with the major version number incremented.

For more information on the relation between mmif-python versions and MMIF specification versions, or MMIF version compatibility, please take time to read our decision on the subject here. You can also find a table with all public clams-python packages and their target MMIF versions in the below. As we mentioned, developers don’t usually need to worry about MMIF versions.

Target Specification Versions

clams-python version

mmif-python version

Target MMIF Specification

1.2.1

1.0.13

1.0.4

1.2.0

1.0.13

1.0.4

1.1.6

1.0.13

1.0.4

1.1.5

1.0.11

1.0.4

1.1.4

1.0.11

1.0.4

1.1.3

1.0.10

1.0.2

1.1.2

1.0.9

1.1.0

1.1.1

1.0.8

1.0.0

1.1.0

1.0.8

1.0.0

1.0.9

1.0.8

1.0.0

1.0.8

1.0.8

1.0.0

1.0.7

1.0.6

1.0.0

1.0.6

1.0.6

1.0.0

1.0.5

1.0.5

1.0.0

1.0.4

1.0.4

1.0.0

1.0.3

1.0.1

1.0.0

1.0.2

1.0.1

1.0.0

1.0.1

1.0.1

1.0.0

1.0.0

1.0.0

0.5.0

0.6.3

0.5.2

0.5.0

0.6.2

0.5.2

0.5.0

0.6.1

0.5.2

0.5.0

0.6.0

0.5.1

0.5.0

0.5.3

0.4.8

0.4.2

0.5.2

0.4.6

0.4.0

0.5.1

0.4.6

0.4.0

0.5.0

0.4.5

0.4.0

0.4.4

0.4.5

0.4.0

0.4.3

0.4.4

0.4.0

0.4.2

0.4.2

0.4.0

0.4.1

0.4.1

0.4.0

0.4.0

0.4.1

0.4.0

0.3.0

0.3.5

0.3.1

0.2.4

0.3.3

0.3.1

0.2.3

0.3.1

0.3.0

0.2.2

0.3.1

0.3.0

0.2.1

0.3.0

0.3.0

0.2.0

0.2.2

0.2.1

0.1.8

0.2.2

0.2.1

0.1.7

0.2.2

0.2.1

0.1.6

0.2.1

0.2.1

0.1.5

0.2.1

0.2.1

0.1.4

0.2.1

0.2.1