Linked.Archi ArchiMate 3.2 Viewpoint Conformance Shapes
SHACL shapes for validating that architecture Views conform to their declared Viewpoints. These shapes enforce: 1. Element conformance — elements exposed in a View must be instances of types listed in the viewpoint's arch:includesConcept. 2. View type conformance — a View's rdf:type must match one of the viewpoint's arch:viewType values (Diagram, Catalog, Matrix). 3. Viewpoint declaration — every View must declare which viewpoint it conforms to via arch:viewConformsToViewpoint. These shapes are data-driven: they read the viewpoint definitions from the loaded graph (arch:includesConcept, arch:viewType) rather than hardcoding per-viewpoint rules. This means they work for any viewpoint — ArchiMate example viewpoints, custom viewpoints, or viewpoints from other frameworks — as long as the viewpoint data is loaded. Shapes use sh:severity sh:Warning by default. Organizations may promote specific shapes to sh:Violation based on governance policies. Usage: .scripts/validate.sh --shacl archimate-viewpoints Or load manually: core-shapes.ttl + archimate3.2-viewpoint-shapes.ttl + archimate3.2-viewpoints.ttl + your-model-data.ttl
Linked.Archi
Every View must declare exactly one arch:viewConformsToViewpoint.
View type {?viewType} does not match any arch:viewType declared by viewpoint {?vp}.
SELECT $this ?vp ?viewType WHERE { $this arch:viewConformsToViewpoint ?vp . $this rdf:type ?viewType . ?viewType rdfs:subClassOf* arch:View . FILTER(?viewType != arch:View) FILTER NOT EXISTS { ?vp arch:viewType ?allowedType . ?viewType rdfs:subClassOf* ?allowedType . } FILTER EXISTS { ?vp arch:viewType ?anyType . } }
Element {?element} of type {?elemType} is not allowed in viewpoint {?vp} (not in arch:includesConcept).
SELECT $this ?vp ?element ?elemType WHERE { $this arch:viewConformsToViewpoint ?vp . ?element arch:exposedInView $this . ?element rdf:type ?elemType . ?elemType rdfs:subClassOf* arch:Element . FILTER(?elemType != arch:Element) # The viewpoint must have at least one includesConcept FILTER EXISTS { ?vp arch:includesConcept ?anyConcept . } # The element's type (or any of its superclasses) must match FILTER NOT EXISTS { ?element rdf:type/rdfs:subClassOf* ?allowedType . ?vp arch:includesConcept ?allowedType . } }
Relationship {?rel} in view has endpoint {?endpoint} of type {?endpointType} not in viewpoint {?vp} palette.
SELECT $this ?vp ?rel ?endpoint ?endpointType WHERE { $this arch:viewConformsToViewpoint ?vp . ?rel arch:exposedInView $this . ?rel a/rdfs:subClassOf* arch:QualifiedRelationship . # Check both source and target { ?rel arch:source ?endpoint . } UNION { ?rel arch:target ?endpoint . } ?endpoint rdf:type ?endpointType . ?endpointType rdfs:subClassOf* arch:Element . FILTER(?endpointType != arch:Element) FILTER EXISTS { ?vp arch:includesConcept ?anyConcept . } FILTER NOT EXISTS { ?endpoint rdf:type/rdfs:subClassOf* ?allowedType . ?vp arch:includesConcept ?allowedType . } }
Viewpoint should declare at least one arch:includesConcept.
Viewpoint should declare at least one arch:viewpointFramesConcern.
Viewpoint should declare at least one arch:viewType.