Assorted tips and best practices

IDE support for ontology authoring

If you are entering data in either YAML or JSON (YAML is recommended), then you can get IDE support (e.g. autocomplete on tag names)

  • Convert your schema to jsonschema using gen-schema
  • Load this into your IDE
  • When editing your yaml data file, set the schema

For info on how to do this with PyCharm see these slides

Provide rich documentation

LinkML provides a rich metamodel for providing metadata about your design pattern elements. You can provide provenance (e.g who authored it), status information, editor-level docs, end-user level docs, etc

See

Minimally, we recommend providing at least description fields for all slots and all classes

Validating data

We recommend validating:

  • input data, using linkml data validation
  • output owl ontologies, using robot
  • internal consistency of the schema (pattern templates)

If source data is managed in github, set up github actions to validate

See validating data in the main linkml guide

We recommend you constrain things as strictly as possible

  • For example, use enums for smaller value sets
  • Classes in your schema can be declared disjoint (note this is distinct from disjointness axioms for generated classes)
  • Declare ranges for all slots
  • Use pattern to constraint string values

Auto-filling in data

The linkml-owl framework does not provide extensive mechanisms for auto-filling data. Here auto-filling means:

  • assigning default values
  • assigning string fields based on format strings

These are considered separate concerns from mapping to OWL, and can be done upstream of linkml-owl, including in the linkml framework itself.

However, if you are using the jinja template generation route, you can also do a lot of auto-filling using jinja template logic