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/deepContains class for managing contains relationships
constructornew Contains(deep: any): ContainsType: object
Type: Deep
constructornew Deep(deep?: Deep): DeepCreates 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): DeepParameters:
value(any):
Gets a method implementation for this Deep instance
_method(name: string): anyParameters:
name(string):
Gets an iterator for this Deep instance's value, any Deep instance can be iterated in for of.
[iterator](): anyAdds a value to this Deep instance
add(args: any[]): anyParameters:
args(any[]):
Executes a callback for each value in this Deep instance
each(args: any[]): anyParameters:
args(any[]):
Emits an event from this Deep instance
emit(args: any[]): voidParameters:
args(any[]):
Expands input into a deep.Exp.
exp(input: any, selection: Deep): anyParameters:
input(any):selection(Deep):
Filters values in this Deep instance
filter(args: any[]): anyParameters:
args(any[]):
Finds a value in this Deep instance
find(args: any[]): anyParameters:
args(any[]):
Gets a value from this Deep instance
get(args: any[]): anyParameters:
args(any[]):
Checks if this Deep instance has a specific value
has(args: any[]): anyParameters:
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): stringParameters:
value(string):agent(Deep):
Returns a Deep instance containing a Set of nodes that have incoming links of the specified type
inof(type: Deep): DeepParameters:
type(Deep):
Determines the type of a value based on deep.Isable.
is(value: any): anyParameters:
value(any):
Checks if the given value is a Deep instance
isDeep(it: any): booleanParameters:
it(any):
Checks if the given value is a non-Deep value and not undefined
isValue(it: any): booleanParameters:
it(any):
Joins values in this Deep instance
join(args: any[]): anyParameters:
args(any[]):
Removes this Deep instance and all its references, also kill event emitting.
kill(): voidMaps over values in this Deep instance
map(args: any[]): anyParameters:
args(any[]):
Creates a new Deep instance of this type
new(value?: any): DeepParameters:
value(any):
Returns a Deep instance containing a Set of nodes that have outgoing links of the specified type
outof(type: Deep): DeepParameters:
type(Deep):
Reduces values in this Deep instance
reduce(args: any[]): anyParameters:
args(any[]):
Selects based on input criteria
select(input: any): anyParameters:
input(any):
Creates a new selection. Can be observed by selection.on(event => {}), and recalculated with selection.call();
selection(): anySets a value in this Deep instance
set(args: any[]): anyParameters:
args(any[]):
Sorts values in this Deep instance
sort(args: any[]): anyParameters:
args(any[]):
Converts this Deep instance to a string
toString(args: any[]): anyParameters:
args(any[]):
Checks if this Deep instance is of a specific type
typeof(check: any): anyParameters:
check(any):
Gets an array of all types in the type hierarchy up.
typeofs(array: any[]): anyParameters:
array(any[]):
Removes a value from this Deep instance
unset(args: any[]): anyParameters:
args(any[]):
Creates a new Deep instance of the appropriate type for a value
Value(value: any): anyParameters:
value(any):
Gets the primitive value of this Deep instance
valueOf(args: any[]): anyParameters:
args(any[]):
Wraps a value in a Deep instance if it isn't already, or returns existing Deep instance.
wrap(value?: any): anyParameters:
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(): IndexInternal 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): anyParameters:
key(any):
Retrieves or creates a Set for storing multiple values associated with a key
many(key: any): SetParameters:
key(any):
Associates a key with a value and maintains the reverse mapping
set(key: any, value: any): anyParameters:
key(any):value(any):
Removes the association between a key and its value
unset(key: any): voidParameters:
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(): MemoryInitializes 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