Skip to content

Commit 9a5c116

Browse files
committed
fix (KnowledgeGraph.js): exclude Main namespace from node labels in graphs
1 parent 503f079 commit 9a5c116

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

resources/KnowledgeGraph.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,10 @@ ${propertyOptions}|show-property-type=true
10621062
const rawLabel = valueItem;
10631063
const labelWithoutHash = rawLabel.split('#')[0];
10641064
displayLabel = labelWithoutHash.replaceAll('_', ' ');
1065-
displayLabel = nsName ? `${nsName}:${displayLabel}` : displayLabel;
1065+
1066+
if (nsName && nsName !== 'Main') {
1067+
displayLabel = `${nsName}:${displayLabel}`;
1068+
}
10661069
} else {
10671070
const rawLabel = valueItem;
10681071
const labelWithoutHash = rawLabel.split('#')[0];
@@ -1089,7 +1092,7 @@ ${propertyOptions}|show-property-type=true
10891092
const shortLabel = normalizedLabel.includes(':') ? normalizedLabel.split(':')[1].trim() : normalizedLabel;
10901093
const normalizedDisplay = displayLabel.replace(/\s+/g, ' ').trim();
10911094
const count = displayLabel.split(':').length - 1;
1092-
return normalizedDisplay.includes(shortLabel) && count === 1 && n.typeID === typeID;
1095+
return normalizedDisplay.includes(shortLabel) && n.typeID === typeID;
10931096
});
10941097

10951098
const nodeId = existingNode ? existingNode.id : KnowledgeGraphFunctions.makeNodeId(displayLabel, typeID);

0 commit comments

Comments
 (0)