The mint command
The mint
command allows replacing temporary identifiers with automatically generated permanent identifiers.
That command is not actually tied to KGCL in any way; it is provided as part of the KGCL plugin as a convenience.
Principle
The mint
command searches for all entities in the ontology that have an identifier in a given prefix (the “temporary” prefix), and generates new identifiers for such entities, ensuring along the way that all referencing axioms are properly re-wired to use the new identifiers.
The default “temporary” prefix is http://purl.obolibrary.org/temp#
. Another temporary prefix may be specified with the --temp-id-prefix
option.
How new identifiers are generated
New, permanent identifiers can be generated using two different modes.
Manual range mode
In this mode, the command will generate identifiers of the form prefixnum, where prefix is a user-specified IRI prefix and num is a numerical identifier picked sequentially within a given range.
This mode is controlled by the following options:
- --minted-id-prefix prefix
- Indicates the IRI prefix to use.
- --min-id num
- Indicates the lower bound (inclusive) of the range in which the numerical part of the identifiers should be picked.
- --max-id num
- Indicates the upper bound (exclusive) of the range. If this option is not specified, the default value is the value of
--min-id
+ 1000. - --pad-width num
- Indicates the number of digits in the numerical part of the identifiers to generate. The default value is 7.
When generating a new identifier, existing identifiers in the ontology are always checked to avoid inadvertently creating an identifier that is already in use.
Range-file based mode
This mode is similar to the “manual range mode“ above, except that the details about the range are provided by a ID range file, such as those automatically generated by the Ontology Development Kit and also used by the Protégé editor.
If your ontology uses such an ID range file, you can instruct the mint
command to use one of the ranges it defines with the following two options:
- --id-range-file file
- Indicates the name of the ID range file.
- --id-range-name name
- Indicates the name of the range to use. This should match the value of the
allocatedto
annotation of one of the ranges defined in the file.
If a range name is not explicitly specified, the mint
command will by default look for a range allocated to auto-minter
.
If a file with a name that ends with -idranges.owl
exists in the current working directory, and the manual mode has not been explicitly selected (with the ---minted-id-prefix
option), the mint
command will try to automatically use that file.
Other options
The behaviour of the mint
command can be altered by the following options:
- --keep-deprecated
- When this option is used, entities with the temporary identifiers are kept in the ontology, marked as deprecated, and annotated with a
replaced_by
annotation pointing to the new entity with the newly minted identifier. - --minted-from-property iri
- Indicates the IRI of an annotation property. When this option is used, the new entities are annotated with this property and a value pointing to the temporary identifier.