Skip to content

Commit 5c501b4

Browse files
author
Soroush Saffari
authored
Visualises only the most granular role when loading roleplayers #238
## What is the goal of this PR? When the `Load Roleplayers` is switched on in the Settings, the visualised role edges no longer include the roles that are played by the roleplayer indirectly (via role hierarchies). Instead, the only role edge that is visualised belongs to the most granular role played by that roleplayer. ## What are the changes implemented in this PR? - negates the roles that have a sub-role within the given relation
1 parent efc3eaf commit 5c501b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/renderer/components/shared/CanvasDataBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ const buildRPInstances = async (answers, currentData, shouldLimit, graknTx) => {
523523
const [graqlVar, instance] = answersGroup[j];
524524

525525
if (instance.isRelation() && await shouldVisualiseInstance(instance)) {
526-
let queryToGetRPs = `match $r id ${instance.id}; $r($rl: $rp); not { $rl type role; }; get $rp, $rl; offset 0; `;
526+
let queryToGetRPs = `match $r id ${instance.id}; $r($rl: $rp); not { $b sub $rl; $b != $rl; }; get $rp, $rl; offset 0; `;
527527
if (shouldLimit) queryToGetRPs += `limit ${QuerySettings.getNeighboursLimit()};`;
528528

529529
const answers = await (await graknTx.query(queryToGetRPs)).collect();

0 commit comments

Comments
 (0)