2 Commits

5 changed files with 110 additions and 556 deletions
+43 -14
View File
@@ -1,6 +1,6 @@
# Pernod Ricard Data MetaModel — T-Box Rulebook # Pernod Ricard Data MetaModel — T-Box Rulebook
**Version 1.1** — Draft for review — generated 2026-08-03 **Version 1.2** — Draft for review — generated 2026-08-03
> Generated from `rules.yaml`. Do not edit this document: edit the source and regenerate (EV-007, EV-008). > Generated from `rules.yaml`. Do not edit this document: edit the source and regenerate (EV-007, EV-008).
@@ -444,7 +444,7 @@ The label is derived, not authored. Anything a reader needs that the derivation
## TN-022 — The short label carries the spoken form ## TN-022 — The short label carries the spoken form
**Statement.** A term carries pr:shortLabel whenever the form derived under TN-018 is not what the organisation writes or says. The short label is free: acronyms, abbreviations, hyphens, short forms. **Statement.** A term carries pr:shortLabel ONLY where the form derived under TN-018 is not what the organisation writes or says. Where the two coincide, no short label is declared: a duplicate of the label carries no information and is one more thing to keep in step. The short label follows the casing of the label it replaces — title case for a class — and admits what the label cannot: acronyms, abbreviations, dropped words.
| | | | | |
|---|---| |---|---|
@@ -454,12 +454,13 @@ The label is derived, not authored. Anything a reader needs that the derivation
| Executor | `review checklist` | | Executor | `review checklist` |
| Procedure | _pending_ | | Procedure | _pending_ |
**Why.** The short label is what makes the derivation rule bearable. Without it, a mechanical label impoverishes every screen; with it, display becomes explicit and centrally governed instead of being improvised by each consumer. It is MAJOR rather than BLOCKING because judging whether a derived form matches what people actually say is human work, and EV-011 forbids declaring a rule blocking with no executor. **Why.** The short label is what makes the derivation rule bearable. Without it, a mechanical label impoverishes every screen; with it, display becomes explicit and centrally governed instead of being improvised by each consumer. Restricting it to the cases where it actually differs is what keeps it meaningful: a short label present on every term degenerates into a second copy of the label, drifting from it one entry at a time. It is MAJOR rather than BLOCKING because judging whether a derived form matches what people actually say is human work, and EV-011 forbids declaring a rule blocking with no executor.
| From | To | Note | | From | To | Note |
|---|---|---| |---|---|---|
| "Data Sub Domain Owner" | short label Sub Domain Owner | the word Data is dropped in the spoken form | | "Data Sub Domain Owner" | short label Sub Domain Owner | the word Data is dropped in the spoken form |
| "Key Performance Indicator" | short label KPI, acronym KPI | the acronym channel is what makes TN-002 bearable | | "Key Performance Indicator" | short label KPI, acronym KPI | the acronym channel is what makes TN-002 bearable |
| a short label reading Metric on a class labelled Metric | no short label | a duplicate of the label carries nothing |
## TN-023 — The label is generated, never typed ## TN-023 — The label is generated, never typed
@@ -923,19 +924,47 @@ Applies TN-011 and TN-022. The short label is what screens display and what rela
| IRI | rdfs:label | shortLabel | acronym | Note | | IRI | rdfs:label | shortLabel | acronym | Note |
|---|---|---|---|---| |---|---|---|---|---|
| `DataDomain` | Data Domain | Domain | DD | DD is already the short form used inside A-Box identifiers under NR-014 | | `MetaModelObject` | Meta Model Object | - | - | |
| `DataSubDomain` | Data Sub Domain | Sub Domain | SD | no hyphen | | `DefinedObject` | Defined Object | - | - | |
| `DataDomainOwner` | Data Domain Owner | Domain Owner | DDO | | | `CapturedObject` | Captured Object | - | - | |
| `DataSubDomainOwner` | Data Sub Domain Owner | Sub Domain Owner | SDO | | | `OwnershipLayerObject` | Ownership Layer Object | Ownership Layer | - | the categorisation role moves into rdfs:comment |
| `DataProductOwner` | Data Product Owner | Product Owner | PO | NOT DPO — the initialism is taken by Data Protection Officer | | `BusinessLayerObject` | Business Layer Object | Business Layer | - | |
| `DataSteward` | Data Steward | Steward | - | | | `LogicalLayerObject` | Logical Layer Object | Logical Layer | - | |
| `DataGovernanceLead` | Data Governance Lead | Governance Lead | DGL | | | `PhysicalLayerObject` | Physical Layer Object | Physical Layer | - | |
| `DataElement` | Data Element | Element | - | drives the name of hasElement and hasGrainElement | | `DeliveryLayerObject` | Delivery Layer Object | Delivery Layer | - | |
| `BusinessConcept` | Business Concept | Concept | - | drives the name of usesConcept | | `ConsumptionLayerObject` | Consumption Layer Object | Consumption Layer | - | |
| `GovernanceLayerObject` | Governance Layer Object | Governance Layer | - | |
| `DataStructure` | Data Structure | - | - | the former short label was a gloss and belongs in rdfs:comment |
| `KeyConstraint` | Key Constraint | - | - | |
| `Actor` | Actor | - | - | |
| `DataDomain` | Data Domain | Domain | DD | DD is already the short form used inside instance identifiers |
| `DataSubDomain` | Data Sub Domain | Sub Domain | SD | no hyphen, for consistency |
| `BusinessObject` | Business Object | - | BO | | | `BusinessObject` | Business Object | - | BO | |
| `BusinessConcept` | Business Concept | Concept | - | drives the name of usesConcept |
| `Metric` | Metric | - | - | |
| `KeyPerformanceIndicator` | Key Performance Indicator | KPI | KPI | the acronym channel is what makes TN-002 bearable | | `KeyPerformanceIndicator` | Key Performance Indicator | KPI | KPI | the acronym channel is what makes TN-002 bearable |
| `DataObject` | Data Object | - | - | |
| `DataElement` | Data Element | Element | - | drives the name of hasElement and hasGrainElement |
| `Database` | Database | - | - | |
| `Schema` | Schema | - | - | |
| `Field` | Field | - | - | |
| `System` | System | - | - | |
| `SystemType` | System Type | - | - | |
| `Transformation` | Transformation | - | - | |
| `BaseTable` | Base Table | - | - | |
| `ExternalTable` | External Table | - | - | |
| `View` | View | - | - | |
| `PrimaryKey` | Primary Key | - | - | |
| `ForeignKey` | Foreign Key | - | - | |
| `DataProduct` | Data Product | - | - | |
| `DataContract` | Data Contract | - | - | |
| `DataInterface` | Data Interface | - | - | |
| `BusinessIntelligenceWorkspace` | Business Intelligence Workspace | BI Workspace | - | | | `BusinessIntelligenceWorkspace` | Business Intelligence Workspace | BI Workspace | - | |
| `BusinessIntelligenceDataSource` | Business Intelligence Data Source | BI Data Source | - | | | `BusinessIntelligenceDataSource` | Business Intelligence Data Source | BI Data Source | - | |
| `BusinessIntelligenceField` | Business Intelligence Field | BI Field | - | | | `BusinessIntelligenceField` | Business Intelligence Field | BI Field | - | reproduced whole in containsBIField under TN-011 |
| `BusinessIntelligenceReport` | Business Intelligence Report | BI Report | - | | | `BusinessIntelligenceReport` | Business Intelligence Report | BI Report | - | |
| `OwnershipLayerObject` | Ownership Layer Object | - | - | the categorisation role moves into rdfs:comment | | `DataDomainOwner` | Data Domain Owner | Domain Owner | DDO | |
| `DataSubDomainOwner` | Data Sub Domain Owner | Sub Domain Owner | SDO | |
| `DataProductOwner` | Data Product Owner | Product Owner | PO | not DPO - the initialism is taken by Data Protection Officer, a real GDPR role |
| `DataSteward` | Data Steward | Steward | - | |
| `DataGovernanceLead` | Data Governance Lead | Governance Lead | DGL | |
Binary file not shown.
+11 -5
View File
@@ -238,16 +238,22 @@ def migrate(onto, others, spec, rules, report):
report.add("isAbstract_declared", 1) report.add("isAbstract_declared", 1)
# 10 — display annotations, from the rulebook annex (TN-022) # 10 — display annotations, from the rulebook annex (TN-022)
# The annex is authoritative AND exhaustive: a null value means any existing
# annotation is removed. A short label identical to the label carries no
# information and is one more thing to keep in step.
for d in rules["display"]: for d in rules["display"]:
term = pr[d["iri"]] term = pr[d["iri"]]
for prop, value in ((pr.shortLabel, d.get("short_label")), for prop, value in ((pr.shortLabel, d.get("short_label")),
(pr.acronym, d.get("acronym"))): (pr.acronym, d.get("acronym"))):
if not value: current = list(onto.objects(term, prop))
continue if value:
if (term, prop, Literal(value)) not in onto: if (term, prop, Literal(value)) not in onto:
onto.remove((term, prop, None))
onto.add((term, prop, Literal(value)))
report.add("display_set", 1)
elif current:
onto.remove((term, prop, None)) onto.remove((term, prop, None))
onto.add((term, prop, Literal(value))) report.add("display_removed", len(current))
report.add("display_set", 1)
# 11 — regenerate every label by derivation (TN-018, TN-023) # 11 — regenerate every label by derivation (TN-018, TN-023)
kinds = (OWL.Class, OWL.ObjectProperty, OWL.DatatypeProperty, OWL.AnnotationProperty) kinds = (OWL.Class, OWL.ObjectProperty, OWL.DatatypeProperty, OWL.AnnotationProperty)
+56 -18
View File
@@ -17,7 +17,7 @@
meta: meta:
title: Pernod Ricard Data MetaModel — T-Box Rulebook title: Pernod Ricard Data MetaModel — T-Box Rulebook
version: "1.1" version: "1.2"
status: Draft for review status: Draft for review
date: "2026-08-03" date: "2026-08-03"
scope: > scope: >
@@ -520,9 +520,12 @@ rules:
category: Label category: Label
title: The short label carries the spoken form title: The short label carries the spoken form
statement: > statement: >
A term carries pr:shortLabel whenever the form derived under TN-018 is not A term carries pr:shortLabel ONLY where the form derived under TN-018 is not
what the organisation writes or says. The short label is free: acronyms, what the organisation writes or says. Where the two coincide, no short label
abbreviations, hyphens, short forms. is declared: a duplicate of the label carries no information and is one more
thing to keep in step. The short label follows the casing of the label it
replaces — title case for a class — and admits what the label cannot:
acronyms, abbreviations, dropped words.
scope: [class, individual] scope: [class, individual]
severity: MAJOR severity: MAJOR
control: {tier: human, executor: review checklist, procedure: null} control: {tier: human, executor: review checklist, procedure: null}
@@ -531,12 +534,16 @@ rules:
The short label is what makes the derivation rule bearable. Without it, a The short label is what makes the derivation rule bearable. Without it, a
mechanical label impoverishes every screen; with it, display becomes mechanical label impoverishes every screen; with it, display becomes
explicit and centrally governed instead of being improvised by each explicit and centrally governed instead of being improvised by each
consumer. It is MAJOR rather than BLOCKING because judging whether a derived consumer. Restricting it to the cases where it actually differs is what
form matches what people actually say is human work, and EV-011 forbids keeps it meaningful: a short label present on every term degenerates into a
declaring a rule blocking with no executor. second copy of the label, drifting from it one entry at a time. It is MAJOR
rather than BLOCKING because judging whether a derived form matches what
people actually say is human work, and EV-011 forbids declaring a rule
blocking with no executor.
examples: examples:
- {from: "\"Data Sub Domain Owner\"", to: "short label Sub Domain Owner", note: the word Data is dropped in the spoken form} - {from: "\"Data Sub Domain Owner\"", to: "short label Sub Domain Owner", note: the word Data is dropped in the spoken form}
- {from: "\"Key Performance Indicator\"", to: "short label KPI, acronym KPI", note: the acronym channel is what makes TN-002 bearable} - {from: "\"Key Performance Indicator\"", to: "short label KPI, acronym KPI", note: the acronym channel is what makes TN-002 bearable}
- {from: "a short label reading Metric on a class labelled Metric", to: no short label, note: a duplicate of the label carries nothing}
- id: TN-023 - id: TN-023
category: Label category: Label
@@ -1026,20 +1033,51 @@ abstractness:
- {term: SystemType, is_abstract: false, note: "must stay concrete — it types five individuals"} - {term: SystemType, is_abstract: false, note: "must stay concrete — it types five individuals"}
# ====== ANNEX: DISPLAY (TN-011, TN-022) ====== # ====== ANNEX: DISPLAY (TN-011, TN-022) ======
# Authoritative and exhaustive: a class absent from this list carries no
# short label and no acronym. A null short_label means any existing one is
# removed, since a duplicate of the label carries no information (TN-022).
display: display:
- {iri: DataDomain, label: "Data Domain", short_label: "Domain", acronym: "DD", note: "DD is already the short form used inside A-Box identifiers under NR-014"} - {iri: MetaModelObject, label: "Meta Model Object", short_label: null, acronym: null, note: null}
- {iri: DataSubDomain, label: "Data Sub Domain", short_label: "Sub Domain", acronym: "SD", note: "no hyphen"} - {iri: DefinedObject, label: "Defined Object", short_label: null, acronym: null, note: null}
- {iri: DataDomainOwner, label: "Data Domain Owner", short_label: "Domain Owner", acronym: "DDO", note: null} - {iri: CapturedObject, label: "Captured Object", short_label: null, acronym: null, note: null}
- {iri: DataSubDomainOwner, label: "Data Sub Domain Owner", short_label: "Sub Domain Owner", acronym: "SDO", note: null} - {iri: OwnershipLayerObject, label: "Ownership Layer Object", short_label: "Ownership Layer", acronym: null, note: "the categorisation role moves into rdfs:comment"}
- {iri: DataProductOwner, label: "Data Product Owner", short_label: "Product Owner", acronym: "PO", note: "NOT DPO — the initialism is taken by Data Protection Officer"} - {iri: BusinessLayerObject, label: "Business Layer Object", short_label: "Business Layer", acronym: null, note: null}
- {iri: DataSteward, label: "Data Steward", short_label: "Steward", acronym: null, note: null} - {iri: LogicalLayerObject, label: "Logical Layer Object", short_label: "Logical Layer", acronym: null, note: null}
- {iri: DataGovernanceLead, label: "Data Governance Lead", short_label: "Governance Lead", acronym: "DGL", note: null} - {iri: PhysicalLayerObject, label: "Physical Layer Object", short_label: "Physical Layer", acronym: null, note: null}
- {iri: DataElement, label: "Data Element", short_label: "Element", acronym: null, note: "drives the name of hasElement and hasGrainElement"} - {iri: DeliveryLayerObject, label: "Delivery Layer Object", short_label: "Delivery Layer", acronym: null, note: null}
- {iri: BusinessConcept, label: "Business Concept", short_label: "Concept", acronym: null, note: "drives the name of usesConcept"} - {iri: ConsumptionLayerObject, label: "Consumption Layer Object", short_label: "Consumption Layer", acronym: null, note: null}
- {iri: GovernanceLayerObject, label: "Governance Layer Object", short_label: "Governance Layer", acronym: null, note: null}
- {iri: DataStructure, label: "Data Structure", short_label: null, acronym: null, note: "the former short label was a gloss and belongs in rdfs:comment"}
- {iri: KeyConstraint, label: "Key Constraint", short_label: null, acronym: null, note: null}
- {iri: Actor, label: "Actor", short_label: null, acronym: null, note: null}
- {iri: DataDomain, label: "Data Domain", short_label: "Domain", acronym: "DD", note: "DD is already the short form used inside instance identifiers"}
- {iri: DataSubDomain, label: "Data Sub Domain", short_label: "Sub Domain", acronym: "SD", note: "no hyphen, for consistency"}
- {iri: BusinessObject, label: "Business Object", short_label: null, acronym: "BO", note: null} - {iri: BusinessObject, label: "Business Object", short_label: null, acronym: "BO", note: null}
- {iri: BusinessConcept, label: "Business Concept", short_label: "Concept", acronym: null, note: "drives the name of usesConcept"}
- {iri: Metric, label: "Metric", short_label: null, acronym: null, note: null}
- {iri: KeyPerformanceIndicator, label: "Key Performance Indicator", short_label: "KPI", acronym: "KPI", note: "the acronym channel is what makes TN-002 bearable"} - {iri: KeyPerformanceIndicator, label: "Key Performance Indicator", short_label: "KPI", acronym: "KPI", note: "the acronym channel is what makes TN-002 bearable"}
- {iri: DataObject, label: "Data Object", short_label: null, acronym: null, note: null}
- {iri: DataElement, label: "Data Element", short_label: "Element", acronym: null, note: "drives the name of hasElement and hasGrainElement"}
- {iri: Database, label: "Database", short_label: null, acronym: null, note: null}
- {iri: Schema, label: "Schema", short_label: null, acronym: null, note: null}
- {iri: Field, label: "Field", short_label: null, acronym: null, note: null}
- {iri: System, label: "System", short_label: null, acronym: null, note: null}
- {iri: SystemType, label: "System Type", short_label: null, acronym: null, note: null}
- {iri: Transformation, label: "Transformation", short_label: null, acronym: null, note: null}
- {iri: BaseTable, label: "Base Table", short_label: null, acronym: null, note: null}
- {iri: ExternalTable, label: "External Table", short_label: null, acronym: null, note: null}
- {iri: View, label: "View", short_label: null, acronym: null, note: null}
- {iri: PrimaryKey, label: "Primary Key", short_label: null, acronym: null, note: null}
- {iri: ForeignKey, label: "Foreign Key", short_label: null, acronym: null, note: null}
- {iri: DataProduct, label: "Data Product", short_label: null, acronym: null, note: null}
- {iri: DataContract, label: "Data Contract", short_label: null, acronym: null, note: null}
- {iri: DataInterface, label: "Data Interface", short_label: null, acronym: null, note: null}
- {iri: BusinessIntelligenceWorkspace, label: "Business Intelligence Workspace", short_label: "BI Workspace", acronym: null, note: null} - {iri: BusinessIntelligenceWorkspace, label: "Business Intelligence Workspace", short_label: "BI Workspace", acronym: null, note: null}
- {iri: BusinessIntelligenceDataSource, label: "Business Intelligence Data Source", short_label: "BI Data Source", acronym: null, note: null} - {iri: BusinessIntelligenceDataSource, label: "Business Intelligence Data Source", short_label: "BI Data Source", acronym: null, note: null}
- {iri: BusinessIntelligenceField, label: "Business Intelligence Field", short_label: "BI Field", acronym: null, note: null} - {iri: BusinessIntelligenceField, label: "Business Intelligence Field", short_label: "BI Field", acronym: null, note: "reproduced whole in containsBIField under TN-011"}
- {iri: BusinessIntelligenceReport, label: "Business Intelligence Report", short_label: "BI Report", acronym: null, note: null} - {iri: BusinessIntelligenceReport, label: "Business Intelligence Report", short_label: "BI Report", acronym: null, note: null}
- {iri: OwnershipLayerObject, label: "Ownership Layer Object", short_label: null, acronym: null, note: "the categorisation role moves into rdfs:comment"} - {iri: DataDomainOwner, label: "Data Domain Owner", short_label: "Domain Owner", acronym: "DDO", note: null}
- {iri: DataSubDomainOwner, label: "Data Sub Domain Owner", short_label: "Sub Domain Owner", acronym: "SDO", note: null}
- {iri: DataProductOwner, label: "Data Product Owner", short_label: "Product Owner", acronym: "PO", note: "not DPO - the initialism is taken by Data Protection Officer, a real GDPR role"}
- {iri: DataSteward, label: "Data Steward", short_label: "Steward", acronym: null, note: null}
- {iri: DataGovernanceLead, label: "Data Governance Lead", short_label: "Governance Lead", acronym: "DGL", note: null}
-519
View File
@@ -1,519 +0,0 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix pr: <https://ontology.pernod-ricard.com/metamodel/> .
@prefix prs: <https://ontology.pernod-ricard.com/metamodel/shapes/> .
#################################################################
# PR DATA META MODEL - SHACL SHAPES v0.2
# Aligned with T-Box v1.1 and Rulebook v0.3.x
#
# WHAT CHANGED vs v0.1.1
# ----------------------
# 1. SPLIT BY PROVENANCE. v0.1.1 targeted pr:MetaModelObject and demanded an
# identifier, a name, an owner, an owning domain, a status and a version on
# everything. Applied to the captured half of the graph that would fail on
# every one of ~50 000 Snowflake columns. Defined and Captured objects now
# have separate shapes with separate expectations.
#
# 2. SCOPE FOR THE UNIFIED RELATIONS. belongsTo and represents deliberately
# carry no rdfs:domain/range in the T-Box, because each serves two classes
# with different targets. The scope lives here instead, per class.
#
# 3. MEANING IS AN XOR, NOT A CHECKLIST. A Data Element reaches business
# meaning by exactly one route. sh:xone rejects both zero routes and two.
#
# 4. NO COVERAGE RULES. Nothing here requires a Business Concept to be
# realized, or a Business Object to hold N concepts. That was BR-004, and
# encoding a coverage expectation as a blocking constraint does not produce
# coverage -- it produces padding. Coverage is a dashboard metric.
#
# 5. PORTABLE REGEX. No lookbehind: sh:pattern is normatively XPath 2.0
# regex, which does not support it. Written as sh:not [ sh:pattern ... ].
#
# SEVERITY MAPPING
# sh:Violation -> BLOCKING, cannot reach PUBLISHED, fails CI (DQ-011)
# sh:Warning -> MAJOR, must be reviewed, does not block
# sh:Info -> GUIDELINE, informational
#################################################################
<https://ontology.pernod-ricard.com/metamodel/shapes/>
dcterms:title "PR Data Meta Model - SHACL Shapes" ;
dcterms:modified "2026-07-30"^^xsd:date ;
rdfs:comment "Executable form of the rulebook. Validated by scripts/run_shacl_validation.py." .
#################################################################
# IDENTITY AND LIFECYCLE -- defined objects only
#################################################################
prs:DefinedObjectShape a sh:NodeShape ;
sh:targetClass pr:DefinedObject ;
rdfs:comment "Applies to everything governance writes. Captured objects are deliberately exempt: see CapturedObjectShape." ;
sh:property [
sh:path pr:identifier ; sh:datatype xsd:string ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "DQ-001 -- every defined object carries exactly one identifier. NOTE: uniqueness across the graph is NOT tested here; SHACL checks cardinality only. The reconciliation job tests uniqueness." ] ;
sh:property [
sh:path pr:name ; sh:datatype xsd:string ;
sh:minCount 1 ; sh:maxCount 1 ; sh:minLength 3 ;
sh:severity sh:Violation ;
sh:message "Every defined object carries exactly one canonical name." ] ;
sh:property [
sh:path pr:status ; sh:minCount 1 ;
sh:in ( "DRAFT" "UNDER_REVIEW" "PUBLISHED" "DEPRECATED" "RETIRED" ) ;
sh:severity sh:Violation ;
sh:message "LC-001 -- status must be one of DRAFT, UNDER_REVIEW, PUBLISHED, DEPRECATED, RETIRED." ] ;
sh:property [
sh:path pr:owningDomain ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "OW-001 -- at most one owning Data Domain. On a Data Element this may be re-declared to differ from the parent chain: that marks a borrowed element." ] ;
sh:property [
sh:path pr:version ; sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A published object should carry a version." ] .
prs:PublishedShape a sh:NodeShape ;
sh:targetClass pr:DefinedObject ;
rdfs:comment "Extra demands that only bite once an object claims to be PUBLISHED. Keeping these off the base shape is what lets a domain be documented progressively." ;
sh:sparql [
sh:severity sh:Violation ;
sh:message "OW-007 -- an object flagged TO_ARBITRATE cannot be PUBLISHED. Resolve at the Cross-Domain Council first." ;
sh:select """
PREFIX pr: <https://ontology.pernod-ricard.com/metamodel/>
SELECT $this WHERE {
$this pr:status "PUBLISHED" ;
pr:arbitrationStatus "TO_ARBITRATE" .
}""" ] ;
sh:sparql [
sh:severity sh:Violation ;
sh:message "OW-003 -- a PUBLISHED object must have an owning Data Domain." ;
sh:select """
PREFIX pr: <https://ontology.pernod-ricard.com/metamodel/>
SELECT $this WHERE {
$this pr:status "PUBLISHED" .
FILTER NOT EXISTS { $this pr:owningDomain ?d }
}""" ] .
#################################################################
# OBSERVED OBJECTS -- captured, never hand-edited
#################################################################
prs:CapturedObjectShape a sh:NodeShape ;
sh:targetClass pr:CapturedObject ;
rdfs:comment "No identifier, no name, no owner, no status, no version. A harvested column is attributed through the Data Element mapped to it, never asserted directly. What it must carry is enough to be re-found on the next run." ;
sh:property [
sh:path pr:sourceIdentifier ; sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A native immutable source id makes reconciliation idempotent and survives renames, which names do not." ] ;
sh:property [
sh:path pr:harvestedOn ; sh:datatype xsd:dateTime ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "Every captured object records when it was harvested. Without it there is no way to tell a current fact from a stale one." ] ;
sh:property [
sh:path pr:owningDomain ; sh:maxCount 0 ;
sh:severity sh:Warning ;
sh:message "Captured objects are not attributed directly -- ownership flows from the Data Element mapped to them." ] .
# inSchema is deliberately NOT required anywhere. Neo4j has no schema and
# BigQuery calls the level a dataset; a minCount 1 here would break on the
# first harvest outside Snowflake.
prs:DataStructureShape a sh:NodeShape ;
sh:targetClass pr:DataStructure ;
sh:property [
sh:path pr:inSchema ; sh:maxCount 1 ;
sh:severity sh:Info ;
sh:message "Optional on purpose: not every engine has a schema level." ] ;
sh:property [
sh:path pr:sourcedFrom ; sh:maxCount 1 ;
sh:severity sh:Info ] .
prs:FieldShape a sh:NodeShape ;
sh:targetClass pr:Field ;
sh:property [
sh:path pr:fullyQualifiedName ; sh:datatype xsd:string ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:pattern "^[A-Za-z0-9_$]+\\\\.[A-Za-z0-9_$]+\\\\.[A-Za-z0-9_$]+\\\\.[A-Za-z0-9_$]+$" ;
sh:severity sh:Violation ;
sh:message "A Field carries DATABASE.SCHEMA.RELATION.COLUMN. A bare column name is ambiguous as soon as it exists in two tables, so the FQN is the real join key against INFORMATION_SCHEMA." ] ;
sh:property [
sh:path pr:livesIn ; sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "Every Field lives in exactly one Physical Relation." ] .
#################################################################
# CATEGORIZATION TREE -- scope of the unified belongsTo
#################################################################
prs:SubDomainShape a sh:NodeShape ;
sh:targetClass pr:SubDomain ;
sh:property [
sh:path pr:belongsTo ; sh:class pr:DataDomain ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "A Sub-Domain belongs to exactly one Data Domain." ] ;
sh:property [
sh:path pr:hasSubDomainOwner ; sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A Sub-Domain should name its owner." ] .
prs:DataDomainShape a sh:NodeShape ;
sh:targetClass pr:DataDomain ;
sh:property [
sh:path pr:hasDomainOwner ; sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A Data Domain should name its owner." ] ;
sh:property [
sh:path pr:hasDGL ; sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A Data Domain should name its Data Governance Lead." ] ;
sh:property [
sh:path pr:hasActivationStatus ; sh:maxCount 1 ;
sh:severity sh:Info ] .
#################################################################
# BUSINESS OBJECT -- subject, perimeter, stewardship
#################################################################
prs:BusinessObjectShape a sh:NodeShape ;
sh:targetClass pr:BusinessObject ;
sh:property [
sh:path pr:belongsTo ; sh:class pr:SubDomain ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "A Business Object belongs to exactly one Sub-Domain." ] ;
sh:property [
sh:path pr:aboutConcept ; sh:class pr:BusinessConcept ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "BR-004 -- a Business Object is about exactly one Business Concept. Replaces the old 3..10 minimum, which was satisfied in v0.6 by attaching unrelated concepts. If the subject cannot be named, the object is not scoped." ] ;
sh:property [
sh:path pr:usesConcept ; sh:class pr:BusinessConcept ;
sh:severity sh:Info ;
sh:message "Other notions needed to read this object. Zero is a legitimate answer." ] ;
sh:property [
sh:path pr:monitoredBy ; sh:class pr:DataSteward ;
sh:minCount 1 ;
sh:severity sh:Warning ;
sh:message "The Business Object is where a steward is declared -- Data Objects and Data Elements inherit from here." ] ;
sh:property [
sh:path pr:businessDefinition ; sh:maxCount 0 ;
sh:severity sh:Violation ;
sh:message "A Business Object carries no definition of its own: meaning belongs to the Business Concept named by aboutConcept. Two definitions for one notion are two definitions free to diverge. MIGRATION: move the text to that Concept." ] ;
sh:property [
sh:path pr:sourcedFrom ; sh:maxCount 0 ;
sh:severity sh:Violation ;
sh:message "A Business Object has no system of truth. It is a governance grouping, not data: its data lives in the Data Objects that represent it, and those name the system. In v0.6 this property held a grab-bag on the 15 objects -- physical locations, migration notes, arbitration remarks -- all under one name." ] .
#################################################################
# BUSINESS CONCEPT AND METRIC
#################################################################
prs:BusinessConceptShape a sh:NodeShape ;
sh:targetClass pr:BusinessConcept ;
rdfs:comment "Note what is NOT here: no requirement that a Concept be realized by any Data Element or measured by any Metric. The business layer is allowed to run ahead of the data. Coverage is a dashboard metric, not a rule." ;
sh:property [
sh:path pr:businessDefinition ; sh:datatype xsd:string ;
sh:minCount 1 ; sh:maxCount 1 ; sh:minLength 20 ;
sh:severity sh:Violation ;
sh:message "A Business Concept exists to carry meaning: it must hold exactly one business definition of at least 20 characters." ] ;
sh:property [
sh:path pr:formula ; sh:maxCount 0 ;
sh:severity sh:Violation ;
sh:message "BR-003 -- the presence of a formula is what makes something a Metric. A Concept with a formula is a misclassified Metric." ] ;
sh:property [
sh:path pr:sourcedFrom ; sh:maxCount 0 ;
sh:severity sh:Violation ;
sh:message "A Business Concept has no system of truth. Its authority is its owning domain and its definition belongs in the glossary. Naming a system here would ask which of the systems that USE the concept defines it -- a question with no answer." ] .
prs:MetricShape a sh:NodeShape ;
sh:targetClass pr:Metric ;
sh:property [
sh:path pr:formula ; sh:datatype xsd:string ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "BR-003 -- a Metric is a measurement with a calculation rule. No formula, no Metric." ] ;
sh:property [
sh:path pr:unit ; sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message "A Metric states every unit its variants are expressed in. NOT capped at one: Sell Out Volume is computed in 9L and in L, Sell Out Value in EUR, USD and local currency. The single-unit rule belongs on the Data Element, where it holds -- see DataElementShape." ] ;
sh:property [
sh:path pr:measures ; sh:class pr:BusinessConcept ;
sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message "A Metric measures at least one Business Concept -- this is how a measure element reaches business meaning." ] ;
sh:property [
sh:path pr:hasGranularity ; sh:maxCount 0 ;
sh:severity sh:Warning ;
sh:message "Grain moved off the Metric in v1.1. A Metric is a calculation rule and has no rows; grain belongs to the Data Object, stated with hasGrainElement and checkable against the real primary key." ] ;
sh:property [
sh:path pr:physicalName ; sh:maxCount 0 ;
sh:severity sh:Violation ;
sh:message "A Metric must not carry a physical name -- that is a layer leak. Under BR-013 the physical name belongs on the Data Element." ] .
# The source of truth of a Metric is asserted by exception, then checked.
# "Where can I get this metric" is a first-order question and the derivation
# chain will have gaps before harvesting, so the assertion stands on its own --
# but it must agree with the elements that implement the metric, or the two
# will drift the day an element moves.
prs:MetricSourceShape a sh:NodeShape ;
sh:targetClass pr:Metric ;
rdfs:comment "Rewritten in v1.4 to compare System references rather than strings. A string comparison would have called 'SODH Gold' and 'Snowflake (SODH Gold)' two different systems." ;
sh:sparql [
sh:severity sh:Violation ;
sh:message "A Metric's system of truth must match that of at least one element computing it. If they disagree, either the metric points at the wrong system or an element has moved." ;
sh:select """
PREFIX pr: <https://ontology.pernod-ricard.com/metamodel/>
SELECT $this WHERE {
$this pr:sourcedFrom ?sys ; pr:computedBy ?de .
FILTER NOT EXISTS {
$this pr:computedBy ?any .
?any pr:sourcedFrom ?sys .
}
}""" ] ;
sh:sparql [
sh:severity sh:Warning ;
sh:message "Elements computing one Metric come from several systems. Legitimate for a metric blending sources, worth a look otherwise." ;
sh:select """
PREFIX pr: <https://ontology.pernod-ricard.com/metamodel/>
SELECT $this WHERE {
$this pr:computedBy ?a , ?b .
?a pr:sourcedFrom ?sa .
?b pr:sourcedFrom ?sb .
FILTER(?sa != ?sb)
}""" ] .
# BR-013, finally executable. v0.1.1 declared it BLOCKING with no shape.
prs:MotherMetricShape a sh:NodeShape ;
sh:targetClass pr:Metric ;
sh:sparql [
sh:severity sh:Warning ;
sh:message "BR-013 -- a PUBLISHED Metric should be implemented by at least one Data Element through computedBy. A metric no element computes is a definition with nothing behind it." ;
sh:select """
PREFIX pr: <https://ontology.pernod-ricard.com/metamodel/>
SELECT $this WHERE {
$this pr:status "PUBLISHED" .
FILTER NOT EXISTS { $this pr:computedBy ?de }
}""" ] .
#################################################################
# DATA OBJECT -- the pivot, and grain
#################################################################
prs:DataObjectShape a sh:NodeShape ;
sh:targetClass pr:DataObject ;
sh:property [
sh:path pr:represents ; sh:class pr:BusinessObject ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "BR-006 -- a Data Object represents exactly one Business Object. This is the pivot: the single junction between governance and technology." ] ;
sh:property [
sh:path pr:hasElement ; sh:class pr:DataElement ;
sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message "A Data Object holds at least one Data Element." ] ;
sh:property [
sh:path pr:hasGrainElement ; sh:class pr:DataElement ;
sh:severity sh:Warning ;
sh:message "State the grain: the elements whose combination makes a row unique. Checkable against the harvested primary key." ] ;
sh:property [
sh:path pr:monitoredBy ; sh:maxCount 0 ;
sh:severity sh:Warning ;
sh:message "Stewardship is declared on the Business Object and inherited through represents. Declaring it here allows two answers to the same question." ] ;
sh:property [
sh:path pr:sourcedFrom ; sh:class pr:System ; sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "Name the System holding the authoritative data, as a reference rather than a string. A string could not answer 'what depends on MDM Product'." ] ;
sh:property [
sh:path pr:storedIn ; sh:class pr:DataStructure ;
sh:severity sh:Warning ;
sh:message "Where the object actually sits: a table, a view, later a node label. The seam between what governance defines and what a harvester captures -- proposed by the reconciliation job, confirmed by a steward." ] ;
sh:property [
sh:path pr:materializedAs ; sh:maxCount 0 ;
sh:severity sh:Warning ;
sh:message "Deprecated in v1.4: storedIn now serves both granularities." ] .
# A declared grain element must actually belong to the object it grains.
prs:GrainConsistencyShape a sh:NodeShape ;
sh:targetClass pr:DataObject ;
sh:sparql [
sh:severity sh:Violation ;
sh:message "A grain element must be one of the object's own Data Elements." ;
sh:select """
PREFIX pr: <https://ontology.pernod-ricard.com/metamodel/>
SELECT $this ?grain WHERE {
$this pr:hasGrainElement ?grain .
FILTER NOT EXISTS { $this pr:hasElement ?grain }
}""" ] .
#################################################################
# DATA ELEMENT -- the XOR of meaning
#################################################################
prs:DataElementShape a sh:NodeShape ;
sh:targetClass pr:DataElement ;
sh:property [
sh:path pr:physicalName ; sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "NR-009 -- the physical name is recorded verbatim and never altered." ] ;
sh:property [
sh:path pr:fullyQualifiedName ; sh:maxCount 1 ;
sh:severity sh:Info ] ;
sh:property [
sh:path pr:unit ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "A Data Element carries exactly one unit. This is the counterpart of the Metric rule: the mother metric lists the units its variants use, each variant states the single unit it is actually expressed in. An element with two units is two elements." ] ;
sh:property [
sh:path pr:represents ; sh:class pr:BusinessConcept ;
sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "A Data Element represents at most one Business Concept. If a column carries two business notions, it should almost certainly be split -- so the case where a steward cannot choose is exactly the one worth looking at." ] ;
sh:property [
sh:path pr:monitoredBy ; sh:maxCount 0 ;
sh:severity sh:Warning ;
sh:message "Stewardship is inherited from the Business Object, not declared here." ] .
# The core rule of v1.1.
prs:DataElementMeaningShape a sh:NodeShape ;
sh:targetClass pr:DataElement ;
rdfs:comment "A Data Element reaches business meaning by exactly one of two routes: it represents a Business Concept (dimensional), or a Metric is computedBy it (measure). sh:xone rejects zero routes and two alike. A measure element must NOT also represent a Concept: the chain Metric -> measures -> Concept already carries the meaning, and carries more, since it names which metric it travels through." ;
sh:xone (
[ sh:property [ sh:path pr:represents ;
sh:minCount 1 ; sh:maxCount 1 ] ]
[ sh:property [ sh:path [ sh:inversePath pr:computedBy ] ;
sh:minCount 1 ] ]
) ;
sh:severity sh:Violation ;
sh:message "A Data Element must reach business meaning by exactly one route: represents a Business Concept (dimensional), or be computedBy a Metric (measure). Never both, never neither. A defined column with no business meaning is debt, not an acceptable state." .
#################################################################
# DELIVERY
#################################################################
prs:DataProductShape a sh:NodeShape ;
sh:targetClass pr:DataProduct ;
sh:property [
sh:path pr:operatedBy ; sh:class pr:SubDomain ;
sh:minCount 1 ; sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "A Data Product is operated by exactly one Sub-Domain. It spans several Business Objects and cannot inherit accountability, so it declares its own -- it is a consumable, and there must be no ambiguity about who runs it." ] ;
sh:property [
sh:path pr:hasProductOwner ; sh:class pr:DataProductOwner ;
sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A Data Product should name exactly one Product Owner. A warning rather than a block: the SODH owner is genuinely not appointed, and a blocking rule that cannot be satisfied truthfully is how BR-004 produced padding." ] ;
sh:property [
sh:path pr:packages ; sh:class pr:DataObject ;
sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message "A Data Product packages at least one Data Object. The Business Objects it makes available are derived from these, which is why no direct link to a Business Object is needed." ] ;
sh:property [
sh:path pr:governedBy ; sh:maxCount 1 ;
sh:severity sh:Warning ;
sh:message "A Data Product should be governed by a Data Contract." ] ;
sh:property [
sh:path pr:exposes ; sh:class pr:DataInterface ;
sh:severity sh:Info ;
sh:message "The channels through which consumers actually get the data." ] .
prs:DataInterfaceShape a sh:NodeShape ;
sh:targetClass pr:DataInterface ;
sh:property [
sh:path pr:servedBy ; sh:minCount 1 ;
sh:severity sh:Warning ;
sh:message "An interface should name what physically backs it. Unlike the old Data Asset test, this is verifiable: a grant, a share or an endpoint either exists or it does not." ] .
#################################################################
# CONSUMPTION
#################################################################
prs:BIFieldShape a sh:NodeShape ;
sh:targetClass pr:BIField ;
rdfs:comment "realizesMetric is a transitional control: asserted directly, with no rule written against the lineage chain. Making the assertion conditional on intermediate mappings existing would create confusion and discourage people from filling it in at all." ;
sh:property [
sh:path pr:exposesMetric ; sh:class pr:Metric ;
sh:maxCount 1 ;
sh:severity sh:Info ;
sh:message "Which certified Metric this BI field implements. Comparing expressions across fields realizing one Metric is the harmonisation measure." ] .
#################################################################
# NAMING -- portable regex, no lookbehind
#################################################################
prs:NamingShape a sh:NodeShape ;
sh:targetClass pr:DefinedObject ;
sh:property [
sh:path pr:name ;
sh:not [ sh:pattern "_NM$" ] ;
sh:severity sh:Warning ;
sh:message "NR-001 -- a canonical name must not end in a physical suffix. Written as sh:not[sh:pattern] rather than a lookbehind: sh:pattern is normatively XPath 2.0 regex, which has no lookbehind, so the v0.1.1 form only worked under pySHACL." ] ;
sh:property [
sh:path pr:name ;
sh:not [ sh:pattern "^[a-z_]+$" ] ;
sh:severity sh:Warning ;
sh:message "NR-002 -- a canonical name is written for humans, not as a snake_case identifier." ] .