Local installation of the validator
Download the source code
The source code is freely available in google code.
You can checkout it from https://github.com/MICommunity/PSI-MI-Validator
Technologies and requirements
The validator framework was written in Java and uses Maven 2 as build system. The configuration of the framework is mostly done using XML files. To run the validator in command line the following requirements apply:
- Java 5 and higher
- Maven 2 (if you wish to take advantage of existing infrastructure)
Usage of pre-written scripts
Four pre-written scripts exist and need maven to run :
- validate-xml.sh : validation scope 'XML Syntax Only'
- validate-cv.sh : validation scope 'Controlled Vocabulary Usage'
- validate-mimix.sh : validation scope 'MIMIx'
- validate-imex.sh : validation scope 'IMEx'
These scripts need a file name or folder name as input. They will then validate the file if the input was a file name or validate recursively all the files with an extension 'xml' that the folder given in input contains. Each validator report is written in a file in the same directory of the validated file with a name report-filename.txt. For each script, the validator will only report the validator messages with a level superior or equal to WARN (WARN, ERROR and FATAL)
Example
./validate-mimix.sh directory
It will recursively validate all the files with the extension '.xml' in the folder 'directory' and write the validator report of each file in the appropriate folder.
./validate-mimix.sh file
It will validate all the file 'file' and write the validator report in the appropriate folder.
Maven command line
You can also directly run the command line :
mvn install -Pvalidate -Dfile=file -Dscope=scope -Dlevel=level -Dmaven.test.skip
- -Dfile: the option giving the file name or directory name
- -Dscope: the option giving the validation scope. It can be 'xml', 'cv', 'mimix' or 'imex'
- -Dlevel: the option giving the lowest message level for what the validator will keep the message in the repor. It can be 'DEBUG', 'INFO', 'WARN', 'ERROR' or 'FATAL'
Example
mvn install -Pvalidate -Dfile=file -Dscope=mimix -Dlevel=INFO -Dmaven.test.skip It will validate the file 'file' with the MIMIx rules and will only write in the report 'report-file.txt' the list of messages with a level INFO, WARN, ERROR or FATAL.
