new node(in_idopt, in_labelopt, in_typesopt, in_inferred_typesopt) → {this}
Sublcass of bbop-graph.node for use with Noctua ideas and concepts.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
in_id |
String |
<optional> |
new id; otherwise new unique generated |
in_label |
String |
<optional> |
node "label" |
in_types |
Array |
<optional> |
list of Objects or strings--anything that can be parsed by class_expression |
in_inferred_types |
Array |
<optional> |
list of Objects or strings--anything that can be parsed by class_expression |
Returns:
- Type
- this
Methods
add_types(in_types, inferred_p) → {Boolean}
Add types to current types.
Parameters:
Parameters:
Name | Type | Description |
---|---|---|
in_types |
Object | raw JSON type objects |
inferred_p |
Boolean | whether or not the argument types are inferred |
Returns:
t|f
- Type
- Boolean
clone() → {node}
Get a fresh new copy of the current node (using bbop.clone for
metadata object).
Returns:
node
- Type
- node
get_type_by_id(type_id) → {type|null}
If extant, get the type by its unique identifier. This works for
both inferred and non-inferred types generally.
Parameters:
Name | Type | Description |
---|---|---|
type_id |
String | type id |
Returns:
type or null
- Type
- type | null
get_unique_inferred_types() → {Array}
Essentially, get all of the "uneditable" direct inferred types from
the reasoner that are not duplicated in the regular (editable)
types listing.
Returns originals.
Note: the matching here is awful and should be redone (going by
very lossy string rep).
Returns:
of {class_expression}
- Type
- Array
get_unique_inferred_types_with_all() → {Array}
Essentially, get all (the complete closure in this case) of the
"uneditable" inferred types from the reasoner that are not
duplicated in the regular (editable) types listing.
Returns originals.
Note: the matching here is awful and should be redone (going by
very lossy string rep).
Returns:
of {class_expression}
- Type
- Array
inferred_types() → {Array}
Get current inferred types; replace current inferred types.
Parameters:
Returns:
array of types
- Type
- Array
inferred_types_with_all() → {Array}
Get current inferred types with all; replace current inferred types.
Parameters:
Returns:
array of types
- Type
- Array
subgraph(subgraphopt) → {graph|null}
Get/set the "contained" subgraph. This subgraph is still considered
to be part of the graph, but is "hidden" under this node for most
use cases except serialization.
To put it another way, unless you specifically load this with a
specialized loader, it will remain unpopulated. During
serialization, it should be recursively walked and dumped.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
subgraph |
graph | null |
<optional> |
the subgraph to "hide" inside this individual in the graph, or null to reset it |
Returns:
contained subgraph
- Type
- graph | null
types() → {Array}
Get current types; replace current types.
Parameters:
Returns:
array of types
- Type
- Array