Skip to content

elifesciences/validate-article-json

Repository files navigation

validate-article-json

api-raml json-schema validation for the article-json generated by the bot-lax-adaptor using Go.

Build

./manage.sh build

Usage

$ go run . -h
Usage of /tmp/go-build3486126079/b001/exe/validate-article-json:
  -article-json string
        path to an article-json file or directory
  -buffer-size int
        maximum number of article-json files to keep in memory at once (default 1000)
  -num-workers int
        number of workers (goroutines) to process the article-json files
        0 for number of cpu cores (default), -1 for unbounded
  -sample-size int
        number of article-json files to parse (default -1)
  -schema-root string
        path to api-raml schema root

For example:

$ time go run main.go --schema-root /path/to/api-raml/ --article-json /path/to/article-json/files/ --sample-size 10
VOR valid in	 182ms: article-json/elife-00031-v1.xml.json
VOR valid in	 424ms: article-json/elife-00048-v1.xml.json
VOR valid in	 382ms: article-json/elife-00003-v1.xml.json
VOR valid in	 421ms: article-json/elife-00005-v1.xml.json
VOR valid in	 464ms: article-json/elife-00012-v1.xml.json
VOR valid in	 472ms: article-json/elife-00007-v1.xml.json
VOR valid in	 483ms: article-json/elife-00011-v1.xml.json
VOR valid in	 524ms: article-json/elife-00047-v1.xml.json
VOR valid in	 587ms: article-json/elife-00036-v1.xml.json
VOR valid in	 640ms: article-json/elife-00013-v1.xml.json

articles:10, failures:0, workers:12, wall-time:680ms, cpu-time:4s, average:457ms

real	0m0.758s
user	0m4.969s
sys	0m0.181s

Licence

Copyright © 2024 eLife Sciences

Distributed under the GNU Affero General Public Licence, version 3.

About

api-raml json-schema validation for the article-json generated by the bot-lax-adaptor

Resources

License

Stars

Watchers

Forks

Packages

No packages published