Skip to content

Latest commit

 

History

History
88 lines (51 loc) · 2.25 KB

File metadata and controls

88 lines (51 loc) · 2.25 KB

Schema.org JSON Schema Generator

Python script that generates a Draft 4 JSON Schema for HTML Microdata encoded in JSON using Schema.org vocabulary, which includes LRMI extensions.

Author

Jim Klo

What This Does

This project generates a rather large and monolithic JSON Schema by using the JSON version of the Schema.org vocabulary encoded into HTML Microdata in JSON. The result is then patched with some extensions for better validation of LRMI properties. The output of this script is `lrmi.json`.

Dependencies

jsonschema : a JSON Schema validation module.

jsonpatch : a JSON Patch module

Installation

I prefer to use virtualenv and I highly recommend you install and create a virtual python environment first and activated.

To install dependencies:

pip install jsonschema=1.3.0 jsonpatch==1.0

and then you're done.

Usage

$ ./make_lrmi_schema.py -h
usage: make_lrmi_schema.py [-h] [--regen] [--test]

optional arguments:
  -h, --help   show this help message and exit
  --regen, -r  regen schema
  --test, -t   test schema

License

Copyright 2013 SRI International

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.