- Python >= 3.7.1
- GNU make - A command line gnu make process (Windows users can use cygwin - make comes built in on a Mac)
- pip - comes with most python distros - you should be ok
- virtualenv - can be added via
pip install virtualenv
- pipenv - can be added via
pip install pipenv
This is a GitHub template for a LinkML based projects.
It allows you to create a project for your schema as quickly as possible. It takes care of generating a beautiful readthedocs themed site, as well as downstream artefacts, including:
- JSON-Schema
- ShEx
- OWL
- RDF (direct mapping)
- JSON-LD Contexts
- SQL DDL (TODO)
- Python classes to represent model elements
- TSV/CSV reports (TODO)
-
Click the big green "Use this template" button on this page
-
Name your repo according to your schema, e.g. my-awsome-project-model, and clone it
-
Edit
model/CONFIG.yaml
to set your specific parameters. The details on the parameters can be found in the LinkML Template Configuration Model directory. (Note that the Template Configuration Model was built using this very template.) -
Configure the repository:
make -f MakeConfig reset
This will generate a number of files that can be used to make, test, and distribute your final model. Note that the template-configurator only needs to be run once as a rule. You can, however, re-generate all of the target artifacts with
make -f MakeConfig reset
. You can also selectively remove artifacts and get them regenerated withmake -f MakeConfig update
-
Rename the schema file in model/schema to match the
root_schema
named in the CONFIG.yaml file.
Note:root_schema
does not have the.yaml
suffix, the file does. As an example, if you specifiedroot_schema: my-schema
, the schema would be named model/schema/my-schema.yaml -
Edit the root_schema to add your own types, classes and slots.
-
Type
make
to build your downstream artefacts (jsonschema, owl, etc) -
Once satisfied, commit your new project to github, which will rerun the make process.
-
The package can also be uploaded to the
Python Package Index (PyPI)
for installation withpip
- this is an advanced topic, see PYPI_SETUP for details -
This file (ABOUT.md) and the
images
directory can be removed once you are satisfied
This repo is a GitHub "template" repo. When you "Use this template" it will make a copy for your project.
Everything is orchestrated by a generic single Makefile. For this to work you should follow certain conventions:
- Keep your schema in src/schema
- Use the
.yaml
suffix for all schema files - Use the suggested directory layout here.
To run the Makefile you will need Python (>=3.7):