# T-BOX MIGRATION TO v2.0 — RENAME MAP AND STRUCTURAL OPERATIONS # ============================================================================= # Data consumed by migrate_tbox_v2_0.py. Kept separate from the script so that # the transformation is reviewable without reading code (EV-004). # # Not listed here and derived from other sources at run time: # - isAbstract declarations -> rules.yaml, annex `abstractness` # - shortLabel and acronym -> rules.yaml, annex `display` # - deprecated terms to drop -> found in the graph by owl:deprecated true # Deriving them keeps a single source of truth for each fact (EV-008). # ============================================================================= meta: from_version: "1.6" to_version: "2.0" namespace: "https://ontology.pernod-ricard.com/metamodel/" # ----------------------------------------------------------------------------- # RENAMES — 48. Applied everywhere the identifier appears: subject, predicate, # object. Nothing cascades in RDF (EV-001). # # `order` is a migration constraint, not a preference: # 1 ordinary terms # 2 terms named in SHACL shapes or SPARQL constraints # 3 the four attributes borne by MetaModelObject, therefore by every subject # ----------------------------------------------------------------------------- renames: # --- classes - {from: SubDomain, to: DataSubDomain, kind: class, order: 1} - {from: SubDomainOwner, to: DataSubDomainOwner, kind: class, order: 1} - {from: KPI, to: KeyPerformanceIndicator, kind: class, order: 1} - {from: BIWorkspace, to: BusinessIntelligenceWorkspace, kind: class, order: 1} - {from: BIDataSource, to: BusinessIntelligenceDataSource, kind: class, order: 1} - {from: BIField, to: BusinessIntelligenceField, kind: class, order: 1} - {from: BIReport, to: BusinessIntelligenceReport, kind: class, order: 1} # --- individual - {from: BITool, to: BusinessIntelligenceTool, kind: individual, order: 1} # --- relations - {from: hasDGL, to: hasGovernanceLead, kind: relation, order: 1} - {from: aboutConcept, to: isAbout, kind: relation, order: 1} - {from: primaryLocation, to: primarilyStoredIn, kind: relation, order: 1} - {from: inDatabase, to: isInDatabase, kind: relation, order: 1} - {from: inSchema, to: isInSchema, kind: relation, order: 1} - {from: inWorkspace, to: isInBIWorkspace, kind: relation, order: 1} - {from: inBIDataSource, to: isInBIDataSource, kind: relation, order: 1} - {from: hasBIField, to: containsBIField, kind: relation, order: 1} - {from: hasBIOwner, to: hasPublisher, kind: relation, order: 1} - {from: fromField, to: referencesSourceField, kind: relation, order: 1} - {from: toField, to: referencesTargetField, kind: relation, order: 1} - {from: biDerivedFrom, to: derivedFromSourceField, kind: relation, order: 1} - {from: owningDomain, to: ownedByDomain, kind: relation, order: 2} # --- attributes - {from: hasBusinessDefinition, to: businessDefinition, kind: attribute, order: 1} - {from: hasTechnicalDefinition, to: technicalDefinition, kind: attribute, order: 1} - {from: hasSynonym, to: synonym, kind: attribute, order: 1} - {from: hasFormula, to: formula, kind: attribute, order: 1} - {from: hasUnit, to: unit, kind: attribute, order: 1} - {from: hasTimeAggregation, to: timeAggregation, kind: attribute, order: 1} - {from: hasFormat, to: logicalFormat, kind: attribute, order: 1} - {from: hasPhysicalDataType, to: physicalDataType, kind: attribute, order: 1} - {from: hasViewDefinition, to: viewDefinition, kind: attribute, order: 1} - {from: hasExpression, to: expression, kind: attribute, order: 1} - {from: hasBusinessRule, to: businessRule, kind: attribute, order: 1} - {from: hasExampleValue, to: exampleValue, kind: attribute, order: 1} - {from: createdOn, to: creationDate, kind: attribute, order: 1} - {from: lastReviewedOn, to: lastReviewDate, kind: attribute, order: 1} - {from: harvestedOn, to: harvestDate, kind: attribute, order: 1} - {from: lastQueriedOn, to: lastQueryDate, kind: attribute, order: 1} - {from: definedBy, to: definitionAddress, kind: attribute, order: 1} - {from: queryCount30d, to: queryCount, kind: attribute, order: 1} - {from: hasShortLabel, to: shortLabel, kind: annotation, order: 2} - {from: hasAcronym, to: acronym, kind: annotation, order: 2} - {from: hasIdentifier, to: identifier, kind: attribute, order: 3} - {from: hasName, to: canonicalName, kind: attribute, order: 3} - {from: hasStatus, to: status, kind: attribute, order: 3} - {from: hasVersion, to: version, kind: attribute, order: 3} # --- relations that change nature (TN-016): object property -> datatype property - {from: hasActivationStatus, to: activationStatus, kind: relation_to_attribute, order: 1} - {from: deployedIn, to: environment, kind: relation_to_attribute, order: 1} # ----------------------------------------------------------------------------- # MERGES — the source identifier disappears into an existing target. # Unlike a rename, the target already exists and keeps its own declaration. # ----------------------------------------------------------------------------- merges: - from: biConsumes into: consumes widen_domain: true reason: > Same verb, same target, identical meaning. The domain widens and scope is controlled per class by SHACL. Ranges are compatible, so no RDFS retyping is introduced (TN-028). # ----------------------------------------------------------------------------- # STRUCTURAL OPERATIONS # ----------------------------------------------------------------------------- structural: reclassify: - {term: shortLabel, from: DatatypeProperty, to: AnnotationProperty, rule: TN-003} - {term: acronym, from: DatatypeProperty, to: AnnotationProperty, rule: TN-003} create_classes: - term: GovernanceLayerObject parent: MetaModelObject is_abstract: true label: Governance Layer Object comment: > Root of the governance layer. Holds the actors and governance objects that are not data objects and therefore sit outside the data layers. Created by insertion above Actor rather than by renaming it, so that every range pointing at Actor keeps stating the nature of its target rather than its position in the model. rule: TN-027 reparent: - {term: Actor, parent: GovernanceLayerObject, rule: TN-027} - {term: PhysicalLayerObject, parent: MetaModelObject, rule: TN-027} subproperties: - {term: primarilyStoredIn, parent: storedIn, rule: TN-028} # TN-016: closed governance states become literals. The classes and their # individuals are withdrawn, and the properties become datatype properties. to_literal: - property: activationStatus domain: DataDomain drop_class: ActivationStatus drop_individuals: [NotActivated, LightActivation, FullActivation] value_map: NotActivated: NOT_ACTIVATED LightActivation: LIGHT_ACTIVATION FullActivation: FULL_ACTIVATION - property: environment domain: CapturedObject drop_class: Environment drop_individuals: [Development, UserAcceptance, Production] value_map: Development: DEVELOPMENT UserAcceptance: USER_ACCEPTANCE Production: PRODUCTION # Phase clause: before v2.0 is published the project is in design, so # deprecated terms are removed outright rather than kept as stubs. EV-002 # still applies — the count must be zero. drop_deprecated: true