@prefix dcterms: .
@prefix owl: .
@prefix pr: .
@prefix prs: .
@prefix rdf: .
@prefix rdfs: .
@prefix sh: .
@prefix xsd: .
prs: dcterms:modified "2026-07-30"^^xsd:date ;
dcterms:title "PR Data Meta Model - SHACL Shapes" ;
rdfs:comment "Executable form of the rulebook. Validated by scripts/run_shacl_validation.py." .
prs:BIFieldShape a sh:NodeShape ;
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:class pr:Metric ;
sh:maxCount 1 ;
sh:message "Which certified Metric this BI field implements. Comparing expressions across fields realizing one Metric is the harmonisation measure." ;
sh:path pr:exposesMetric ;
sh:severity sh:Info ] ;
sh:targetClass pr:BusinessIntelligenceField .
prs:BusinessConceptShape a sh:NodeShape ;
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:datatype xsd:string ;
sh:maxCount 1 ;
sh:message "A Business Concept exists to carry meaning: it must hold exactly one business definition of at least 20 characters." ;
sh:minCount 1 ;
sh:minLength 20 ;
sh:path pr:businessDefinition ;
sh:severity sh:Violation ],
[ sh:maxCount 0 ;
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:path pr:formula ;
sh:severity sh:Violation ],
[ sh:maxCount 0 ;
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." ;
sh:path pr:sourcedFrom ;
sh:severity sh:Violation ] ;
sh:targetClass pr:BusinessConcept .
prs:BusinessObjectShape a sh:NodeShape ;
sh:property [ sh:class pr:DataSubDomain ;
sh:maxCount 1 ;
sh:message "A Business Object belongs to exactly one Sub-Domain." ;
sh:minCount 1 ;
sh:path pr:belongsTo ;
sh:severity sh:Violation ],
[ sh:class pr:BusinessConcept ;
sh:maxCount 1 ;
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:minCount 1 ;
sh:path pr:isAbout ;
sh:severity sh:Violation ],
[ sh:class pr:BusinessConcept ;
sh:message "Other notions needed to read this object. Zero is a legitimate answer." ;
sh:path pr:usesConcept ;
sh:severity sh:Info ],
[ sh:class pr:DataSteward ;
sh:message "The Business Object is where a steward is declared -- Data Objects and Data Elements inherit from here." ;
sh:minCount 1 ;
sh:path pr:monitoredBy ;
sh:severity sh:Warning ],
[ sh:maxCount 0 ;
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:path pr:businessDefinition ;
sh:severity sh:Violation ],
[ sh:maxCount 0 ;
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." ;
sh:path pr:sourcedFrom ;
sh:severity sh:Violation ] ;
sh:targetClass pr:BusinessObject .
prs:CapturedObjectShape a sh:NodeShape ;
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:datatype xsd:string ;
sh:maxCount 1 ;
sh:message "A native immutable source id makes reconciliation idempotent and survives renames, which names do not." ;
sh:path pr:sourceIdentifier ;
sh:severity sh:Warning ],
[ sh:datatype xsd:dateTime ;
sh:maxCount 1 ;
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:minCount 1 ;
sh:path pr:harvestDate ;
sh:severity sh:Violation ],
[ sh:maxCount 0 ;
sh:message "Captured objects are not attributed directly -- ownership flows from the Data Element mapped to them." ;
sh:path pr:ownedByDomain ;
sh:severity sh:Warning ] ;
sh:targetClass pr:CapturedObject .
prs:DataDomainShape a sh:NodeShape ;
sh:property [ sh:maxCount 1 ;
sh:message "A Data Domain should name its owner." ;
sh:path pr:hasDomainOwner ;
sh:severity sh:Warning ],
[ sh:maxCount 1 ;
sh:message "A Data Domain should name its Data Governance Lead." ;
sh:path pr:hasGovernanceLead ;
sh:severity sh:Warning ],
[ sh:maxCount 1 ;
sh:path pr:activationStatus ;
sh:severity sh:Info ] ;
sh:targetClass pr:DataDomain .
prs:DataElementMeaningShape a sh:NodeShape ;
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: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." ;
sh:severity sh:Violation ;
sh:targetClass pr:DataElement ;
sh:xone ( [ sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:path pr:represents ] ] [ sh:property [ sh:minCount 1 ;
sh:path [ sh:inversePath pr:computedBy ] ] ] ) .
prs:DataElementShape a sh:NodeShape ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:message "NR-009 -- the physical name is recorded verbatim and never altered." ;
sh:path pr:physicalName ;
sh:severity sh:Warning ],
[ sh:maxCount 1 ;
sh:path pr:fullyQualifiedName ;
sh:severity sh:Info ],
[ sh:maxCount 1 ;
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:path pr:unit ;
sh:severity sh:Violation ],
[ sh:class pr:BusinessConcept ;
sh:maxCount 1 ;
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:path pr:represents ;
sh:severity sh:Violation ],
[ sh:maxCount 0 ;
sh:message "Stewardship is inherited from the Business Object, not declared here." ;
sh:path pr:monitoredBy ;
sh:severity sh:Warning ] ;
sh:targetClass pr:DataElement .
prs:DataInterfaceShape a sh:NodeShape ;
sh:property [ 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." ;
sh:minCount 1 ;
sh:path pr:servedBy ;
sh:severity sh:Warning ] ;
sh:targetClass pr:DataInterface .
prs:DataObjectShape a sh:NodeShape ;
sh:property [ sh:class pr:BusinessObject ;
sh:maxCount 1 ;
sh:message "BR-006 -- a Data Object represents exactly one Business Object. This is the pivot: the single junction between governance and technology." ;
sh:minCount 1 ;
sh:path pr:represents ;
sh:severity sh:Violation ],
[ sh:class pr:DataElement ;
sh:message "A Data Object holds at least one Data Element." ;
sh:minCount 1 ;
sh:path pr:hasElement ;
sh:severity sh:Violation ],
[ sh:class pr:DataElement ;
sh:message "State the grain: the elements whose combination makes a row unique. Checkable against the harvested primary key." ;
sh:path pr:hasGrainElement ;
sh:severity sh:Warning ],
[ sh:maxCount 0 ;
sh:message "Stewardship is declared on the Business Object and inherited through represents. Declaring it here allows two answers to the same question." ;
sh:path pr:monitoredBy ;
sh:severity sh:Warning ],
[ sh:class pr:System ;
sh:maxCount 1 ;
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:path pr:sourcedFrom ;
sh:severity sh:Warning ],
[ sh:class pr:DataStructure ;
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:path pr:storedIn ;
sh:severity sh:Warning ],
[ sh:maxCount 0 ;
sh:message "Deprecated in v1.4: storedIn now serves both granularities." ;
sh:path pr:materializedAs ;
sh:severity sh:Warning ] ;
sh:targetClass pr:DataObject .
prs:DataProductShape a sh:NodeShape ;
sh:property [ sh:class pr:DataSubDomain ;
sh:maxCount 1 ;
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:minCount 1 ;
sh:path pr:operatedBy ;
sh:severity sh:Violation ],
[ sh:class pr:DataProductOwner ;
sh:maxCount 1 ;
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:path pr:hasProductOwner ;
sh:severity sh:Warning ],
[ sh:class pr:DataObject ;
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:minCount 1 ;
sh:path pr:packages ;
sh:severity sh:Violation ],
[ sh:maxCount 1 ;
sh:message "A Data Product should be governed by a Data Contract." ;
sh:path pr:governedBy ;
sh:severity sh:Warning ],
[ sh:class pr:DataInterface ;
sh:message "The channels through which consumers actually get the data." ;
sh:path pr:exposes ;
sh:severity sh:Info ] ;
sh:targetClass pr:DataProduct .
prs:DataStructureShape a sh:NodeShape ;
sh:property [ sh:maxCount 1 ;
sh:message "Optional on purpose: not every engine has a schema level." ;
sh:path pr:isInSchema ;
sh:severity sh:Info ],
[ sh:maxCount 1 ;
sh:path pr:sourcedFrom ;
sh:severity sh:Info ] ;
sh:targetClass pr:DataStructure .
prs:DefinedObjectShape a sh:NodeShape ;
rdfs:comment "Applies to everything governance writes. Captured objects are deliberately exempt: see CapturedObjectShape." ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
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:minCount 1 ;
sh:path pr:identifier ;
sh:severity sh:Violation ],
[ sh:maxCount 1 ;
sh:message "A published object should carry a version." ;
sh:path pr:version ;
sh:severity sh:Warning ],
[ sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:message "Every defined object carries exactly one canonical name." ;
sh:minCount 1 ;
sh:minLength 3 ;
sh:path pr:canonicalName ;
sh:severity sh:Violation ],
[ sh:in ( "DRAFT" "UNDER_REVIEW" "PUBLISHED" "DEPRECATED" "RETIRED" ) ;
sh:message "LC-001 -- status must be one of DRAFT, UNDER_REVIEW, PUBLISHED, DEPRECATED, RETIRED." ;
sh:minCount 1 ;
sh:path pr:status ;
sh:severity sh:Violation ],
[ sh:maxCount 1 ;
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:path pr:ownedByDomain ;
sh:severity sh:Violation ] ;
sh:targetClass pr:DefinedObject .
prs:FieldShape a sh:NodeShape ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
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:minCount 1 ;
sh:path pr:fullyQualifiedName ;
sh:pattern "^[A-Za-z0-9_$]+\\\\.[A-Za-z0-9_$]+\\\\.[A-Za-z0-9_$]+\\\\.[A-Za-z0-9_$]+$" ;
sh:severity sh:Violation ],
[ sh:maxCount 1 ;
sh:message "Every Field lives in exactly one Physical Relation." ;
sh:minCount 1 ;
sh:path pr:livesIn ;
sh:severity sh:Violation ] ;
sh:targetClass pr:Field .
prs:GrainConsistencyShape a sh:NodeShape ;
sh:sparql [ sh:message "A grain element must be one of the object's own Data Elements." ;
sh:select """
PREFIX pr:
SELECT $this ?grain WHERE {
$this pr:hasGrainElement ?grain .
FILTER NOT EXISTS { $this pr:hasElement ?grain }
}""" ;
sh:severity sh:Violation ] ;
sh:targetClass pr:DataObject .
prs:MetricShape a sh:NodeShape ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:message "BR-003 -- a Metric is a measurement with a calculation rule. No formula, no Metric." ;
sh:minCount 1 ;
sh:path pr:formula ;
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:minCount 1 ;
sh:path pr:unit ;
sh:severity sh:Violation ],
[ sh:class pr:BusinessConcept ;
sh:message "A Metric measures at least one Business Concept -- this is how a measure element reaches business meaning." ;
sh:minCount 1 ;
sh:path pr:measures ;
sh:severity sh:Violation ],
[ sh:maxCount 0 ;
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:path pr:hasGranularity ;
sh:severity sh:Warning ],
[ sh:maxCount 0 ;
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." ;
sh:path pr:physicalName ;
sh:severity sh:Violation ] ;
sh:targetClass pr:Metric .
prs:MetricSourceShape a sh:NodeShape ;
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: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:
SELECT $this WHERE {
$this pr:sourcedFrom ?sys ; pr:computedBy ?de .
FILTER NOT EXISTS {
$this pr:computedBy ?any .
?any pr:sourcedFrom ?sys .
}
}""" ;
sh:severity sh:Violation ],
[ sh:message "Elements computing one Metric come from several systems. Legitimate for a metric blending sources, worth a look otherwise." ;
sh:select """
PREFIX pr:
SELECT $this WHERE {
$this pr:computedBy ?a , ?b .
?a pr:sourcedFrom ?sa .
?b pr:sourcedFrom ?sb .
FILTER(?sa != ?sb)
}""" ;
sh:severity sh:Warning ] ;
sh:targetClass pr:Metric .
prs:MotherMetricShape a sh:NodeShape ;
sh:sparql [ 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:
SELECT $this WHERE {
$this pr:status "PUBLISHED" .
FILTER NOT EXISTS { $this pr:computedBy ?de }
}""" ;
sh:severity sh:Warning ] ;
sh:targetClass pr:Metric .
prs:NamingShape a sh:NodeShape ;
sh:property [ 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:not [ sh:pattern "_NM$" ] ;
sh:path pr:canonicalName ;
sh:severity sh:Warning ],
[ sh:message "NR-002 -- a canonical name is written for humans, not as a snake_case identifier." ;
sh:not [ sh:pattern "^[a-z_]+$" ] ;
sh:path pr:canonicalName ;
sh:severity sh:Warning ] ;
sh:targetClass pr:DefinedObject .
prs:PublishedShape a sh:NodeShape ;
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:message "OW-007 -- an object flagged TO_ARBITRATE cannot be PUBLISHED. Resolve at the Cross-Domain Council first." ;
sh:select """
PREFIX pr:
SELECT $this WHERE {
$this pr:status "PUBLISHED" ;
pr:arbitrationStatus "TO_ARBITRATE" .
}""" ;
sh:severity sh:Violation ],
[ sh:message "OW-003 -- a PUBLISHED object must have an owning Data Domain." ;
sh:select """
PREFIX pr:
SELECT $this WHERE {
$this pr:status "PUBLISHED" .
FILTER NOT EXISTS { $this pr:ownedByDomain ?d }
}""" ;
sh:severity sh:Violation ] ;
sh:targetClass pr:DefinedObject .
prs:SubDomainShape a sh:NodeShape ;
sh:property [ sh:class pr:DataDomain ;
sh:maxCount 1 ;
sh:message "A Sub-Domain belongs to exactly one Data Domain." ;
sh:minCount 1 ;
sh:path pr:belongsTo ;
sh:severity sh:Violation ],
[ sh:maxCount 1 ;
sh:message "A Sub-Domain should name its owner." ;
sh:path pr:hasSubDomainOwner ;
sh:severity sh:Warning ] ;
sh:targetClass pr:DataSubDomain .
a owl:Ontology ;
rdfs:label "PR Data MetaModel SHACL Shapes" ;
dcterms:conformsTo pr:2.0 .