[INFO] Cleaning the mapping history - dbpedia/mappings-ui GitHub Wiki

Whenever a user modifies and save a mapping, or a new version is imported from a configured Github repository, a new version of the mapping is created, and the old one is archived. Users with proper permissions can later restore any version they want. But, as storage is limited, it may be the case that you want to delete some old archived mappings to free up space.

To do that, you have two alternatives:

  • Manually delete them using MongoDB queries (more flexible, more difficult)
  • Use the "cleanMappingHistory.js" to delete all the archived mappings, or only those that were created before a certain date (less flexible, easier).

Using the script

To use the script, follow these instructions:

  1. Make sure that dependencies are installed. If not, run npm install on the root of the project. (If the project is already running, for sure the dependencies are installed).
  2. Make sure config.js is modified according to your preferences. (If the project is already running, this will be done)
  3. Run the 'cleanMappingHistory.js' script located in the 'scripts' folder, using node.
  4. Ask the questions.

Using Mongo Queries

This option provides more flexibility, but you have to type manual queries into the DB console. You should work in the 'mappingsHistory' collection. The structure of a document is as follows:

  • _id: {template,lang,version}
  • rml
  • status : {error,message}
  • edition: {username,date,comment}
  • stats
  • deleted: boolean
  • deletion: {username,date}