Add --ontology-file support for custom domain YAMLs#51
Open
unshDee wants to merge 3 commits into
Open
Conversation
Add --ontology-file to load a custom domain ontology YAML directly, matching the documented manual custom-domain workflow. Also allow saved custom domains to be loaded by domain id from the user custom-domains directory.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for loading custom domain ontologies from a file in the CLI and enhances domain loading to locate saved custom domains by the domain id declared in YAML (not just filename).
Changes:
- Add
--ontology-fileCLI option, including mutual exclusivity with--domain/--custom-domain. - Enhance
load_domain()to search the custom domains directory for YAML files whose declareddomain.idmatches the requested ID. - Add test coverage for the new CLI flag and custom-domain lookup behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_custom_domain.py | Adds test ensuring saved custom domain YAMLs can be loaded by declared domain.id. |
| tests/test_cli.py | Adds integration tests for --ontology-file, project-name auto-generation, and flag exclusivity. |
| src/create_context_graph/ontology.py | Extends load_domain() to search custom domain YAMLs by declared ID. |
| src/create_context_graph/cli.py | Adds --ontology-file flag, validation, and scaffolding behavior using a provided ontology YAML. |
| README.md | Documents the new --ontology-file CLI option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tual exclusivity in CLI
Comment on lines
+263
to
+266
| if ( | ||
| isinstance(candidate_data, dict) | ||
| and candidate_data.get("domain", {}).get("id") == domain_id | ||
| ): |
Comment on lines
+338
to
+340
| try: | ||
| custom_domain_yaml = ontology_file.read_text() | ||
| custom_ontology = load_domain_from_path(ontology_file) |
Comment on lines
+29
to
+30
| REPO_ROOT = Path(__file__).resolve().parents[1] | ||
| HEALTHCARE_ONTOLOGY = REPO_ROOT / "src" / "create_context_graph" / "domains" / "healthcare.yaml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for the documented
--ontology-fileCLI option so users can scaffold a project from an existing custom domain ontology YAML file (#50)This matches the manual custom-domain workflow described in the docs
Changes
--ontology-file FILEto the CLI.load_domain_from_path()helper.data/ontology.yaml.--domain,--ontology-file, and--custom-domainmutually exclusive.~/.create-context-graph/custom-domains/to be loaded by domain id.