Skip to content

Semantic validation collision: is_a in ClassDerivation rejects target schema class names #219

@amc-corey-cox

Description

@amc-corey-cox

Summary

ClassDerivation.is_a is defined in transformer_model.yaml with range: ElementDerivation (i.e., it points to another derivation in the spec), but example specs and likely user expectations use it to mean "the derived target class `is_a` a class in the target schema."

Discovery

Surfaced while testing linkml-map against linkml 1.11.0rc3. The personinfo-to-agent.transform.yaml example failed semantic validation:

```
$.class_derivations[2].is_a: 'Entity' is not valid under any of the given schemas
```

The example:

```yaml
class_derivations:
Agent:
is_a: Entity # 'Entity' is a class in the target schema
populated_from: Person
```

The model (`src/linkml_map/datamodel/transformer_model.yaml:189-191`):

```yaml
is_a:
range: ElementDerivation
slot_uri: linkml:is_a
```

linkml 1.10 was lenient enough to accept the example; 1.11rc3's tighter any_of resolution rejects it. The semantic validation feature added in #207 is what now enforces this contract — the example presumably loaded fine before #207 landed.

The semantic question

is_a here has two plausible meanings:

  1. Spec-internal inheritance — "this ClassDerivation derives from another ClassDerivation in this spec" (matches the model)
  2. Target-schema inheritance — "the synthesized target class `is_a` `Entity` in the target schema" (matches the example, and arguably matches LinkML convention, since is_a in plain LinkML schemas references target classes)

Options

  • A. Widen the model: allow target schema class names in is_a. Either change `range:` to a union of `ElementDerivation` and string, or relax the validator to accept either.
  • B. Narrow to the model: keep `range: ElementDerivation`, fix the example, document is_a as spec-internal-only.
  • C. Dual-meaning: validator resolves as derivation first, falls back to target schema class lookup. Most permissive but requires the validator to know the target schema.

This is a design call, not a quick fix.

Related

Needed for

v0.5.3 release. The existing example must validate cleanly before we ship 0.5.3 against the linkml GA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions