This directory contains source Jupyter notebook tutorials demonstrating linkml-term-validator usage.
CLI-Focused Tutorials (Recommended Starting Point):
-
01_getting_started.ipynb - CLI Basics with Success & Failure Examples
- Uses
%%bashcells for authentic CLI experience - Schema validation (valid and invalid cases)
- Dynamic enum validation
- Common CLI options (--verbose, --strict, --cache-dir)
- Learning from validation failures
- Uses
-
02_advanced_usage.ipynb - Advanced CLI Features & Troubleshooting
- Working with local OBO files (offline validation)
- Custom OAK configurations (oak_config.yaml)
- Binding validation with nested objects
- Advanced CLI flags (--labels, --no-dynamic-enums, --no-bindings)
- Troubleshooting common errors
Python API (For Programmatic Usage):
- 03_python_api.ipynb - Python Integration
- Using ValidationPlugin classes
- Combining multiple plugins
- Error handling and reporting
- Integration into data processing pipelines
Source notebooks (this directory) → Execute with papermill → Render to HTML → Display in docs
notebooks/ # Source (git-tracked)
├── 01_getting_started.ipynb
└── 02_advanced_usage.ipynb
notebooks/output/ # Executed notebooks (git-ignored)
├── 01_getting_started.ipynb
└── 02_advanced_usage.ipynb
docs/notebooks/ # Rendered HTML (git-ignored)
├── 01_getting_started.html
└── 02_advanced_usage.html
Execute notebooks and convert to HTML for mkdocs:
just render-notebooksThis runs papermill (to execute) then nbconvert (to generate HTML). The HTML files are displayed in the documentation.
Start Jupyter Lab for interactive development:
just jupyterRun all notebooks with papermill to test they execute without errors:
just run-notebooksRun a specific notebook:
just run-notebook 01_getting_started.ipynbRemove all generated outputs:
just clean-notebooksWe use pre-rendered HTML instead of mkdocs plugins because:
- ✅ Separation of concerns: Notebook execution (can fail) is separate from docs build (should always work)
- ✅ Fast mkdocs builds: Pre-rendered, mkdocs just copies HTML
- ✅ CI-friendly: Can fail on notebook execution errors separately
- ✅ Full Jupyter styling: nbconvert provides complete Jupyter Lab CSS
- ✅ No plugin limitations: HTML works naturally in mkdocs
Make sure you have linkml-term-validator installed:
pip install linkml-term-validator
# or
uv pip install linkml-term-validator# Install jupyter
pip install jupyter
# Navigate to the notebooks directory
cd notebooks
# Start Jupyter
jupyter notebook# Install jupyterlab
pip install jupyterlab
# Start JupyterLab
jupyter labVS Code has excellent Jupyter support:
- Install the Jupyter extension
- Open a
.ipynbfile - Select your Python kernel
- Run cells interactively
- The notebooks use temporary directories and clean up after themselves
- OAK adapter downloads may take time on first run (subsequent runs use cache)
- For offline use, see the "Working with Local OBO Files" section in the advanced tutorial