From 2b1de561c5073bddfb17334f6185625aad25acae Mon Sep 17 00:00:00 2001 From: Christiaan Scheermeijer Date: Wed, 24 Feb 2021 17:46:10 +0100 Subject: [PATCH] fix: multiple control actions generated when match query returns multiple items Fixes #138 --- src/commands/RequestControlActionCommand.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/RequestControlActionCommand.js b/src/commands/RequestControlActionCommand.js index 806c716..582a267 100644 --- a/src/commands/RequestControlActionCommand.js +++ b/src/commands/RequestControlActionCommand.js @@ -114,6 +114,7 @@ class RequestControlActionCommand { `MATCH (\`entryPoint\`:\`EntryPoint\` {\`identifier\`:"${requestInput.entryPointIdentifier}"})${this.queryHelper.generateRelationClause('EntryPoint', 'potentialAction')}(\`potentialControlAction\`:\`ControlAction\` {\`identifier\`:"${requestInput.potentialActionIdentifier}"})`, propertySelections ? `, ${propertySelections}` : '', `WITH \`entryPoint\`, \`potentialControlAction\`${nodeAliasesClause}`, + `LIMIT 1`, `CREATE (\`entryPoint\`)${this.queryHelper.generateRelationClause('ControlAction', 'target', null, true)}(\`controlAction\`:\`ControlAction\`:\`ActionInterface\`:\`ProvenanceActivityInterface\`:\`ProvenanceEntityInterface\`:\`ThingInterface\` {${this._generateControlActionPropertyClause(template.potentialAction)}})${this.queryHelper.generateRelationClause('ControlAction', 'wasDerivedFrom')}(\`potentialControlAction\`)`, `WITH \`entryPoint\`, \`potentialControlAction\`, \`controlAction\`${nodeAliasesClause}`, this._generateCreatePropertyValuesClause(template, requestInput),