Skip to content

Commit fe05f98

Browse files
Merge pull request #8 from linkml/enable-label-validation-by-default
feat: enable label validation by default
2 parents 0a63366 + 8bc2259 commit fe05f98

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ See the [examples/](examples/) directory for complete examples:
516516
```yaml
517517
"linkml_term_validator.plugins.BindingValidationPlugin":
518518
oak_adapter_string: "sqlite:obo:" # OAK adapter (default: sqlite:obo:)
519-
validate_labels: true # Check labels match ontology (default: false)
519+
validate_labels: true # Check labels match ontology (default: true)
520520
cache_labels: true # Enable label caching (default: true)
521521
cache_dir: cache # Cache directory (default: cache)
522522
oak_config_path: oak_config.yaml # Optional: custom OAK config

docs/binding-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ for result in report.results:
357357
|-----------|------|---------|-------------|
358358
| `oak_adapter_string` | `str` | `"sqlite:obo:"` | Default OAK adapter |
359359
| `oak_config_path` | `str \| None` | `None` | Path to OAK config file |
360-
| `validate_labels` | `bool` | `False` | Also validate labels |
360+
| `validate_labels` | `bool` | `True` | Also validate labels |
361361
| `strict` | `bool` | `True` | Fail when term IDs not found in configured ontologies |
362362
| `cache_labels` | `bool` | `True` | Enable file-based caching |
363363
| `cache_dir` | `str` | `"cache"` | Cache directory |

docs/plugin-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ from linkml_term_validator.plugins import BindingValidationPlugin
289289
plugin = BindingValidationPlugin(
290290
oak_adapter_string="sqlite:obo:",
291291
oak_config_path=None,
292-
validate_labels=False,
292+
validate_labels=True,
293293
cache_labels=True,
294294
cache_dir="cache",
295295
)
@@ -301,7 +301,7 @@ plugin = BindingValidationPlugin(
301301
|-----------|------|---------|-------------|
302302
| `oak_adapter_string` | `str` | `"sqlite:obo:"` | Default OAK adapter string for ontology access |
303303
| `oak_config_path` | `str \| None` | `None` | Path to `oak_config.yaml` for per-prefix adapter configuration |
304-
| `validate_labels` | `bool` | `False` | If `True`, also validate that labels match ontology canonical labels |
304+
| `validate_labels` | `bool` | `True` | If `True` (default), also validate that labels match ontology canonical labels |
305305
| `cache_labels` | `bool` | `True` | Enable file-based caching of ontology labels |
306306
| `cache_dir` | `str` | `"cache"` | Directory for cache files |
307307

src/linkml_term_validator/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ def validate_data(
171171
bool,
172172
typer.Option(
173173
"--labels/--no-labels",
174-
help="Validate labels match ontology",
174+
help="Validate labels match ontology (default: enabled)",
175175
),
176-
] = False,
176+
] = True,
177177
lenient: Annotated[
178178
bool,
179179
typer.Option(
@@ -406,7 +406,7 @@ def validate_all(
406406
target_class=None,
407407
validate_bindings=True,
408408
validate_dynamic_enums=True,
409-
validate_labels=False,
409+
validate_labels=True,
410410
lenient=lenient,
411411
adapter=adapter,
412412
cache_dir=cache_dir,

src/linkml_term_validator/plugins/binding_plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
>>> plugin.strict
1414
True
1515
>>> plugin.validate_labels
16-
False
16+
True
1717
>>> plugin.expanded_enums
1818
{}
1919
@@ -92,7 +92,7 @@ class BindingValidationPlugin(BaseOntologyPlugin):
9292
def __init__(
9393
self,
9494
oak_adapter_string: str = "sqlite:obo:",
95-
validate_labels: bool = False,
95+
validate_labels: bool = True,
9696
strict: bool = True,
9797
cache_labels: bool = True,
9898
cache_dir: Path | str = Path("cache"),
@@ -103,7 +103,7 @@ def __init__(
103103
104104
Args:
105105
oak_adapter_string: Default OAK adapter string (e.g., "sqlite:obo:")
106-
validate_labels: If True, also validate that labels match ontology
106+
validate_labels: If True (default), also validate that labels match ontology
107107
strict: If True (default), fail when term IDs are not found in configured ontologies
108108
cache_labels: Whether to cache ontology labels to disk
109109
cache_dir: Directory for label cache files

0 commit comments

Comments
 (0)