Skip to content

Scala

Generate Scala classes, one file per class, enum and type.

Terminal window
ohi get w3c/prov-o
ohi linkml to scala --package org.example.prov \
--to src/org/example/prov/ prov-o.linkml.yaml
Try it in the playground, with PROV-O
error_handlingScalaErrorHandlingdefault annotation
CLI --error-handlingScala errorHandling

How the functions of the schema report their errors.

  • annotation Each error class gets an exception class, and the method is annotated with @throws for each of them.
  • either The method returns Either[E1 | E2, R], with the error classes themselves on the left. No exception classes are generated. A function with no errors returns R as it is.
generate_emit_prefixesbooleandefault true
CLI --generate-emit-prefixesScala generateEmitPrefixes

Whether to generate a Prefixes object with the schema's emit_prefixes.

metadata_languagestringdefault en
CLI --metadata-languageScala metadataLanguage

The language of the titles and descriptions in the output, for schemas with text in more than one language.

packagestringdefault eu.neverblink.linkml.metamodel
CLI --packageScala `package`

The package of the generated classes.

skip_leaf_interfacesbooleandefault true
CLI --skip-leaf-interfacesScala skipLeafInterfaces

Whether a concrete class that no other class extends with is_a or mixins becomes one case class, instead of an interface and an ...Impl case class. Turn it off when other code has to extend the generated classes.