sbol3.toplevel

Module Contents

Classes

TopLevel

TopLevel is an abstract class that is extended by any Identified

Functions

make_erase_identity_traverser(→ Callable[[Identified], ...)

make_update_references_traverser(...)

class TopLevel(identity: str, type_uri: str, *, namespace: Optional[str] = None, attachments: Optional[refobj_list_arg] = None, name: Optional[str] = None, description: Optional[str] = None, derived_from: Optional[Union[str, Sequence[str]]] = None, generated_by: Optional[refobj_list_arg] = None, measures: Optional[ownedobj_list_arg] = None)

Bases: Identified

TopLevel is an abstract class that is extended by any Identified class that can be found at the top level of an SBOL document or file. In other words, TopLevel objects are not nested inside any other object via composite aggregation. Instead of nesting, composite TopLevel objects refer to subordinate TopLevel objects by their URIs using shared aggregation.

clone(new_identity: str = None) TopLevel
copy(target_doc=None, target_namespace=None)
static default_namespace(namespace: Union[None, str], identity: str) str
remove_from_document()
set_identity(new_identity: str) Any

Sets the identity of the object.

USE WITH EXTREME CAUTION!

This method can break a tree of objects, and invalid a document. Only use this method if you understand the ramifications of changing the identity of a top level object.

Parameters

new_identity – the new identity

Returns

Nothing

split_identity() tuple[str, str, str]

Split this object’s identity into three components: namespace, path, and display_id.

Returns

A tuple of namespace, path, and display_id

update_all_dependents(identity_map: dict[str, Identified]) Any

Update all dependent objects based on the provided identity map.

Dependent objects are reparented and references are updated according to the identities and objects in identity_map.

USE WITH CAUTION!

Parameters

identity_map – map of identity to Identified

Returns

Nothing

validate(report: ValidationReport = None) ValidationReport
validate_identity(report: ValidationReport) None
make_erase_identity_traverser(identity_map: Dict[str, Identified]) Callable[[Identified], None]
make_update_references_traverser(identity_map: Dict[str, Identified]) Callable[[Identified], None]