@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix prov:    <http://www.w3.org/ns/prov#> .
@prefix bibo:    <http://purl.org/ontology/bibo/> .
@prefix vann:    <http://purl.org/vocab/vann/> .
@prefix cc:      <http://creativecommons.org/ns#> .
@prefix sh:      <http://www.w3.org/ns/shacl#> .

@prefix arch:    <https://meta.linked.archi/core#> .
@prefix lmm:     <https://meta.linked.archi/leanix/onto#> .
@prefix lmm3:    <https://meta.linked.archi/leanix/v3/onto#> .
@prefix :        <https://meta.linked.archi/leanix/shapes#> .

#################################################################
# Ontology Declaration
#################################################################

<https://meta.linked.archi/leanix/shapes#>
    rdf:type                      owl:Ontology ;
    owl:imports                   <https://meta.linked.archi/leanix/onto#>,
                                  <https://meta.linked.archi/leanix/v3/onto#>,
                                  <https://meta.linked.archi/core-shapes#> ;
    cc:license                    "http://creativecommons.org/licenses/by/4.0/" ;
    vann:preferredNamespaceUri    "https://meta.linked.archi/leanix/shapes#" ;
    vann:preferredNamespacePrefix "lmmsh" ;
    dcterms:creator               "Kalin Maldzhanski"^^xsd:string ;
    dcterms:title                 "Linked.Archi LeanIX SHACL Shapes"@en ;
    dcterms:description           '''SHACL shapes for validating SAP LeanIX Meta Model fact sheet data.
Covers both published LeanIX ontologies — v4 (lmm:) and v3 (lmm3:) — because both are live
namespaces rooted at FactSheet.

This is not an official SAP document.'''@en ;
    dcterms:created               "2026-08-04"^^xsd:date ;
    dcterms:modified              "2026-08-04"^^xsd:date ;
    dcterms:publisher             "Linked.Archi"@en,
                                  <https://linked.archi> ;
    bibo:status                   "draft" ;
    owl:versionIRI                <https://meta.linked.archi/leanix/shapes/0.1.0#> ;
    owl:versionInfo               "0.1.0"@en ;
.

#################################################################
# Element instance requirements — the authoritative LeanIX naming rule
#
# core-shapes carries no label shape. arch:Element means "a node in a model", and
# some notations have nodes that are legitimately unnamed (BPMN gateways and
# events, ArchiMate junctions), so naming policy is owned by each metamodel.
# See DD-24 in doc/guide/design-decisions.md.
#
# FactSheet is the single root of the LeanIX element hierarchy in each of the two
# published namespaces, so these two targets reach all 34 fact sheet classes
# through rdfs:subClassOf reasoning.
#
# Every LeanIX fact sheet is addressed by name in the portal, so all are required
# to carry one. LeanIX has no unnamed-by-design constructs.
#
# Targets LeanIX classes, never arch:Element. In a merged multi-notation graph,
# targeting arch:Element would impose LeanIX's naming policy on every other
# notation's elements.
#################################################################

:LeanIXFactSheetLabelShape
    a              sh:NodeShape ;
    rdfs:comment   '''Requires a language-tagged skos:prefLabel on every LeanIX fact sheet, in both
the v4 and v3 namespaces. Reaches all 34 fact sheet classes via the FactSheet roots.'''@en ;
    sh:targetClass lmm:FactSheet ,
                   lmm3:FactSheet ;
    sh:property [
        sh:path     skos:prefLabel ;
        sh:minCount 1 ;
        sh:datatype rdf:langString ;
        sh:message  '''Every LeanIX fact sheet must have at least one skos:prefLabel, and it must
be language-tagged (rdf:langString), e.g. "Payments Platform"@en.'''@en ;
    ] ;
.
