Access to underlying service instances for advanced usage
Get network summary using V3 API
Retrieves comprehensive summary information for a network including metadata, statistics, permissions, and other network properties using the V3 API.
The UUID of the network to get summary for
Access options including optional access key for private networks
Promise resolving to NetworkSummaryV3 object containing network summary information
Update network summary using V3 to V2 transformation
Updates network summary information by accepting a NetworkSummaryV3 object, transforming it to the V2 format, and calling the V2 API endpoint. This provides a unified interface for updating network summaries while maintaining compatibility with the existing V2 backend infrastructure.
The UUID of the network to update
The updated network summary in V3 format
Promise that resolves when the update is complete
// Update network summary using V3 format
const summaryV3: NetworkSummaryV3 = {
externalId: '12345678-1234-1234-1234-123456789abc',
name: 'Updated Network Name',
description: 'Updated network description',
nodeCount: 150,
edgeCount: 200,
visibility: 'PUBLIC',
owner: 'username',
ownerUUID: 'user-uuid',
creationTime: 1234567890,
modificationTime: 1234567890,
isReadOnly: false,
isValid: true,
hasLayout: true,
hasSample: false,
updatedBy: 'username',
properties: {
category: { t: 'string', v: 'biological' },
version: { t: 'double', v: 2.1 }
}
};
await client.networks.updateNetworkSummary('network-uuid', summaryV3);
Get network in CX1 format (V2 API)
Get network in CX2 format (V3 API)
Delete network
The UUID of the network to delete
If true, permanently delete the network. If false (default), soft delete to trash for 30 days
Create network DOI
Requests a DOI (Digital Object Identifier) for a network. A reference is not required to request a DOI.
If you want the ability to add or modify a reference later on, set isCertified to true.
When certified, the network will be permanently locked, made publicly visible, and no further changes
will be allowed.
DOI request parameters
UUID of the network to create a DOI for
If true, network will be permanently locked and made public with no further changes allowed
Email address that the DOI creation confirmation should be sent to
Promise that resolves when the DOI request is submitted
// Request a DOI for a network without certification
await client.networks.createNetworkDOI({
networkId: '12345678-1234-1234-1234-123456789abc',
isCertified: false,
contactEmail: 'user@example.com'
});
// Request a certified DOI (network will be permanently locked)
await client.networks.createNetworkDOI({
networkId: '12345678-1234-1234-1234-123456789abc',
isCertified: true,
contactEmail: 'user@example.com'
});
Get attributes of selected nodes
Retrieves specific attributes for a set of nodes in a network. The server will return a 404 error if the network has no attributes on nodes.
The UUID of the network
Object containing node IDs and attribute names to retrieve
Array of node IDs (long numbers) to get attributes for
Array of attribute names to retrieve
Access options including optional access key
Promise resolving to a JSON object where keys are stringified node IDs and values are the selected attributes for that node
Neighborhood query (migrated from original NDEx.js)
Performs a neighborhood search within a network, returning nodes and edges within the specified search depth from nodes matching the search terms. Can return either raw CX1 or CX2 format based on outputCX2 parameter.
The UUID of the network to search
Search string to find starting nodes
OptionalsaveResult: booleanWhether to save the query result as a new network
Optionalparameters: {Additional query parameters
OptionalsearchDepth?: numberHow many hops to search (default: 1)
OptionaledgeLimit?: numberMaximum number of edges to return
OptionalerrorWhenLimitIsOver?: booleanThrow error if edge limit exceeded
OptionaldirectOnly?: booleanOnly include direct connections
OptionalnodeIds?: number[]Specific node IDs to start search from
If true, return CX2 format via V3 API; if false, return CX1 format via V2 API
Promise resolving to raw CX1 or CX2 network data
Interconnect query (migrated from original NDEx.js)
Finds connections between nodes matching the search terms within a network. Returns the interconnected subnetwork as either raw CX1 or CX2 format. Can return either raw CX1 or CX2 format based on outputCX2 parameter.
The UUID of the network to search
Search string to find nodes to interconnect
OptionalsaveResult: booleanWhether to save the query result as a new network
Optionalparameters: { edgeLimit?: number; errorWhenLimitIsOver?: boolean; nodeIds?: number[] }Additional query parameters
OptionaledgeLimit?: numberMaximum number of edges to return
OptionalerrorWhenLimitIsOver?: booleanThrow error if edge limit exceeded
OptionalnodeIds?: number[]Specific node IDs to find connections between
If true, return CX2 format via V3 API; if false, return CX1 format via V2 API
Promise resolving to raw CX1 or CX2 network data
Get network permissions by UUIDs (migrated from original NDEx.js)
Retrieves network permissions for multiple networks in a single batch request. Uses the V2 API batch endpoint to efficiently get permission information.
Array of network UUIDs to retrieve permissions for
Promise resolving to permission information for the specified networks
Export networks (migrated from original NDEx.js)
Creates an export job for networks using the V2 batch export endpoint. This allows exporting multiple networks in various formats.
Export job configuration specifying networks and format
Promise resolving to export job result
Move networks to folder (migrated from original NDEx.js)
Moves multiple networks to a specified folder using the V3 API. This is a V3-specific feature for organizing networks in folders.
Array of network IDs to move
OptionalfolderId: stringTarget folder ID to move networks to
Promise resolving when networks are moved
Set visibility for multiple files (networks, folders, shortcuts)
Changes visibility settings for multiple NDEx objects using the V3 API. This function can update visibility for any combination of networks, folders, and shortcuts. Files are validated to ensure proper UUID format and valid file types.
Object containing a 'files' property with UUID-to-filetype mappings
Record where keys are UUIDs and values are NDExFileType ('NETWORK', 'FOLDER', or 'SHORTCUT')
Visibility setting: 'PUBLIC', 'PRIVATE', or 'UNLISTED'
Promise resolving when visibility is successfully updated
// Set multiple files to public visibility
await client.networks.setNetworksVisibility({
files: {
'12345678-1234-1234-1234-123456789abc': 'NETWORK',
'87654321-4321-4321-4321-876543210fed': 'FOLDER',
'11111111-2222-3333-4444-555555555555': 'SHORTCUT'
}
}, 'PUBLIC');
// Set networks to private visibility
await client.networks.setNetworksVisibility({
files: {
'network-uuid-1': 'NETWORK',
'network-uuid-2': 'NETWORK'
}
}, 'PRIVATE');
Get network access key
Retrieves the access key for a network if it has been enabled for public access. When a network has an access key enabled, it can be accessed by others without explicit permissions using this key.
The UUID of the network to get the access key for
Promise resolving to an object with accessKey property when enabled, or null when access key is not enabled on this network
// Check if network has an access key
const result = await client.networks.getNetworkAccessKey('12345678-1234-1234-1234-123456789abc');
if (result) {
console.log('Access key:', result.accessKey); // "sdfdfdfsdfdsfs"
// Use the access key to access the network
const networkData = await client.networks.getRawCX2Network(networkUUID, { accessKey: result.accessKey });
} else {
console.log('No access key enabled for this network');
}
Get random edges from network (migrated from original NDEx.js)
Retrieves a random sample of edges from a network using the V3 API. This is useful for previewing large networks or sampling edge data.
The UUID of the network to get edges from
Number of random edges to retrieve (must be greater than 0)
OptionalaccessKey: stringOptional access key for private networks
Promise resolving to array of CX2Edge objects
Get aspect elements (migrated from original NDEx.js)
Retrieves elements from a specific aspect of a network using the V3 API. This function can be used to get nodes, edges, or other aspect data with optional size limiting and access key support for private networks.
The UUID of the network to get aspect elements from
Name of the aspect to retrieve (e.g., 'nodes', 'edges', 'networkAttributes')
Optionallimit: numberOptional maximum number of elements to return
OptionalaccessKey: stringOptional access key for private networks
Promise resolving to array of aspect elements
Get filtered edges (migrated from original NDEx.js)
Retrieves edges from a network that match specific filtering criteria on a column value. The function supports both CX1 and CX2 formats based on the format parameter, with CX2 being the default format used by the server.
The UUID of the network to get filtered edges from
Name of the edge attribute column to filter on
Value to filter by (converted to string for comparison)
Filtering operation: '>' | '<' | '=' | '!='
Optionallimit: numberOptional maximum number of edges to return (default: -1 = all matching edges)
Optionalorder: "asc" | "desc"Optional sort order for edges before applying limit: 'asc' | 'desc' (default: 'desc')
Optionalformat: "cx2" | "cx"Optional output format: 'cx' | 'cx2' (default: 'cx2')
OptionalaccessKey: stringOptional access key for private networks
Promise resolving to array of edges in the specified format
// Get edges with weight > 0.5 in CX2 format (default)
const cx2Edges = await client.networks.getFilteredEdges(
'network-uuid', 'weight', '0.5', '>'
);
// Get top 10 edges with highest score in CX1 format
const cx1Edges = await client.networks.getFilteredEdges(
'network-uuid', 'score', '0', '>', 10, 'desc', 'cx'
);
// Get edges where interaction equals 'pp'
const ppEdges = await client.networks.getFilteredEdges(
'network-uuid', 'interaction', 'pp', '=', undefined, undefined, 'cx2'
);
Get CX2 metadata (migrated from original NDEx.js)
Retrieves metadata information for all aspects in a CX2 network format. This function provides aspect metadata including element counts for each aspect in the network using the V3 API.
The UUID of the network to get CX2 metadata for
OptionalaccessKey: stringOptional access key for private networks
Promise resolving to array of CX2MetaData objects
// Get CX2 metadata for a network
const metaData = await client.networks.getCX2MetaData('network-uuid');
console.log(metaData); // [{ name: 'nodes', elementCount: 100 }, { name: 'edges', elementCount: 150 }]
// Get CX2 metadata for a private network
const privateMetaData = await client.networks.getCX2MetaData('private-network-uuid', 'access-key');
Create network from raw CX2 data (migrated from original NDEx.js)
Creates a new network on NDEx from raw CX2 data using the V3 API. This function delegates to the NetworkServiceV3 implementation.
Raw CX2 network data as an object or CX2Network instance
Creation options including visibility and folderId
Optionalvisibility?: VisibilityNetwork visibility: 'PUBLIC', 'PRIVATE', or 'UNLISTED' (default: 'PRIVATE')
OptionalfolderId?: stringUUID of the folder to create the network in. If omitted, network is created in user's home directory
Promise resolving to NDExObjectUpdateStatus with uuid and modificationTime
// Create private network from raw CX2 data in user's home directory
const result = await client.networks.createNetworkFromRawCX2(cx2Data);
console.log(result.uuid); // "12345678-1234-1234-1234-123456789abc"
// Create public network from raw CX2 data in a specific folder
const publicResult = await client.networks.createNetworkFromRawCX2(cx2Data, {
visibility: 'PUBLIC' as Visibility,
folderId: '87654321-4321-4321-4321-876543210fed'
});
console.log(publicResult.uuid);
Update network from raw CX2 data (migrated from original NDEx.js)
Updates an existing network with new raw CX2 data using the V3 API. This function replaces the entire network content with the provided CX2 data.
The UUID of the network to update
Raw CX2 network data as an object or CX2Network instance
Promise resolving when the network update is complete
Set read-only flag on a network
Sets or unsets the read-only flag for a network using the V2 API. When a network is marked as read-only, it cannot be modified.
The UUID of the network to modify
true to set the network as read-only, false to allow modifications
Promise resolving when the read-only status is updated
UnifiedNetworkService - Provides access to both V2/V3 network services Allows individual function calls to choose between v2 and v3 APIs