This article covers the importance of Edge Labels and walks through the necessary setup to display them in your User Interface (UI).
What are Edge Labels?
A Network in the Quantexa UI consists of a collection of Nodes (Documents or Entities) and Edges representing a relationship between those Nodes. Edge Labels are added to display the relationship between the Nodes. Labels can be added to both Document-Entity and Entity-Entity Edges.
Edge Labels, if implemented, are enabled by default. They can be disabled in the Network Visualization Tool.
Figure 1. A typical Network for the Open Corporates Document
Why add Edge Labels?
It is not immediately obvious how an Entity is related to a Document without Edge Labels. This is particularly evident in Networks that contain more than one instance of an Entity type. Consider Figure 2. Who is the subject of the Dow Jones Document?
Figure 2. Network without Edge Labels. Who is the subject?
With the addition of Edge Labels, Tony Geoffret is clearly identified as the subject of the Dow Jones Document.
Figure 3. Network with Edge Labels.
Multiple Entities of the same type can be merged into a single Entity. For example, the Open Corporates Document-Entity Model can have up to three different addresses: subject, officer, or non-registered address. These relationships can be displayed through the configuration of Edge Labels, as seen in Figure 4.
Figure 4. Network with Edge Labels for a merged address Entity.
Labeling the relationship of addresses makes it clear to the end user that this single address is both the subject's and the officer's address.
Additionally, adding Edge Labels can be used to tighten Graph Scripting and Scoring logic. This reduces the number of Nodes considered in Graph Scripting expansions and Scoring traversal, which in turn improves performance.
How to add Edge Labels?
This section will show the steps required to add Edge Labels, using the address Entity in Open Corporates as a concrete example.
Take note of the name of the Attribute (addressType
). This name will be referred to in the Resolver JSON Configuration.
attributes: [
{
name: addressType
literal: "Subject Address"
type: String
startPaths: [opencorporate]
}
{
name: addressType
literal: "Non-Registered Address"
type: String
startPaths: [nonRegisteredAddress]
}
{
name: addressType
literal: "Officer Address"
type: String
startPaths: [officer]
}
]
Listing 1. address.qentity
Step 2: Define link Attribute under Entity definitions (linkAttributeConfiguration
) in the Resolver JSON Configuration
By default, the link Attribute label
will be used as the Edge Label.
"linkAttributeConfiguration": {
"aggregation": {
"label": {
"aggregation": "LegacyDistinctValues"
"attributeType": "String",
"attributeName": "addressType"
}
}
}
Listing 2.1. resolver-config.json with label
link Attribute using linkAttributeConfiguration
"linkAttributeDefinitions": {
"label": {
"aggregation": "DistinctValues"
"variableName": "addressType"
}
}
Listing 2.2. resolver-config.json with label
link Attribute using linkAttributeDefinitions
(Deprecated since Quantexa version 2.3)
Alternatively, you can define a different link Attribute name and edit the UI code to use that instead of label
. In this example, link Attribute addressType
is defined in the Resolver JSON Configuration and is referred to in the TypeScript code.
"linkAttributeConfiguration": {
"aggregation": {
"addressType": {
"aggregation": "DistinctValues"
"attributeType": "String",
"attributeName": "addressType"
}
}
}
Listing 2.3. resolver-config.json with addressType
link Attribute using linkAttributeConfiguration
"linkAttributeDefinitions": {
"addressType": {
"aggregation": "DistinctValues"
"variableName": "addressType"
}
}
Listing 2.4. resolver-config.json with addressType
link Attribute using linkAttributeDefinitions
(Deprecated since Quantexa 2.3)
In the TypeScript code, the addressType
attribute is concatenated and assigned to the label
property of the sigmaEdge
object in the toSigmaEdge
function.
function concatenateStrings(input: string | string[]): string {
if (Array.isArray(input)) {
return input.join(', ');
} else {
return input;
}
}
export function toSigmaEdge(edge: GraphEdge, investigation?: Investigation): SigmaEdge {
let sigmaEdge: SigmaEdge = {
id: edge.model.id,
label: edge.model.label,
source: edge.model.source,
target: edge.model.target,
size: edge.view.importance || 0.5,
type: edge.view.type || 'gap',
color: '#607994'
};
if (edge.model.attributes.addressType) sigmaEdge.label = concatenateStrings(edge.model.attributes.addressType)
return sigmaEdge;
}
Listing 2.5. investigation-network-view.ts with custom toSigmaEdge
function
If you have defined a different Edge Attribute name (addressType
), enable it in here.
Figure 5. Security Policy for the address Entity
After refreshing the UI, you should be able to open an Investigation and see the Edge Labels. Congratulations!
Additional information
An alternative to enabling Edge Attribute rules under Security Policies in the UI would be to recreate your database before launching the UI. Here are some Community posts discussing this:
- Attributes under linkAttributeDefinitions not displayed as edge labels
- Not able to customize edge detail
- How Do I Enable Edge Labels (linkAttributeDefinitions) For Document-Entity Links?
For additional information on customizing the appearance and presentation of the Edges, refer to the UI Investigation Network View Documentation.
📝Note: If you have registered for the Quantexa Community, you can also access the Documentation Site. If you have any issues accessing the Docs site please reach out to community@quantexa.com
Build information
Version 2.5.1, Nov 2023
Relevant Quantexa Versions
This article applies to the following Quantexa versions:
2.0.0 to 2.7.5
For more information on upgrading, please reach out to your TAP or Alliance Manager.