YUML#

Generate yuml

https://yuml.me/diagram/scruffy/class/samples

class linkml.generators.yumlgen.YumlGenerator(schema: Union[str, TextIO, linkml_runtime.linkml_model.meta.SchemaDefinition, ForwardRef('Generator'), pathlib.Path], schemaview: Optional[linkml_runtime.utils.schemaview.SchemaView] = None, format: Optional[str] = None, metadata: bool = True, useuris: Optional[bool] = None, log_level: Optional[int] = 30, mergeimports: Optional[bool] = True, source_file_date: Optional[str] = None, source_file_size: Optional[int] = None, logger: Optional[logging.Logger] = None, verbose: Optional[bool] = None, output: Optional[str] = None, namespaces: Optional[linkml_runtime.utils.namespaces.Namespaces] = None, directory_output: bool = False, base_dir: str = None, metamodel_name_map: Dict[str, str] = None, importmap: Union[str, Mapping[str, str], NoneType] = None, emit_prefixes: Set[str] = <factory>, metamodel: linkml.utils.schemaloader.SchemaLoader = None, stacktrace: bool = False, include: Union[str, pathlib.Path, linkml_runtime.linkml_model.meta.SchemaDefinition, NoneType] = None, referenced: Optional[Set[linkml_runtime.linkml_model.meta.ClassDefinitionName]] = None, generated: Optional[Set[linkml_runtime.linkml_model.meta.ClassDefinitionName]] = None, box_generated: Optional[Set[linkml_runtime.linkml_model.meta.ClassDefinitionName]] = None, associations_generated: Optional[Set[linkml_runtime.linkml_model.meta.ClassDefinitionName]] = None, focus_classes: Optional[Set[linkml_runtime.linkml_model.meta.ClassDefinitionName]] = None, gen_classes: Optional[Set[linkml_runtime.linkml_model.meta.ClassDefinitionName]] = None, output_file_name: Optional[str] = None, classes: Set[linkml_runtime.linkml_model.meta.ClassDefinitionName] = None, directory: Optional[str] = None, diagram_name: Optional[str] = None, load_image: bool = True, **_kwargs)[source]#
associations_generated: Set[ClassDefinitionName] | None = None#
box_generated: Set[ClassDefinitionName] | None = None#
static cardinality(slot: SlotDefinition, is_attribute: bool = True) str[source]#
class_associations(cn: ClassDefinitionName, must_render: bool = False) str[source]#

Emit all associations for a focus class. If none are specified, all classes are generated

@param cn: Name of class to be emitted @param must_render: True means render even if this is a target (class is specifically requested) @return: YUML representation of the association

class_box(cn: ClassDefinitionName) str[source]#

Generate a box for the class. Populate its interior only if (a) it hasn’t previously been generated and (b) it appears in the gen_classes list

@param cn: @return:

classes: Set[ClassDefinitionName] = None#
diagram_name: str | None = None#
directory: str | None = None#
filtered_cls_slots(cn: ~linkml_runtime.linkml_model.meta.ClassDefinitionName, all_slots: bool = True, filtr: ~typing.Callable[[~linkml_runtime.linkml_model.meta.SlotDefinition], bool] = <function YumlGenerator.<lambda>>) List[SlotDefinition][source]#

Return the set of slots associated with the class that meet the filter criteria. Slots will be returned in defining order, with class slots returned last

@param cn: name of class to filter @param all_slots: True means include attributes @param filtr: Slot filter predicate @return: List of slot definitions

focus_classes: Set[ClassDefinitionName] | None = None#
gen_classes: Set[ClassDefinitionName] | None = None#
generated: Set[ClassDefinitionName] | None = None#
generatorname: ClassVar[str] = 'yumlgen.py'#

Name of the generator. Override with os.path.basename(__file__)

generatorversion: ClassVar[str] = '0.1.1'#

Version of the generator. Consider deprecating and instead use overall linkml version

load_image: bool = True#
output_file_name: str | None = None#
prop_modifier(cls: ClassDefinition, slot: SlotDefinition) str[source]#
Return the modifiers for the slot:

(i) - inherited (m) - inherited through mixin (a) - injected (pk) - primary ckey

@param cls: @param slot: @return:

referenced: Set[ClassDefinitionName] | None = None#
valid_formats: ClassVar[List[str]] = ['yuml', 'png', 'pdf', 'jpg', 'json', 'svg']#

Allowed formats - first format is default

visit_all_class_slots: ClassVar[bool] = False#

False means only visit own slots, True means visit all slots

Type:

Visitor ClassVar

visit_schema(classes: Set[ClassDefinitionName] = None, directory: str | None = None, diagram_name: str | None = None, load_image: bool = True, **_) str | None[source]#

Visited once at the beginning of generation

@param kwargs: Arguments passed through from CLI – implementation dependent