DataBrewery / cubes

[NOT MAINTAINED] Light-weight Python OLAP framework for multi-dimensional data analysis
http://cubes.databrewery.org
Other
1.49k stars 314 forks source link

Separate user-oriented metadata #398

Open Stiivi opened 7 years ago

Stiivi commented 7 years ago

Separate all user-oriented metadata from ModelObject into MetadataObjectDescription or MetadataObjectInfo.

Note: It is Metadata* not Model* because it will describe non-logical objects as well in the future.

Reasons for the change:

Attributes to be extracted into "info/description" structure:

Requirements

Storage and retrieval

There are two possibilities how we are going to store/retrieve the description: from a common catalog of metadata (currently the best place is Workspace, in the future it will be metadata repository) or from within the object graph (would be good temporary solution, to keep it easier).

Currently:

dimension: Dimension
label = dimension.label

# Localized:
context = LocalizationContext(..., locale="sk")
translation = context.object_localization("dimensions", dimension.name)
dimension = dimension.localized(translation)
label = dimension.label

Proposed temporary:

dimension: Dimension
label = dimension.description.label

Proposed metadata repository:

dimension: Dimension
mdr: MetadataRepository
label = mdr.description(dimension).label

# Localized:
label = mdr.description(dimension, locale="sk").label

EDIT: Changed the name of the metadata description object to MetadataObjectDescription/*Info (undecided). Added more detailed description of desired attributes. Added requirements.