Variable firstRepresentedParent = findFirstParentWithRepresentation(graph, parameter, STR);
if (firstRepresentedParent == null)
return null;
- Resource realParentComposite = graph.getPossibleObject(firstRepresentedParent.getRepresents(graph), L0.PartOf);
- if (realParentComposite == null)
- return null;
- isInsideStructure = graph.hasStatement(realParentComposite, STR.Defines);
+ Resource representedParent = firstRepresentedParent.getRepresents(graph);
+ Resource representedParentType = graph.getPossibleType(representedParent, STR.Component);
+ if (representedParentType != null && graph.isInstanceOf(representedParentType, STR.ProceduralComponentType)) {
+ isInsideStructure = !parameter.equals(firstRepresentedParent);
+ } else {
+ Resource realParentComposite = graph.getPossibleObject(representedParent, L0.PartOf);
+ if (realParentComposite == null)
+ return null;
+ isInsideStructure = graph.hasStatement(realParentComposite, STR.Defines);
+ }
Variable firstParentComposite = findFirstParentComposite(graph, firstRepresentedParent, STR);
if (firstParentComposite != null) {