This page documents the use of admin tools to load or remove map notes. This is used to take mapping notes from a legacy system and install them into the new environment. It can also be used as a generic means to attach arbitrary note information to mapped concepts for a map project. For example, this mechanism was used to load "legacy" information about specialists/leads and when concepts were mapped from the old Cartographer system.
Prerequisites
- MySQL database must already exist (e.g. "mappingservicedb").
- MySQL database connection parameters must be defined in the properties file specified by "run.config".
- Create/Update DB mojo must also have already run so that the database schema exists.
- A map project must exist with a refset id matching the data intended to be loaded
- Either create a map project and configure it properly
- Or import a map project
- Map records must exist already to which the notes will be attached.
- IMPORTANT: The Tomcat server must not be running while this is run, otherwise indexes can get corrupted.
Details
This tool is used to load or remove map notes from a pseudo RF2 file. This is a mechanism to migrate notes information from a legacy environment into the new environment. The expected format is in the style of an RF2 file with these fields (including a header line):
- id - a UUID based on refSetId, referencedComponentId, and annotation
- effectiveTime - publication date
- active - should always be 1, inactive notes not supported
- moduleId - ignored
- refSetId - must match the refset id of one of the configured and installed map projects.
- referencedComponentId - the note will be attached to the map record whose "conceptId" field matches this within the project specified by the refset id.
- fullySpecifiedName - ignored
- annotation - the note, and it may contain HTML.
Following are some details about the loader implementation:
Mojo: MapNoteRf2LoaderMojo.java (in admin/mojo/src/main/resources/java/org/ihtsdo/otf/mapping/mojo)
Project: admin/loader
Configuration Parameters
- A profile of "MapNotes" must be specified
- run.config - the standard configuration file specified as a -D parameter
- input.file - the input file specified as a -D parameter
- Map records with matching concept ids should exist within map projects that also share the refset id.
- If not, the notes are skipped.
Following are some details about the remover implementation:
Mojo: MapNoteRemoverMojo.java (in admin/mojo/src/main/resources/java/org/ihtsdo/otf/mapping/mojo)
Project: admin/remover
Configuration Parameters
- A profile of "MapNotes" must be specified
- run.config - the standard configuration file specified as a -D parameter
- refset.id - a comma-separated list of refset ids to remove map notes for specified as a -D parameter
- Map projects with these refset ids must exist.
Samples
Sample command line call of the admin tool to load map notes from an RF2 file:
% cd ~/code/admin/loader % mvn install -Drun.config=/home/ihtsdo/config/config.properties -PMapNotes -Dinput.file=/home/ihtsdo/data/der2_sRefset_MapNotesSnapshot_INT_20140131.txt
Sample command line call of the admin tool to remove map notes for refsets 447563008 and 447562003:
% cd ~/code/admin/remover % mvn install -Drun.config=/home/ihtsdo/config/config.properties -PMapNotes -Drefset.id=447563008,447562003
Sample Eclipse run configuration to load map notes from an RF2 file:
Sample Eclipse run configuration to remove map notes for refsets 447563008 and 447562003:
Troubleshooting
If anything goes wrong loading map notes, they can be removed with the remover and simply reloaded.
References/Links
- n/a