+
+ private static class StructuralOverrideDataWalkRequest
+ extends TernaryRead<Variable, Resource, Resource, StructuralOverrideData> {
+
+ public StructuralOverrideDataWalkRequest(Variable component, Resource actualRepresents, Resource actualType) {
+ super(component, actualRepresents, actualType);
+ }
+
+ @Override
+ public StructuralOverrideData perform(ReadGraph graph) throws DatabaseException {
+ Variable component = parameter;
+ Resource actualRepresents = parameter2;
+ Resource actualType = parameter3;
+// System.err.println(component.getURI(graph));
+ Resource represents = component.getPossibleRepresents(graph);
+ if (represents != null) {
+ Layer0 L0 = Layer0.getInstance(graph);
+ StructuralResource2 STR = StructuralResource2.getInstance(graph);
+ Resource container = graph
+ .syncRequest(new PossibleObjectWithType(represents, L0.PartOf, STR.Composite));
+ if (container != null) {
+ Map<Resource, Resource> overrides = graph.syncRequest(new StructuralTypeOverrideMap(container), TransientCacheListener.instance());
+ Resource override = overrides.get(actualType);
+ if (override != null) {
+ return new StructuralOverrideData(actualRepresents, actualType, override);
+ }
+ }
+ }
+ Variable parent = component.getParent(graph);
+ if (parent == null)
+ return new StructuralOverrideData(actualRepresents, actualType, null);
+ else
+ return graph.syncRequest(new StructuralOverrideDataWalkRequest(parent, represents, actualType), TransientCacheListener.instance());
+ }
+
+ }
+