linkml_renderer.paths package

Submodules

linkml_renderer.paths.context module

class linkml_renderer.paths.context.Context(schemaview=None, source_path=None, target_path=<factory>)

Bases: object

” A context represents a particular state in traversing a tree of objects.

property current: Optional[PathComponent]

Current position in the path.

Return type

Optional[PathComponent]

Returns

property current_element_type: Union[ClassDefinition, EnumDefinition, TypeDefinition]
Return type

Union[ClassDefinition, EnumDefinition, TypeDefinition]

extend(slot=None, target_element=None)
Return type

Context

property in_collection: bool

True if the current element is in a collection.

Return type

bool

Returns

property in_object: bool
Return type

bool

property in_object_reference: bool
Return type

bool

index_extend(index, target_element=None)
Return type

Context

schemaview: SchemaView = None
set_root(root)

Set the root of the path.

Parameters

root (Union[str, ElementName]) –

Return type

None

Returns

source_path: ObjectPath = None
property source_path_str: str
Return type

str

property target_depth: int

The depth of the target path.

Return type

int

Returns

target_path: List
property target_path_str: str
Return type

str

class linkml_renderer.paths.context.ObjectPath(components=<factory>)

Bases: object

A path between the tree root of an object and a particular element.

append(component)

Append a path component to the path.

Parameters

component (PathComponent) –

Returns

components: List[PathComponent]
class linkml_renderer.paths.context.PathComponent(element_type, slot=None, index=None)

Bases: object

A path element.

element_type: ElementName

The type which the path component instantiates

index: Optional[Union[int, str]] = None

For multivalued slots, the index of the value

property root: bool

True if this is the root of the path

Return type

bool

slot: Optional[SlotDefinition] = None

The slot that points to the path component

linkml_renderer.paths.html_context module

class linkml_renderer.paths.html_context.HTMLContext(schemaview=None, source_path=None, target_path=<factory>, airium=None)

Bases: Context

A context for HTML rendering

airium: Airium = None
target_path: List[str]

Module contents