Wiki

Clone wiki

jummp / Model identification scheme

Overview

Model identifiers are created dynamically, at runtime, based on the settings defined in the configuration file, thanks to implementations of the net.biomodels.jummp.core.model.identifier.generator.ModelIdentifierGenerator interface.

A generator relies on an ordered set of instances of the net.biomodels.jummp.core.model.identifier.decorator.ModelIdentifierDecorator interface, collectively called decorators. To make a new identifier, the generator simply calls each decorator and asks it to append a suffix.

Generators are stored in an instance of net.biomodels.jummp.core.model.identifier.generator.ModelIdentifierGeneratorRegistryService, which can be injected using the name identifierGeneratorRegistry. There needs to be at least one entry in the registry - the submissionIdGenerator, which is necessary for producing identifiers when a model is submitted. If a separate identifier is necessary when the model is published, then the publicationIdGenerator bean reference must be defined as well. In the future, the name of these references will be customisable.

Envisaged workflow for setting up model identifier generators

When the application starts, the configuration file is parsed and scanned for the block jummp.model.id. At a minimum, this should contain enough information(see below) to create the decorators for the submissionIdGenerator.

These settings are then processed by ModelIdentifierUtils and churned into a map of ModelIdentifierGenerator instances and corresponding names, which are passed to resources.groovy. This is where each dynamically-created generator is defined as a bean, turning it into a candidate for dependency injection inside the application.

Settings for Specifying Model Decorators and Generators

The following settings define a submission generator consisting of two parts: a constant string 'MODEL-' followed by a positive ten-digit number.

jummp.model.id.submission.part1.type=literal
jummp.model.id.submission.part1.suffix=MODEL-

jummp.model.id.submission.part2.type=numerical
jummp.model.id.submission.part2.fixed=false
jummp.model.id.submission.part2.width=10

The key of the jummp.model.id map, in this case submission, gives the name of the registered bean name - submissionIdGenerator. To define a publicationIdGenerator one would use

jummp.model.id.publication.part1=...

After the type of the generator is specified, the settings cover the order and properties of all its decorators. Note that the part numbers should be consecutive as they define the order in which the generator calls its decorators. The currently-defined decorators along with their corresponding options are listed below. Variable decorators should have the setting partN.fixed=false as the default is true. Please note that all settings below are relative to jummp.model.id.<generatorName>.

Fixed Numerical

partN.type=numerical
partN.suffix=<a positive integer> - the suffix to append
partN.width=<a positive integer> - pad suffix with 0s to reach the desired width

Variable Numerical

This decorator always starts from 1 and, if used in conjunction with a date decorator, is reset to the default value each time the latter changes.

partN.type=numerical
partN.width=<a positive integer> - pad suffix with 0s to reach the desired width
partN.fixed=false

Variable Date

partN.type=date
    partN.format=<URL-safe SimpleDateFormat string e.g. yyyymmdd>

Fixed Literal

    partN.type=literal
    partN.suffix=<URL-safe suffix string>

Checksum

Special type of decorator that appends a random string to the end of an identifier to deter potential attempts to access models with predictable identifiers to which the attacker does not have access to. This decorator is always the last one used by a generator. This decorator ignores the fixed property too.

useChecksum=true

Updated