Smee.Extract (Smee v0.6.0)

Copy Markdown View Source

Processes %Metadata{} structs to extract various information, usually using XSLT.

This module is intended to make common and relatively simple actions on potentially large XML files more efficiently than processing each %Entity{} struct in turn, and may rely on external tools such as xsltproc.

These functions are useful in quick reports or to speed-up the internal workings of other modules.

Summary

Functions

Returns a single %Entity{} struct extracted from the metadata, if present. Raises an exception if not present.

Returns a map of all unique metadata Entity Attributes and their values

Returns a list of all entity IDs in a Metadata struct.

Returns a list of maps containing MDUI information for each entity in the metadata file.

Functions

entity!(metadata, uri)

@spec entity!(metadata :: Smee.Metadata.t(), uri :: binary()) :: Smee.Entity.t()

Returns a single %Entity{} struct extracted from the metadata, if present. Raises an exception if not present.

list_entity_attrs(metadata)

@spec list_entity_attrs(metadata :: Smee.Metadata.t()) :: map()

Returns a map of all unique metadata Entity Attributes and their values

list_ids(metadata)

@spec list_ids(metadata :: Smee.Metadata.t()) :: [binary()]

Returns a list of all entity IDs in a Metadata struct.

mdui_info(metadata)

@spec mdui_info(metadata :: Smee.Metadata.t()) :: map()

Returns a list of maps containing MDUI information for each entity in the metadata file.