ome-xml
5.2.0
|
Discover and query available OME-XML transforms. More...
#include <ome/xml/OMETransformResolver.h>
Classes | |
struct | Schema |
Metadata for a schema version. More... | |
struct | Transform |
Metadata for a schema transform between two schema versions. More... | |
Public Types | |
enum | Quality { POOR = 1000000LU, FAIR = 10000LU, GOOD = 100LU, EXCELLENT = 1LU } |
Transformation quality. More... | |
Public Member Functions | |
OMETransformResolver () | |
Default constructor. More... | |
OMETransformResolver (const boost::filesystem::path &transformdir) | |
Construct with specified transform directory. More... | |
~OMETransformResolver () | |
Destructor. | |
std::set< std::string > | schema_versions () const |
Get the available schema versions for transformation. More... | |
std::pair< std::vector< Transform >, Quality > | transform_order (const std::string &source, const std::string &target) const |
Determine the optimal transform order between schema versions. More... | |
void | write_graphviz (std::ostream &os) |
Write a GraphViz dot representation of the internal graph state. More... | |
Static Public Member Functions | |
static std::string | quality_name (OMETransformResolver::Quality quality) |
Get the name associated with a Quality enumeration. More... | |
Private Attributes | |
ome::compat::shared_ptr< OMETransformResolverImpl > | impl |
Private implementation details. | |
Discover and query available OME-XML transforms.
This class will find the available XSL transforms to convert between different OME-XML model versions, using either the installed schemas, or schemas in a specified directory.
In order to convert between different schema versions, one or more transforms will require applying. This class will determine the optimal set of transforms to apply for a given source and target model version, computed using a graph representation and shortest path algorithm.
Transformation quality.
Schema transforms may vary in quality. Upgrades are typically lossless and classed as "excellent", while downgrades may lose information due to the older schemas lacking the ability to represent metadata added in later schema versions. These quality levels are arbitrary classifications and weightings used to match the existing manually maintained transform lists used in the Java implementation.
Enumerator | |
---|---|
POOR |
Extreme data loss. |
FAIR |
Moderate data loss. |
GOOD |
Slight data loss. |
EXCELLENT |
No data loss. |
ome::xml::OMETransformResolver::OMETransformResolver | ( | ) |
Default constructor.
The transform directory used will be the default set at install time or in the environment.
References impl, ome::common::module_runtime_path(), and ome::xml::register_module_paths().
ome::xml::OMETransformResolver::OMETransformResolver | ( | const boost::filesystem::path & | transformdir | ) |
Construct with specified transform directory.
transformdir | the directory containing the XSL transform files. |
References impl.
|
static |
Get the name associated with a Quality enumeration.
quality | the Quality enumeration. |
References EXCELLENT, FAIR, GOOD, and POOR.
Referenced by ome::xml::operator<<(), and transform_order().
std::set< std::string > ome::xml::OMETransformResolver::schema_versions | ( | ) | const |
Get the available schema versions for transformation.
References impl.
std::pair< std::vector< OMETransformResolver::Transform >, OMETransformResolver::Quality > ome::xml::OMETransformResolver::transform_order | ( | const std::string & | source, |
const std::string & | target | ||
) | const |
Determine the optimal transform order between schema versions.
Run a shortest path search to determine the highest quality set of transforms between the two versions.
The returned quality metric is the sum of the quality metrics for all of the transforms, rounded down to the nearest quality value.
source | the source schema version. |
target | the target schema version. |
References FAIR, GOOD, impl, POOR, quality_name(), ome::xml::transform(), and ome::xml::OMETransformResolver::Transform::weight.
Referenced by ome::xml::transform().
void ome::xml::OMETransformResolver::write_graphviz | ( | std::ostream & | os | ) |
Write a GraphViz dot representation of the internal graph state.
Primarily intended for debugging and documentation.
os | the stream to write the dot representation to. |
References impl, and ome::xml::OMETransformResolver::Schema::name.