Deep is a powerful semantic computing framework that enables the creation and manipulation of semantic graphs. This API documentation covers the core functionality of the Deep framework.
npm install @deep-foundation/deep
Contains class for managing contains relationships
constructornew Contains(deep: any): Contains
Type: object
Type: Deep
constructornew Deep(deep?: Deep): Deep
Creates a new Deep instance with the given deep as the root agent Deep with memory index.
Type: boolean
Optional
Type: Deep
Type: Memory
Determines the Deep type of a given value
_is(value: any): Deep
Parameters:
value
(any
):
Gets a method implementation for this Deep instance
_method(name: string): any
Parameters:
name
(string
):
Gets an iterator for this Deep instance's value, any Deep instance can be iterated in for of.
[iterator](): any
Adds a value to this Deep instance
add(args: any[]): any
Parameters:
args
(any[]
):
Executes a callback for each value in this Deep instance
each(args: any[]): any
Parameters:
args
(any[]
):
Emits an event from this Deep instance
emit(args: any[]): void
Parameters:
args
(any[]
):
Expands input into a deep.Exp.
exp(input: any, selection: Deep): any
Parameters:
input
(any
):selection
(Deep
):
Filters values in this Deep instance
filter(args: any[]): any
Parameters:
args
(any[]
):
Finds a value in this Deep instance
find(args: any[]): any
Parameters:
args
(any[]
):
Gets a value from this Deep instance
get(args: any[]): any
Parameters:
args
(any[]
):
Checks if this Deep instance has a specific value
has(args: any[]): any
Parameters:
args
(any[]
):
Gets the deep.Id instance .to this Deep instance .from current this.deep agent. If no ID is set, one will be created.
id(value?: string, agent: Deep): string
Parameters:
value
(string
):agent
(Deep
):
Returns a Deep instance containing a Set of nodes that have incoming links of the specified type
inof(type: Deep): Deep
Parameters:
type
(Deep
):
Determines the type of a value based on deep.Isable.
is(value: any): any
Parameters:
value
(any
):
Checks if the given value is a Deep instance
isDeep(it: any): boolean
Parameters:
it
(any
):
Checks if the given value is a non-Deep value and not undefined
isValue(it: any): boolean
Parameters:
it
(any
):
Joins values in this Deep instance
join(args: any[]): any
Parameters:
args
(any[]
):
Removes this Deep instance and all its references, also kill event emitting.
kill(): void
Maps over values in this Deep instance
map(args: any[]): any
Parameters:
args
(any[]
):
Creates a new Deep instance of this type
new(value?: any): Deep
Parameters:
value
(any
):
Returns a Deep instance containing a Set of nodes that have outgoing links of the specified type
outof(type: Deep): Deep
Parameters:
type
(Deep
):
Reduces values in this Deep instance
reduce(args: any[]): any
Parameters:
args
(any[]
):
Selects based on input criteria
select(input: any): any
Parameters:
input
(any
):
Creates a new selection. Can be observed by selection.on(event => {}), and recalculated with selection.call();
selection(): any
Sets a value in this Deep instance
set(args: any[]): any
Parameters:
args
(any[]
):
Sorts values in this Deep instance
sort(args: any[]): any
Parameters:
args
(any[]
):
Converts this Deep instance to a string
toString(args: any[]): any
Parameters:
args
(any[]
):
Checks if this Deep instance is of a specific type
typeof(check: any): any
Parameters:
check
(any
):
Gets an array of all types in the type hierarchy up.
typeofs(array: any[]): any
Parameters:
array
(any[]
):
Removes a value from this Deep instance
unset(args: any[]): any
Parameters:
args
(any[]
):
Creates a new Deep instance of the appropriate type for a value
Value(value: any): any
Parameters:
value
(any
):
Gets the primitive value of this Deep instance
valueOf(args: any[]): any
Parameters:
args
(any[]
):
Wraps a value in a Deep instance if it isn't already, or returns existing Deep instance.
wrap(value?: any): any
Parameters:
value
(any
):
Index class provides a dual-indexing system for managing relationships between values. It maintains both one-to-one and one-to-many mappings between keys and values.
constructornew Index(): Index
Internal map for one-to-many relationships
Type: Map
Internal map for one-to-one relationships
Type: Map
Retrieves the value associated with a key
get(key: any): any
Parameters:
key
(any
):
Retrieves or creates a Set for storing multiple values associated with a key
many(key: any): Set
Parameters:
key
(any
):
Associates a key with a value and maintains the reverse mapping
set(key: any, value: any): any
Parameters:
key
(any
):value
(any
):
Removes the association between a key and its value
unset(key: any): void
Parameters:
key
(any
):
Memory class manages the internal state and relationships of Deep instances. It maintains indices for values, types, and relationships between nodes.
constructornew Memory(): Memory
Initializes a new Memory instance with empty indices for values, types, and relationships. Creates a new storage space for Deep instances.
Set containing all Deep instances in memory
Type: Set
Index for tracking outgoing relationships (from -> to)
Type: Index
Index for tracking incoming relationships (to -> from)
Type: Index
Index for managing type relationships between Deep instances
Type: Index
Index for storing and retrieving values associated with Deep instances
Type: Index