ome-xml  5.2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ome::xml::OMETransformResolver Class Reference

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 >, Qualitytransform_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< OMETransformResolverImplimpl
 Private implementation details.
 

Detailed Description

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.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

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.

Parameters
transformdirthe directory containing the XSL transform files.

References impl.

Member Function Documentation

std::string ome::xml::OMETransformResolver::quality_name ( OMETransformResolver::Quality  quality)
static

Get the name associated with a Quality enumeration.

Parameters
qualitythe Quality enumeration.
Returns
a string representation of the Quality enumeration.

References EXCELLENT, FAIR, GOOD, and POOR.

Referenced by ome::xml::operator<<(), and transform_order().

+ Here is the caller graph for this function:

std::set< std::string > ome::xml::OMETransformResolver::schema_versions ( ) const

Get the available schema versions for transformation.

Returns
all schema versions found as a source or target for a transform.

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.

Parameters
sourcethe source schema version.
targetthe target schema version.
Returns
a vector of Transform objects in the order to apply, and an aggregate quality metric.

References FAIR, GOOD, impl, POOR, quality_name(), ome::xml::transform(), and ome::xml::OMETransformResolver::Transform::weight.

Referenced by ome::xml::transform().

+ Here is the caller graph for this function:

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.

Parameters
osthe stream to write the dot representation to.

References impl, and ome::xml::OMETransformResolver::Schema::name.


The documentation for this class was generated from the following files: