if (templateNode != null) {
Resource isConnectedTo = graph.getPossibleInverse(toNode.getPredicate());
if (isConnectedTo != null) {
- Resource templateConnector = graph.getPossibleObject(templateNode, isConnectedTo);
- if (templateConnector != null) {
+ for (Resource templateConnector : graph.getObjects(templateNode, isConnectedTo)) {
Resource connectionOfTemplateConnector = ConnectionUtil.tryGetConnection(graph, templateConnector);
if (sourceConnection.equals(connectionOfTemplateConnector)) {
s2t.put(templateConnector, targetConnector);