linkml / linkml

Linked Open Data Modeling Language
https://linkml.io/linkml
Other
326 stars 101 forks source link

jsonschemagen: make include_range_class_descendants the default #1292

Closed kervel closed 1 year ago

kervel commented 1 year ago

Is your feature request related to a problem? Please describe.

in jsonschemagen (which is used by linkml-validate) there is an option include_range_class_descendants which enables the generation of one_of for all range class descendants, so that if you have a slot with another class as range, subclasses of the range class are also accepted as valid, which is something i guess one would assume to be the case always (liskov substitution principle)

there are some problems with the current feature however,

so this issue to track progress here and see what needs to be done.

cmungall commented 1 year ago
  1. I agree that being enabled by default is better. The reason this wasn't the case was conservatism, we couldn't be sure people were not relying on current behavior. But I think it is better to switch the default and make it easy for people to temporarily disable while they fix any underlying issues
  2. good analysis. It looks like we are now using anyOf?
  3. I am not sure this is a concern, no one should have ontology-style 1000 class taxonomies. But it would be good to check there are no unforeseen performance considerations when using a fairly deep taxonomy like biolink
cmungall commented 1 year ago

I'm closing as fixed by #1613