SHACL Shapes
https://meta.linked.archi/archimate/element-shapes#
SHACL shapes for validating ArchiMate element instances and metamodel patterns. Covers structural integrity, assignment/access/serving direction, cross-layer constraints, specialization rules, junction homogeneity, motivation realization direction, strategy realization targets, and deep specialization warnings. Based on ArchiMate 3.2 spec Figures 5, 34, 45, 46, 51, 52, 70, 82, 99, 104-106. For relationship pair validation, see archimate3.2-relationship-shapes.ttl.
SELECT $this WHERE {
$this am:accesses ?target .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:BehaviorElement .
}
}
SELECT $this WHERE {
?source am:accesses $this .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:PassiveStructureElement .
}
}
| Property | Constraint | Value | Severity | Message |
|---|---|---|---|---|
accessType |
datatype | string | Violation | |
accessType |
in | 390da8b770d2cb5f |
Violation | |
accessType |
maxCount | 1 |
Violation |
| Property | Constraint | Value | Severity | Message |
|---|---|---|---|---|
prefLabel |
datatype | langString | Violation | |
prefLabel |
minCount | 1 |
Violation |
SELECT $this WHERE {
$this am:assignedTo ?target .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:ActiveStructureElement .
}
}
SELECT $this WHERE {
?source am:assignedTo $this .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:BehaviorElement .
}
}
SELECT $this WHERE {
?whole1 am:composedOf $this .
?whole2 am:composedOf $this .
FILTER(?whole1 != ?whole2)
}
SELECT $this ?target WHERE {
$this am:assignedTo ?target .
$this rdf:type/rdfs:subClassOf* am:ExternalActiveStructureElement .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
VALUES ?layer {
am:BusinessLayerElement
am:ApplicationLayerElement
am:TechnologyLayerElement
}
$this rdf:type/rdfs:subClassOf* ?layer .
FILTER NOT EXISTS {
?target rdf:type/rdfs:subClassOf* am:ExternalBehaviorElement .
?target rdf:type/rdfs:subClassOf* ?layer .
}
}
SELECT $this ?target WHERE {
$this am:realizes ?target .
$this rdf:type/rdfs:subClassOf* am:ExternalBehaviorElement .
VALUES ?layer {
am:BusinessLayerElement
am:ApplicationLayerElement
am:TechnologyLayerElement
}
$this rdf:type/rdfs:subClassOf* ?layer .
?target rdf:type/rdfs:subClassOf* am:BehaviorElement .
?target rdf:type/rdfs:subClassOf* ?layer .
FILTER NOT EXISTS {
?target rdf:type/rdfs:subClassOf* am:ExternalBehaviorElement .
}
}
SELECT $this WHERE {
$this am:specializes+ ?t1 .
?t1 am:specializes+ ?t2 .
?t2 am:specializes+ ?t3 .
?t3 am:specializes+ ?t4 .
}
SELECT $this ?target WHERE {
$this am:realizes ?target .
$this a am:WorkPackage .
?target a am:Deliverable .
}
SELECT $this WHERE {
$this am:flowsTo ?target .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:BehaviorElement .
}
}
SELECT $this WHERE {
?source am:flowsTo $this .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:BehaviorElement .
}
}
SELECT $this WHERE {
FILTER NOT EXISTS {
{
$this am:associatedWith ?plateau .
?plateau a am:Plateau .
} UNION {
?plateau am:associatedWith $this .
?plateau a am:Plateau .
}
}
}
| Property | Constraint | Value | Severity | Message |
|---|---|---|---|---|
influenceStrength |
datatype | string | Violation | |
influenceStrength |
in | 390da8b770d2cb5a |
Violation | |
influenceStrength |
maxCount | 1 |
Violation |
SELECT $this WHERE {
{
?a ?rel1 $this .
?b ?rel2 $this .
} UNION {
$this ?rel1 ?a .
$this ?rel2 ?b .
} UNION {
?a ?rel1 $this .
$this ?rel2 ?b .
}
?rel1 rdfs:subPropertyOf* am:composedOf .
FILTER NOT EXISTS {
?rel2 rdfs:subPropertyOf* am:composedOf .
}
FILTER(?rel1 != ?rel2)
}
SELECT $this ?source WHERE {
?source am:assignedTo $this .
$this a am:Stakeholder .
FILTER NOT EXISTS {
?source rdf:type/rdfs:subClassOf* am:ActiveStructureElement .
?source rdf:type/rdfs:subClassOf* am:BusinessLayerElement .
}
}
SELECT $this WHERE {
$this am:flowsTo ?target .
$this rdf:type/rdfs:subClassOf* am:MotivationElement .
}
SELECT $this WHERE {
?source am:flowsTo $this .
$this rdf:type/rdfs:subClassOf* am:MotivationElement .
}
SELECT $this WHERE {
$this am:triggers ?target .
$this rdf:type/rdfs:subClassOf* am:MotivationElement .
}
SELECT $this WHERE {
?source am:triggers $this .
$this rdf:type/rdfs:subClassOf* am:MotivationElement .
}
SELECT $this ?target WHERE {
$this am:realizes ?target .
$this rdf:type/rdfs:subClassOf* am:MotivationElement .
FILTER NOT EXISTS {
?target rdf:type/rdfs:subClassOf* am:MotivationElement .
}
FILTER NOT EXISTS {
?target a am:Grouping .
}
}
SELECT $this WHERE { $this am:aggregates+ $this . }
SELECT $this WHERE { $this am:composedOf+ $this . }
SELECT $this ?target WHERE {
$this am:realizes ?target .
?target rdf:type/rdfs:subClassOf* am:ActiveStructureElement .
?target rdf:type/rdfs:subClassOf* am:BusinessLayerElement .
{
$this rdf:type/rdfs:subClassOf* am:ApplicationLayerElement .
} UNION {
$this rdf:type/rdfs:subClassOf* am:TechnologyLayerElement .
} UNION {
$this rdf:type/rdfs:subClassOf* am:PhysicalLayerElement .
}
}
SELECT $this WHERE { $this am:aggregates $this . }
SELECT $this WHERE { $this am:composedOf $this . }
SELECT $this WHERE { $this am:specializes $this . }
SELECT $this WHERE {
{
?a ?rel1 $this .
?b ?rel2 $this .
} UNION {
$this ?rel1 ?a .
$this ?rel2 ?b .
} UNION {
?a ?rel1 $this .
$this ?rel2 ?b .
}
?rel1 rdfs:subPropertyOf* am:composedOf .
FILTER NOT EXISTS {
?rel2 rdfs:subPropertyOf* am:composedOf .
}
FILTER(?rel1 != ?rel2)
}
SELECT $this WHERE {
$this am:assignedTo ?target .
$this rdf:type/rdfs:subClassOf* am:PhysicalLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:ActiveStructureElement .
}
}
SELECT $this WHERE {
?source am:assignedTo $this .
$this rdf:type/rdfs:subClassOf* am:PhysicalLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:ActiveStructureElement .
}
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:PassiveStructureElement .
}
}
SELECT $this ?target WHERE {
$this am:serves ?target .
{
$this rdf:type/rdfs:subClassOf* am:BusinessLayerElement .
?target rdf:type/rdfs:subClassOf* am:ApplicationLayerElement .
} UNION {
$this rdf:type/rdfs:subClassOf* am:BusinessLayerElement .
?target rdf:type/rdfs:subClassOf* am:TechnologyLayerElement .
} UNION {
$this rdf:type/rdfs:subClassOf* am:ApplicationLayerElement .
?target rdf:type/rdfs:subClassOf* am:TechnologyLayerElement .
}
}
SELECT $this ?target WHERE {
$this am:specializes ?target .
$this rdf:type ?sourceType .
?target rdf:type ?targetType .
?sourceType rdfs:subClassOf* arch:Element .
?targetType rdfs:subClassOf* arch:Element .
FILTER NOT EXISTS {
$this rdf:type ?commonType .
?target rdf:type ?commonType .
?commonType rdfs:subClassOf* arch:Element .
}
}
SELECT $this ?target WHERE {
$this am:assignedTo ?target .
$this rdf:type/rdfs:subClassOf* am:StructureElement .
$this rdf:type/rdfs:subClassOf* am:StrategyLayerElement .
?target rdf:type/rdfs:subClassOf* am:StrategyLayerElement .
FILTER NOT EXISTS {
{ ?target a am:Capability . }
UNION
{ ?target a am:ValueStream . }
}
}
SELECT $this ?target WHERE {
$this am:realizes ?target .
$this a am:CourseOfAction .
{
?target a am:Capability .
} UNION {
?target a am:ValueStream .
}
}
SELECT $this ?target WHERE {
$this am:realizes ?target .
$this rdf:type/rdfs:subClassOf* am:StrategyLayerElement .
FILTER NOT EXISTS {
?target rdf:type/rdfs:subClassOf* am:StrategyLayerElement .
}
FILTER NOT EXISTS {
?target rdf:type/rdfs:subClassOf* am:MotivationElement .
}
FILTER NOT EXISTS {
?target a am:Grouping .
}
}
SELECT $this WHERE {
$this am:triggers ?target .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:BehaviorElement .
}
}
SELECT $this WHERE {
?source am:triggers $this .
$this rdf:type/rdfs:subClassOf* am:CoreLayerElement .
FILTER NOT EXISTS {
$this rdf:type/rdfs:subClassOf* am:BehaviorElement .
}
}