From a42a659f08ec1710040d7d38495c331da1d60a32 Mon Sep 17 00:00:00 2001 From: noelmcloughlin Date: Sat, 31 Oct 2026 22:50:23 +0000 Subject: [PATCH] fix: gen-project uses owl config in config.yaml Signed-off-by: noelmcloughlin --- CHANGELOG.md | 5 +++++ template/config.public.mk.jinja | 5 ----- template/justfile | 6 ------ tests/test_integration.py | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da48e0b..b6a0b3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ The format is inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0 [Full changelog](https://github.com/linkml/linkml-project-copier/compare/v0.5.0...main) +### Fixed + +- `just gen-project` no longer overwrites the OWL that `config.yaml` configures. + `LINKML_GENERATORS_OWL_ARGS` is gone; set OWL options in `config.yaml`. + ## Release [0.5.0] - 2026-05-27 [Full changelog](https://github.com/linkml/linkml-project-copier/compare/v0.4.2...v0.5.0) diff --git a/template/config.public.mk.jinja b/template/config.public.mk.jinja index 96ae54a..22d86e9 100644 --- a/template/config.public.mk.jinja +++ b/template/config.public.mk.jinja @@ -19,11 +19,6 @@ LINKML_GENERATORS_CONFIG_YAML=config.yaml ## pass args if gendoc ignores config.yaml (i.e. --no-mergeimports) LINKML_GENERATORS_DOC_ARGS= -## pass args to workaround genowl rdfs config bug (linkml#1453) -## (i.e. --no-type-objects --no-metaclasses --metadata-profile=rdfs) -# LINKML_GENERATORS_OWL_ARGS="--no-type-objects --no-metaclasses --metadata-profile=rdfs" -LINKML_GENERATORS_OWL_ARGS= - ## pass args to pydantic generator which isn't supported by gen-project ## https://github.com/linkml/linkml/issues/2537 LINKML_GENERATORS_PYDANTIC_ARGS= diff --git a/template/justfile b/template/justfile index 475d59d..c048b27 100644 --- a/template/justfile +++ b/template/justfile @@ -31,7 +31,6 @@ config_yaml := if env_var_or_default("LINKML_GENERATORS_CONFIG_YAML", "") != "" } gen_doc_args := env_var_or_default("LINKML_GENERATORS_DOC_ARGS", "") gen_java_args := env_var_or_default("LINKML_GENERATORS_JAVA_ARGS", "") -gen_owl_args := env_var_or_default("LINKML_GENERATORS_OWL_ARGS", "") gen_pydantic_args := env_var_or_default("LINKML_GENERATORS_PYDANTIC_ARGS", "") gen_ts_args := env_var_or_default("LINKML_GENERATORS_TYPESCRIPT_ARGS", "") @@ -150,11 +149,6 @@ gen-project: fi uv run gen-typescript {{gen_ts_args}} {{source_schema_path}} > {{dest}}/typescript/{{schema_name}}.ts - @if [ ! -d "{{dest}}/owl" ]; then \ - mkdir -p {{dest}}/owl ; \ - fi - uv run gen-owl {{gen_owl_args}} {{source_schema_path}} > "{{dest}}/owl/{{schema_name}}.owl.ttl" - # ============== Migrations recipes for Copier ============== # Hidden command to adjust the directory layout on upgrading a project diff --git a/tests/test_integration.py b/tests/test_integration.py index ab55aab..d2e77fe 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -80,3 +80,18 @@ def test_just_gen_doc(integration_project): assert result.returncode == 0, ( f"just gen-doc failed:\nstdout: {result.stdout}\nstderr: {result.stderr}" ) + + +def test_just_gen_project_owl_follows_config(integration_project): + """The OWL file holds what config.yaml's owl section asks for.""" + result = run_just(integration_project, "gen-project") + assert result.returncode == 0, ( + f"just gen-project failed:\nstdout: {result.stdout}\nstderr: {result.stderr}" + ) + owl = (integration_project / "project" / "owl" / "test_schema.owl.ttl").read_text( + encoding="utf-8" + ) + # add_root_classes: true makes each class a subclass of linkml:ClassDefinition. + assert "linkml:ClassDefinition" in owl + # gen-project names the ontology by the schema's id, without a file suffix. + assert ".owl.ttl>" not in owl