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

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

<https://meta.linked.archi/atam/shapes#>
    rdf:type                      owl:Ontology ;
    owl:imports                   <https://meta.linked.archi/atam/onto#>,
                                  <https://meta.linked.archi/core-shapes#> ;
    cc:license                    "http://creativecommons.org/licenses/by/4.0/" ;
    vann:preferredNamespaceUri    "https://meta.linked.archi/atam/shapes#" ;
    vann:preferredNamespacePrefix "atamsh" ;
    dcterms:creator               "Kalin Maldzhanski"^^xsd:string ;
    dcterms:title                 "Linked.Archi ATAM SHACL Shapes"@en ;
    dcterms:description           '''SHACL shapes for validating ATAM (Architecture Tradeoff Analysis
Method) evaluation records — utility trees, risks, non-risks, sensitivity points and
tradeoff points.'''@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/atam/shapes/0.1.0#> ;
    owl:versionInfo               "0.1.0"@en ;
.

#################################################################
# Element instance requirements — the authoritative ATAM 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.
#
# The 7 targets are ATAM's direct arch:Element roots, reaching all 8 element
# classes through rdfs:subClassOf reasoning (atam:TradeoffPoint is a subclass).
#
# Every ATAM record is referred to by name in an evaluation report, so all are
# required to carry one.
#
# Targets ATAM classes, never arch:Element. In a merged multi-notation graph,
# targeting arch:Element would impose ATAM's naming policy on every other
# notation's elements.
#################################################################

:AtamElementLabelShape
    a              sh:NodeShape ;
    rdfs:comment   '''Requires a language-tagged skos:prefLabel on every ATAM element. Reaches
atam:TradeoffPoint through rdfs:subClassOf reasoning.'''@en ;
    sh:targetClass atam:ATAMEvaluation ,
                   atam:UtilityTree ,
                   atam:QualityAttributeBranch ,
                   atam:ArchitecturalRisk ,
                   atam:NonRisk ,
                   atam:RiskTheme ,
                   atam:SensitivityPoint ;
    sh:property [
        sh:path     skos:prefLabel ;
        sh:minCount 1 ;
        sh:datatype rdf:langString ;
        sh:message  '''Every ATAM element must have at least one skos:prefLabel, and it must be
language-tagged (rdf:langString), e.g. "Latency under peak load"@en.'''@en ;
    ] ;
.
