Last updated
Last updated
Metadata are generated on user's request. The Rest API is available for
Will return metadata in JSON format associated to the dataset.
If the POST request is with empty body, then metadata are generated from files included in dataset. If POST request is with non-empty body, this body is used to store dataset metadata (no operation is invoked to generate metadata from files)
Metadata are stored in MongoDB instance. Implementation of getting and creating/updating metadata associated to dataset id
is at org.cirmmp.spring.metadata.MetadataDB
class.
In order to harvest metadata from different files, there are common classes in package org.cirmmp.spring.metadata
:
MetadataGenerator
with harvestMetadata()
method which traverses over all files in dataset directory
interface AMetadataExtractor
with abstract harvestFile()
method
default extractor DefaultMetadataExtractor
which can handle JCAMPDX format, CBF format or text with binary format containing metadata in form of key = value
or key: values
or value1 value2 value3 ...
You need to implement interface AMetadataExtractor
and register the file extension in static part of MetadataGenerator. Each file extension needs separate line. E.g.we register "png" and "jpg" file extension with thes new metadata extractor as follows: