SHACL Shapes
https://meta.linked.archi/archimate4/principle-shapes#
SHACL shapes encoding common enterprise architecture principles as executable constraints. Adapted from 3.2 principle shapes for ArchiMate 4.0 domain-based structure.
SELECT $this
WHERE {
$this a am4:ApplicationComponent .
FILTER NOT EXISTS {
{ ?owner am4:associatedWith $this . } UNION { $this am4:associatedWith ?owner . }
{ ?owner a am4:BusinessActor . } UNION { ?owner a am4:Role . }
}
}
SELECT $this
WHERE {
$this a am4:ApplicationComponent .
FILTER NOT EXISTS {
$this am4:realizes ?svc .
?svc a am4:Service .
}
}
SELECT $this ?tech
WHERE {
$this a am4:Process .
# Business: performed by a business actor, directly or through a role.
FILTER EXISTS {
?actor a am4:BusinessActor .
{ ?actor am4:assignedTo $this . }
UNION
{ ?actor am4:assignedTo ?role . ?role a am4:Role ; am4:assignedTo $this . }
}
{
?tech am4:serves $this .
} UNION {
?tech am4:realizes $this .
}
?tech rdf:type/rdfs:subClassOf* am4:TechnologyDomainElement .
}
SELECT $this
WHERE {
$this a am4:Capability .
FILTER NOT EXISTS {
?behavior am4:realizes $this .
?behavior rdf:type/rdfs:subClassOf* am4:BehaviorElement .
}
}
SELECT $this
WHERE {
$this a am4:Capability .
FILTER NOT EXISTS {
{
$this am4:realizes ?goal .
{ ?goal a am4:Goal . } UNION { ?goal a am4:Outcome . }
} UNION {
?goal am4:serves $this .
{ ?goal a am4:Goal . } UNION { ?goal a am4:Outcome . }
} UNION {
$this am4:associatedWith ?goal .
{ ?goal a am4:Goal . } UNION { ?goal a am4:Outcome . }
}
}
}
PREFIX am4: <https://meta.linked.archi/archimate4/onto#>
SELECT $this (COUNT(?parent) AS ?parentCount)
WHERE {
?parent am4:composedOf $this .
}
GROUP BY $this
HAVING (COUNT(?parent) > 1)
SELECT $this ?node
WHERE {
$this a am4:ApplicationComponent .
# Deployed on a node: the node realizes the component, or is assigned to an
# artifact or system software that does.
?node (am4:realizes|am4:assignedTo/am4:realizes) $this .
?node a am4:Node .
FILTER NOT EXISTS {
?node2 (am4:realizes|am4:assignedTo/am4:realizes) $this .
?node2 a am4:Node .
FILTER(?node2 != ?node)
}
}
SELECT $this
WHERE {
$this a am4:DataObject .
FILTER NOT EXISTS {
?app a am4:ApplicationComponent .
{
?app am4:accesses $this .
} UNION {
?app am4:assignedTo $this .
}
}
}
SELECT $this ?target
WHERE {
$this a am4:ApplicationComponent .
$this am4:serves ?target .
?target a am4:ApplicationComponent .
}
SELECT $this (COUNT(DISTINCT ?node) AS ?nodeCount)
WHERE {
$this a am4:Service .
?app am4:realizes $this .
?app a am4:ApplicationComponent .
# Technology it depends on: serving or realizing the component, or hosting
# what realizes it (a node assigned to an artifact or system software).
?node (am4:serves|am4:realizes|am4:assignedTo/am4:realizes) ?app .
?node rdf:type/rdfs:subClassOf* am4:TechnologyDomainElement ,
am4:ActiveStructureElement .
}
GROUP BY $this
HAVING (COUNT(DISTINCT ?node) > 3)
SELECT $this ?app1 ?app2
WHERE {
$this a am4:Function .
?app1 a am4:ApplicationComponent ;
am4:assignedTo $this .
?app2 a am4:ApplicationComponent ;
am4:assignedTo $this .
FILTER(STR(?app1) < STR(?app2))
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this
WHERE {
$this a/rdfs:subClassOf* arch:Element .
# MINUS, not FILTER NOT EXISTS: the same results, without testing every
# element against every other one — which grows with the square of the model.
MINUS { $this ?p ?other . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
MINUS { ?other ?p $this . ?other a ?otherType . ?otherType rdfs:subClassOf* arch:Element . }
}
SELECT $this ?app1 ?app2
WHERE {
$this a am4:Process .
?app1 a am4:ApplicationComponent ;
am4:assignedTo $this .
?app2 a am4:ApplicationComponent ;
am4:assignedTo $this .
FILTER(STR(?app1) < STR(?app2))
}
SELECT $this
WHERE {
$this a am4:Process .
FILTER NOT EXISTS {
?performer am4:assignedTo $this .
?performer rdf:type/rdfs:subClassOf* am4:ActiveStructureElement .
}
}
SELECT $this (COUNT(DISTINCT ?comp) AS ?count) WHERE {
?comp am4:realizes $this .
?comp rdf:type/rdfs:subClassOf* am4:InternalActiveStructureElement .
}
GROUP BY $this
HAVING (COUNT(DISTINCT ?comp) > 1)
SELECT $this ?app1 ?app2
WHERE {
$this a am4:Service .
?app1 a am4:ApplicationComponent ;
am4:realizes $this .
?app2 a am4:ApplicationComponent ;
am4:realizes $this .
FILTER(STR(?app1) < STR(?app2))
}
SELECT $this ?app1 ?app2
WHERE {
$this a am4:Function .
?app1 a am4:ApplicationComponent ;
am4:serves $this .
?app2 a am4:ApplicationComponent ;
am4:serves $this .
FILTER(STR(?app1) < STR(?app2))
}
SELECT $this
WHERE {
$this a am4:Requirement .
FILTER NOT EXISTS {
?element am4:realizes $this .
FILTER NOT EXISTS {
?element rdf:type/rdfs:subClassOf* am4:MotivationElement .
}
}
}
SELECT $this
WHERE {
$this a am4:Service .
FILTER NOT EXISTS {
?realizer am4:realizes $this .
}
}
SELECT $this ?app1 ?app2
WHERE {
$this a am4:BusinessObject .
?app1 a am4:ApplicationComponent ;
am4:accesses $this .
?app2 a am4:ApplicationComponent ;
am4:accesses $this .
FILTER(STR(?app1) < STR(?app2))
}
SELECT DISTINCT $this ?app1 ?app2
WHERE {
$this a am4:DataObject .
# A writer: write or read/write access, or an access not stated to be a read.
?app1 a am4:ApplicationComponent .
{
?app1 am4:accesses $this .
FILTER NOT EXISTS { ?read1 a am4:ReadAccess ; arch:source ?app1 ; arch:target $this . }
} UNION {
?write1 a ?kind1 ; arch:source ?app1 ; arch:target $this .
FILTER(?kind1 IN (am4:WriteAccess, am4:ReadWriteAccess))
}
?app2 a am4:ApplicationComponent .
{
?app2 am4:accesses $this .
FILTER NOT EXISTS { ?read2 a am4:ReadAccess ; arch:source ?app2 ; arch:target $this . }
} UNION {
?write2 a ?kind2 ; arch:source ?app2 ; arch:target $this .
FILTER(?kind2 IN (am4:WriteAccess, am4:ReadWriteAccess))
}
FILTER(STR(?app1) < STR(?app2))
}
SELECT $this ?app
WHERE {
$this a am4:Service .
?app am4:realizes $this .
?app a am4:ApplicationComponent .
FILTER NOT EXISTS {
?app2 am4:realizes $this .
?app2 a am4:ApplicationComponent .
FILTER(?app2 != ?app)
}
}
SELECT $this ?biz
WHERE {
$this a am4:Node .
$this am4:serves ?biz .
?biz rdf:type/rdfs:subClassOf* am4:BusinessDomainElement .
}