new Wdg() → {Object}
Class Wdg
which stands for weighted directed graph.
A graph generated with graphology
. See graphology for more details.
- Type:
- Object
Members
(static, constant) graph :Object
Instance of a class Graph
from graphology
.
- Object
Methods
(static) addEdge(source, target, r)
Adds an edge from source
to target
to the graph instance. In case the edge already exists, the edge is updated.
Name | Type | Description |
---|---|---|
source | String | |
target | String | |
r | Object | An HTTP/S request retrieved from the |
(static) addNode(node, attrs)
Adds a node to the graph instance.
Name | Type | Description |
---|---|---|
node | String | |
attrs | Object | The attributes of the node. |
(static) attributes()
A method to compute the node attributes for a graph instance. NOTE: This method is called after all HTTP/S request have been processed using Wdg.process
.
(static) get()
A getter function to retrieve the graph instance.
Returns the graph instance.
(static) getEdge(source, target) → {Object}
A function to retrieve a specific edge between source
and target
.
Name | Type | Description |
---|---|---|
source | String | |
target | String |
Returns the requested edge in case it exists. Returns undefined
otherwise.
- Type:
- Object
(static) process(r, options)
A method to process a single HTTP/S request from the dataset. The processing includes the following steps:
- Extract
source
andtarget
usingUtil.source()
andUtil.target()
, respectively. - Check whether
source
andtarget
are valid URLs usingvalidator
. - Extract the FQDNs of
source
andtarget
. - Extract the SLDs of
source
andtarget
usingtldjs
. - Determine whether
r
is a first-party or third-party request. Discard all first-party requests unless optionfirstParty === true
. - In case option
sld === true
use the extracted SLDs ofsource
andtarget
as the node names. Use the FQDNs ofsource
andtarget
otherwise. - Add nodes and edge using
Wdg.addNode
andWdg.addEdge
.
Name | Type | Description |
---|---|---|
r | Object | An HTTP/S request retrieved from the |
options | Object | Options object passed by |