@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 togaf:   <https://meta.linked.archi/togaf/onto#> .
@prefix togaf9:  <https://meta.linked.archi/togaf9/onto#> .
@prefix :        <https://meta.linked.archi/togaf/shapes#> .

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

<https://meta.linked.archi/togaf/shapes#>
    rdf:type                      owl:Ontology ;
    owl:imports                   <https://meta.linked.archi/togaf/onto#>,
                                  <https://meta.linked.archi/togaf9/onto#>,
                                  <https://meta.linked.archi/core-shapes#> ;
    cc:license                    "http://creativecommons.org/licenses/by/4.0/" ;
    vann:preferredNamespaceUri    "https://meta.linked.archi/togaf/shapes#" ;
    vann:preferredNamespacePrefix "togafsh" ;
    dcterms:creator               "Kalin Maldzhanski"^^xsd:string ;
    dcterms:title                 "Linked.Archi TOGAF SHACL Shapes"@en ;
    dcterms:description           '''SHACL shapes for validating TOGAF Content Metamodel data. Covers both
published TOGAF ontologies — TOGAF 10 (togaf:) and TOGAF 9.2 (togaf9:) — because both are
live namespaces with the same abstract element roots.

This is not an official Open Group 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/togaf/shapes/0.1.0#> ;
    owl:versionInfo               "0.1.0"@en ;
    dcterms:source  <https://pubs.opengroup.org/togaf-standard/architecture-content/chap02.html>,
                    <https://pubs.opengroup.org/architecture/togaf9-doc/arch/chap30.html> ;
    prov:wasDerivedFrom <https://pubs.opengroup.org/togaf-standard/architecture-content/chap02.html>,
                    <https://pubs.opengroup.org/architecture/togaf9-doc/arch/chap30.html> ;
.

#################################################################
# Element instance requirements — the authoritative TOGAF 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.
#
# Targets the 6 abstract architecture-domain roots in each of the two published
# TOGAF namespaces, reaching all 84 element classes through rdfs:subClassOf
# reasoning. TOGAF building blocks are catalogued, governed and reported on by
# name, so every element is required to carry one — TOGAF has no unnamed-by-design
# constructs.
#
# Targets TOGAF classes, never arch:Element. In a merged multi-notation graph,
# targeting arch:Element would impose TOGAF's naming policy on every other
# notation's elements.
#################################################################

:TogafElementLabelShape
    a              sh:NodeShape ;
    rdfs:comment   '''Requires a language-tagged skos:prefLabel on every TOGAF element, in both the
TOGAF 10 and TOGAF 9.2 namespaces. Targets the abstract architecture-domain roots, not
arch:Element, so the rule cannot leak onto other notations in a merged graph.'''@en ;
    sh:targetClass togaf:BusinessArchitectureElement ,
                   togaf:DataArchitectureElement ,
                   togaf:ApplicationArchitectureElement ,
                   togaf:TechnologyArchitectureElement ,
                   togaf:MotivationElement ,
                   togaf:ImplementationElement ,
                   togaf9:BusinessArchitectureElement ,
                   togaf9:DataArchitectureElement ,
                   togaf9:ApplicationArchitectureElement ,
                   togaf9:TechnologyArchitectureElement ,
                   togaf9:MotivationElement ,
                   togaf9:ImplementationElement ;
    sh:property [
        sh:path     skos:prefLabel ;
        sh:minCount 1 ;
        sh:datatype rdf:langString ;
        sh:message  '''Every TOGAF element must have at least one skos:prefLabel, and it must be
language-tagged (rdf:langString), e.g. "Customer Onboarding"@en.'''@en ;
    ] ;
.
