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
sourceandtargetusingUtil.source()andUtil.target(), respectively. - Check whether
sourceandtargetare valid URLs usingvalidator. - Extract the FQDNs of
sourceandtarget. - Extract the SLDs of
sourceandtargetusingtldjs. - Determine whether
ris a first-party or third-party request. Discard all first-party requests unless optionfirstParty === true. - In case option
sld === trueuse the extracted SLDs ofsourceandtargetas the node names. Use the FQDNs ofsourceandtargetotherwise. - Add nodes and edge using
Wdg.addNodeandWdg.addEdge.
| Name | Type | Description |
|---|---|---|
r | Object | An HTTP/S request retrieved from the |
options | Object | Options object passed by |