Graph Builder¶
This package provides are two type of graphs — the standard graph and the vis.js graph — for E-HowNet definitions.
Standard Graph¶
- class EhnStandardGraphBuilder
Generates graphs from E-HowNet definitions.
See also:
ehn.graph.standard.EhnStandardGraphBuilder
- __call__(root)¶
- Parameters
root (EhnParseNode) – The root parse node of a E-HowNet definition.
- Return type
- class EhnStandardGraph
See also:
ehn.graph.standard.EhnStandardGraph
- nodes: dict¶
A dictionary that maps the node ID (a random UUID or a coindex) to a list of parse nodes.
- edges: list¶
A list of triplets (subject node ID, predicate node ID, object node ID). The IDs are the keys in nodes.
- functions: list¶
A list of pairs (function node ID, argument node ID). The IDs are the keys in nodes. Note that different argument of a single function node will be listed separately.
- restrictions: list¶
A list of pairs (placeholder node ID, restriction node ID). The IDs are the keys in nodes.
- root_id: int¶
The ID of the root node in the definition.
Vis Graph¶
- class EhnVisGraphBuilder(definite_labels=None)
Generates graphs from E-HowNet definitions for vis.js.
See also:
ehn.graph.standard.EhnVisGraphBuilder
- Parameters
definite_labels (set) – a set of the labels of the definite concepts.
- __call__(root)¶
- Parameters
root (EhnParseNode) – The root parse node of a E-HowNet definition.
- Return type
EhnVisGraph
- class EhnVisGraph
Please refers vis.js’s documentation.
See also:
ehn.graph.standard.EhnVisGraph
- nodes: dict¶
The nodes.
- edges: list¶
The edges