This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the NAMO (New Approach Methodology Ontology and Schema) project - a LinkML-based schema for modeling new approach methodologies in biomedical research. The project generates multiple representations (Python, Java, OWL, JSON Schema, etc.) from a single LinkML YAML schema definition.
# Generate all project artifacts (Python models, docs, etc.)
just gen-project
# Generate documentation only
just gen-doc
# Build complete site (project + docs)
just site
# Clean all generated files
just clean# Run all tests (schema, Python, examples)
just test
# Run linting on the schema
just lint
# Test schema generation only
just _test-schema
# Run Python unit tests
uv run python -m pytest
# Test with specific file
uv run python -m pytest tests/test_data.py# Install dependencies
just install
# Update LinkML to latest version
just _update-linkml
# Serve documentation locally for preview
just testdoc
# or directly:
uv run mkdocs serve# Deploy documentation to GitHub Pages
just deployThe source of truth is the LinkML schema at src/namo/schema/namo.yaml. All other representations are generated from this schema:
- Python datamodels: Generated into
src/namo/datamodel/(both standard and Pydantic versions) - Project artifacts: Generated into
project/directory (Java, OWL, JSON Schema, GraphQL, etc.) - Documentation: Generated into
docs/elements/from the schema
-
LinkML Schema (
src/namo/schema/namo.yaml): Defines the ontology structure with classes like:Dataset: Top-level container for model systems and studiesModelSystem: Abstract base for different model types (AnimalModel, CellLineModel, Organoid, etc.)Study: Research investigation with context, perturbations, endpointsNamedThing: Base class for identifiable entities
-
Build System: Uses
justcommand runner with recipes defined injustfile. Configuration is stored inconfig.public.mkfor environment variables. -
Testing Strategy:
- Schema validation tests ensure the LinkML schema is valid
- Python datamodel tests validate that example data loads correctly
- Example data in
tests/data/valid/andtests/data/invalid/directories
-
Documentation: MkDocs-based site with auto-generated schema documentation. Deployed to GitHub Pages.
- Schema name:
namo(defined inconfig.public.mk) - Python package:
namowith datamodels innamo.datamodel - Dependencies: Managed by
uv(seepyproject.tomlanduv.lock) - Python version: Requires Python >=3.9,<4.0
- Always edit the source schema at
src/namo/schema/namo.yaml- never edit generated files - The
project/directory contains generated artifacts that are git-ignored by default - Use
justcommands rather than running generators directly for consistency - The project uses
uvfor dependency management - always useuv runfor Python commands
- The
Termclass is used for ontology references throughout the schema - For single-valued Term attributes, use
inlined: trueto allow full Term objects in YAML - For multi-valued Term attributes, use
inlined_as_list: true(not justinlined: true) - Example data should include both
id(ontology CURIE) andname(human-readable label) for clarity
- Intrinsic properties belong directly on model classes (e.g., cell_types, organ_modeled on OrganOnChip)
- Relationship properties go in the
modelsattribute viaModelsRelationship(e.g., disease being modeled, phenotypes recapitulated) - This separation keeps the schema clean and allows rich annotation of model-disease relationships
When extending NAMModel subclasses:
- Focus on properties intrinsic to the model system itself
- Use appropriate ontology references (UBERON for anatomy, CL for cell types, etc.)
- Include both technical specifications and biological components
- Test with example YAML files that include full Term objects with id and name
- Run
just testafter schema changes to validate:- Schema generation works
- Python datamodels are created correctly
- Example YAML files validate against the schema
- Example files in
tests/data/valid/serve as both tests and documentation - Include comments in YAML examples to explain ontology term meanings