MetadataIndex
- class MetadataIndex
Description
Metadata usages by definition, built once by
build_metadata_index().Given the SysML:
package P { metadata def Tag; metadata def Sub :> Tag; part a { @Tag; } part b { @Sub; } }
and
tag = find_by_qualified_name(model, "P::Tag"):index = build_metadata_index(model) index.usages # @Tag on a, @Sub on b index.by_definition[tag] # @Tag on a index.by_definition_name["Sub"] # @Sub on b
by_definitionis keyed by the definition a usage is defined by, by identity;by_definition_nameby that definition’s simple name, so two definitions of the same name share a bucket.Inheritance:
Members defined in
MetadataIndex(5 members)RWRWRWThe deprecated
library_elementsthe index was built with, elseNone.RWThe tiers the index was built over;
Nonewhen it was built over the model’s own documents (the default build, a deprecatedlibrary_elementsbuild, or a hand-built index).RWAttributes
- by_definition: dict[syside.MetadataDefinition, list[syside.MetadataUsage]] = 'field(...)'
- by_definition_name: dict[str, list[syside.MetadataUsage]] = 'field(...)'
- library_elements: syside.query.LibraryElements | None = None
The deprecated
library_elementsthe index was built with, elseNone.
- tiers: frozenset[syside.DocumentTier] | None = None
The tiers the index was built over;
Nonewhen it was built over the model’s own documents (the default build, a deprecatedlibrary_elementsbuild, or a hand-built index).
- usages: list[syside.MetadataUsage] = 'field(...)'
Used by