Preview
Preview Feature — This feature is currently in preview and under active development. APIs and functionality may change. We recommend testing thoroughly before using in production.
API Reference
Complete API reference for Ductape's graph database operations. This page provides a comprehensive overview of all available methods and their parameters.
For detailed guides and examples, see:
- Getting Started - Quick start guide
- Working with Nodes - Node operations
- Relationships - Managing connections
- Traversals & Pathfinding - Graph exploration
- Indexes & Constraints - Performance optimization
- Transactions - Data consistency
- Best Practices - Optimization patterns
Install the SDK
- TypeScript
- Java
- Go
- .NET
npm install @ductape/sdk@0.1.8
<dependency>
<groupId>app.ductape</groupId>
<artifactId>sdk</artifactId>
<version>0.1.8</version>
</dependency>
go get github.com/ductape/ductape/sdk/go@v0.1.8
dotnet add package Ductape.Sdk --version 0.1.8
The SDK includes all graph database drivers out of the box.
Initialize the SDK
- TypeScript
- Java
- Go
- .NET
import Ductape from '@ductape/sdk';
const ductape = new Ductape({
accessKey: 'your-access-key',
});
import app.ductape.sdk.Ductape;
import app.ductape.sdk.core.EnvType;
import app.ductape.sdk.core.RequestContext;
RequestContext auth = new RequestContext(null, null, null, null, 'your-access-key');
Ductape ductape = new Ductape(EnvType.PRODUCTION, auth);
import (
"context"
"github.com/ductape/ductape/sdk/go/core"
ductapesdk "github.com/ductape/ductape/sdk/go/ductape"
)
auth := core.NewRequestContext("", "", "", "", 'your-access-key')
client, err := ductapesdk.New(core.EnvProduction, auth)
if err != nil {
return err
}
using Ductape.Sdk;
using Ductape.Sdk.Core;
var auth = new RequestContext(null, null, null, null, 'your-access-key', null);
var ductape = new Ductape(EnvType.Production, auth);
Register a Graph Database
- TypeScript
- Java
- Go
- .NET
await ductape.graph.create({
name: 'Social Graph',
tag: 'social-graph',
type: 'neo4j',
description: 'Stores user relationships',
envs: [
{ slug: 'dev', connection_url: 'bolt://localhost:7687' },
{ slug: 'prd', connection_url: 'bolt://neo4j-prod:7687' },
],
});
ductape.graph.create(Map.of(
"name", "Social Graph",
"tag", "social-graph",
"type", "neo4j",
"description", "Stores user relationships",
envs: [
Map.of( "slug", "dev", "connection_url", "bolt://"localhost", 7687" ),
Map.of( "slug", "prd", "connection_url", "bolt://neo4j-"prod", 7687" ),
]
));
client.graph.create({
"name": "Social Graph",
"tag": "social-graph",
"type": "neo4j",
"description": "Stores user relationships",
envs: [
{ "slug": "dev", "connection_url": "bolt://"localhost": 7687" },
{ "slug": "prd", "connection_url": "bolt://neo4j-"prod": 7687" },
],
});
await ductape.graph.create({
["name"] = "Social Graph",
["tag"] = "social-graph",
["type"] = "neo4j",
["description"] = "Stores user relationships",
envs: [
{ ["slug"] = "dev", ["connection_url"] = "bolt://["localhost"] = 7687" },
{ ["slug"] = "prd", ["connection_url"] = "bolt://neo4j-["prod"] = 7687" },
],
});
Configuration Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
tag | string | Yes | Unique identifier |
type | string | Yes | neo4j, neptune, arangodb, or memgraph |
description | string | No | Description |
envs | array | Yes | Environment configurations |
Environment Config
| Field | Type | Description |
|---|---|---|
slug | string | Environment (dev, staging, prd) |
connection_url | string | Connection string |
database | string | Database name (ArangoDB) |
graphName | string | Graph name (ArangoDB) |
region | string | AWS region (Neptune) |
Connect to Graph Database
- TypeScript
- Java
- Go
- .NET
await ductape.graph.connect({
graph: 'social-graph',
});
ductape.graphs().connect(Map<String, Object>.of(
"graph", "social-graph"
));
import "context"
client.GraphAPI.Connect(ctx, map[string]any{
"graph": "social-graph",
});
await ductape.Graph.Connect(new Dictionary<string, object?>
{
["graph"] = "social-graph",
});
Once connected, all subsequent operations use this connection automatically.
Node Operations
Create Node
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.createNode({
labels: ['Person'],
properties: {
name: 'Alice',
email: 'alice@example.com',
age: 30,
},
});
console.log('Created node:', result.node.id);
Map<String, Object> result = ductape.graph.createNode(Map.of(
labels: ['Person'],
properties: Map.of(
"name", "Alice",
"email", "alice@example.com",
"age", 30
)
));
System.out.println('Created node:', result.node.id);
result := client.graph.createNode({
labels: ['Person'],
properties: {
"name": "Alice",
"email": "alice@example.com",
"age": 30,
},
});
fmt.Println('Created node:', result.node.id);
var result = await ductape.graph.createNode({
labels: ['Person'],
properties: {
["name"] = "Alice",
["email"] = "alice@example.com",
["age"] = 30,
},
});
Console.WriteLine('Created node:', result.node.id);
Find Nodes
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.findNodes({
labels: ['Person'],
where: { age: { $GT: 25 } },
limit: 10,
});
Map<String, Object> result = ductape.graph.findNodes(Map.of(
labels: ['Person'],
where: Map.of( age: Map.of( $"GT", 25 ) ),
"limit", 10
));
result := client.graph.findNodes({
labels: ['Person'],
where: { age: { $"GT": 25 } },
"limit": 10,
});
var result = await ductape.graph.findNodes({
labels: ['Person'],
where: { age: { $["GT"] = 25 } },
["limit"] = 10,
});
Find Node by ID
- TypeScript
- Java
- Go
- .NET
const node = await ductape.graph.findNodeById('node-id');
Map<String, Object> node = ductape.graph.findNodeById('node-id');
node := client.graph.findNodeById('node-id');
var node = await ductape.graph.findNodeById('node-id');
Update Node
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.updateNode({
id: 'node-id',
properties: { age: 31 },
});
Map<String, Object> result = ductape.graph.updateNode(Map.of(
"id", "node-id",
properties: Map.of( "age", 31 )
));
result := client.graph.updateNode({
"id": "node-id",
properties: { "age": 31 },
});
var result = await ductape.graph.updateNode({
["id"] = "node-id",
properties: { ["age"] = 31 },
});
Delete Node
- TypeScript
- Java
- Go
- .NET
await ductape.graph.deleteNode({
id: 'node-id',
detach: true, // Also delete connected relationships
});
ductape.graph.deleteNode(Map.of(
"id", "node-id",
"detach", true, // Also delete connected relationships
));
client.graph.deleteNode({
"id": "node-id",
"detach": true, // Also delete connected relationships
});
await ductape.graph.deleteNode({
["id"] = "node-id",
["detach"] = true, // Also delete connected relationships
});
Merge Node
Insert or update based on match criteria:
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.mergeNode({
labels: ['Person'],
matchProperties: { email: 'alice@example.com' },
onCreate: { name: 'Alice', createdAt: new Date() },
onMatch: { lastSeen: new Date() },
});
Map<String, Object> result = ductape.graph.mergeNode(Map.of(
labels: ['Person'],
matchProperties: Map.of( "email", "alice@example.com" ),
onCreate: Map.of( "name", "Alice", createdAt: Instant.now() ),
onMatch: Map.of( lastSeen: Instant.now() )
));
result := client.graph.mergeNode({
labels: ['Person'],
matchProperties: { "email": "alice@example.com" },
onCreate: { "name": "Alice", createdAt: new Date() },
onMatch: { lastSeen: new Date() },
});
var result = await ductape.graph.mergeNode({
labels: ['Person'],
matchProperties: { ["email"] = "alice@example.com" },
onCreate: { ["name"] = "Alice", createdAt: DateTime.UtcNow },
onMatch: { lastSeen: DateTime.UtcNow },
});
Relationship Operations
Create Relationship
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.createRelationship({
type: 'FRIENDS_WITH',
startNodeId: aliceId,
endNodeId: bobId,
properties: { since: 2020 },
});
Map<String, Object> result = ductape.graph.createRelationship(Map.of(
"type", "FRIENDS_WITH",
startNodeId: aliceId,
endNodeId: bobId,
properties: Map.of( "since", 2020 )
));
result := client.graph.createRelationship({
"type": "FRIENDS_WITH",
startNodeId: aliceId,
endNodeId: bobId,
properties: { "since": 2020 },
});
var result = await ductape.graph.createRelationship({
["type"] = "FRIENDS_WITH",
startNodeId: aliceId,
endNodeId: bobId,
properties: { ["since"] = 2020 },
});
Find Relationships
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.findRelationships({
type: 'FRIENDS_WITH',
startNodeId: aliceId,
});
Map<String, Object> result = ductape.graph.findRelationships(Map.of(
"type", "FRIENDS_WITH",
startNodeId: aliceId
));
result := client.graph.findRelationships({
"type": "FRIENDS_WITH",
startNodeId: aliceId,
});
var result = await ductape.graph.findRelationships({
["type"] = "FRIENDS_WITH",
startNodeId: aliceId,
});
Update Relationship
- TypeScript
- Java
- Go
- .NET
await ductape.graph.updateRelationship({
id: 'relationship-id',
properties: { closeness: 'high' },
});
ductape.graph.updateRelationship(Map.of(
"id", "relationship-id",
properties: Map.of( "closeness", "high" )
));
client.graph.updateRelationship({
"id": "relationship-id",
properties: { "closeness": "high" },
});
await ductape.graph.updateRelationship({
["id"] = "relationship-id",
properties: { ["closeness"] = "high" },
});
Delete Relationship
- TypeScript
- Java
- Go
- .NET
await ductape.graph.deleteRelationship({
id: 'relationship-id',
});
ductape.graph.deleteRelationship(Map.of(
"id", "relationship-id"
));
client.graph.deleteRelationship({
"id": "relationship-id",
});
await ductape.graph.deleteRelationship({
["id"] = "relationship-id",
});
Traversals & Paths
Traverse Graph
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.traverse({
startNodeId: aliceId,
direction: 'OUTGOING', // OUTGOING, INCOMING, or BOTH
relationshipTypes: ['FRIENDS_WITH'],
maxDepth: 3,
});
result.paths.forEach(path => {
console.log('Path:', path.nodes.map(n => n.properties.name));
});
Map<String, Object> result = ductape.graphs().traverse(Map<String, Object>.of(
startNodeId: aliceId,
"direction", "OUTGOING", // OUTGOING, INCOMING, or BOTH
relationshipTypes: ['FRIENDS_WITH'],
"maxDepth", 3
));
result.paths.forEach(path => Map.of(
System.out.println('Path:', path.nodes.map(n => n.properties.name));
));
result := client.graph.traverse({
startNodeId: aliceId,
"direction": "OUTGOING", // OUTGOING, INCOMING, or BOTH
relationshipTypes: ['FRIENDS_WITH'],
"maxDepth": 3,
});
result.paths.forEach(path => {
fmt.Println('Path:', path.nodes.map(n => n.properties.name));
});
var result = await ductape.graph.traverse({
startNodeId: aliceId,
["direction"] = "OUTGOING", // OUTGOING, INCOMING, or BOTH
relationshipTypes: ['FRIENDS_WITH'],
["maxDepth"] = 3,
});
result.paths.forEach(path => {
Console.WriteLine('Path:', path.nodes.map(n => n.properties.name));
});
Shortest Path
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.shortestPath({
startNodeId: aliceId,
endNodeId: charlieId,
relationshipTypes: ['FRIENDS_WITH'],
});
if (result.path) {
console.log('Distance:', result.path.length);
}
Map<String, Object> result = ductape.graph.shortestPath(Map.of(
startNodeId: aliceId,
endNodeId: charlieId,
relationshipTypes: ['FRIENDS_WITH']
));
if (result.path) Map.of(
System.out.println('Distance:', result.path.length);
)
result := client.graph.shortestPath({
startNodeId: aliceId,
endNodeId: charlieId,
relationshipTypes: ['FRIENDS_WITH'],
});
if (result.path) {
fmt.Println('Distance:', result.path.length);
}
var result = await ductape.graph.shortestPath({
startNodeId: aliceId,
endNodeId: charlieId,
relationshipTypes: ['FRIENDS_WITH'],
});
if (result.path) {
Console.WriteLine('Distance:', result.path.length);
}
All Paths
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.allPaths({
startNodeId: aliceId,
endNodeId: charlieId,
maxDepth: 5,
limit: 10,
});
Map<String, Object> result = ductape.graph.allPaths(Map.of(
startNodeId: aliceId,
endNodeId: charlieId,
"maxDepth", 5,
"limit", 10
));
result := client.graph.allPaths({
startNodeId: aliceId,
endNodeId: charlieId,
"maxDepth": 5,
"limit": 10,
});
var result = await ductape.graph.allPaths({
startNodeId: aliceId,
endNodeId: charlieId,
["maxDepth"] = 5,
["limit"] = 10,
});
Get Neighborhood
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.getNeighborhood({
nodeId: aliceId,
depth: 2,
direction: 'BOTH',
});
Map<String, Object> result = ductape.graph.getNeighborhood(Map.of(
nodeId: aliceId,
"depth", 2,
"direction", "BOTH"
));
result := client.graph.getNeighborhood({
nodeId: aliceId,
"depth": 2,
"direction": "BOTH",
});
var result = await ductape.graph.getNeighborhood({
nodeId: aliceId,
["depth"] = 2,
["direction"] = "BOTH",
});
Aggregations
Count Nodes
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.countNodes(['Person'], { status: 'active' });
console.log('Active persons:', result.count);
Map<String, Object> result = ductape.graph.countNodes(['Person'], Map.of( "status", "active" ));
System.out.println('Active persons:', result.count);
result := client.graph.countNodes(['Person'], { "status": "active" });
fmt.Println('Active persons:', result.count);
var result = await ductape.graph.countNodes(['Person'], { ["status"] = "active" });
Console.WriteLine('Active persons:', result.count);
Count Relationships
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.countRelationships(['FRIENDS_WITH']);
console.log('Friendships:', result.count);
Map<String, Object> result = ductape.graph.countRelationships(['FRIENDS_WITH']);
System.out.println('Friendships:', result.count);
result := client.graph.countRelationships(['FRIENDS_WITH']);
fmt.Println('Friendships:', result.count);
var result = await ductape.graph.countRelationships(['FRIENDS_WITH']);
Console.WriteLine('Friendships:', result.count);
Graph Statistics
- TypeScript
- Java
- Go
- .NET
const stats = await ductape.graph.getStatistics();
console.log('Total nodes:', stats.nodeCount);
console.log('Total relationships:', stats.relationshipCount);
Map<String, Object> stats = ductape.graph.getStatistics();
System.out.println('Total "nodes", ", stats.nodeCount);
System.out.println("Total relationships:', stats.relationshipCount);
stats := client.graph.getStatistics();
fmt.Println('Total "nodes": ", stats.nodeCount);
fmt.Println("Total relationships:', stats.relationshipCount);
var stats = await ductape.graph.getStatistics();
Console.WriteLine('Total ["nodes"] = ", stats.nodeCount);
Console.WriteLine("Total relationships:', stats.relationshipCount);
Search
Full-Text Search
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.fullTextSearch({
indexName: 'person_names',
query: 'alice',
limit: 10,
});
Map<String, Object> result = ductape.graph.fullTextSearch(Map.of(
"indexName", "person_names",
"query", "alice",
"limit", 10
));
result := client.graph.fullTextSearch({
"indexName": "person_names",
"query": "alice",
"limit": 10,
});
var result = await ductape.graph.fullTextSearch({
["indexName"] = "person_names",
["query"] = "alice",
["limit"] = 10,
});
Vector Search
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.vectorSearch({
indexName: 'embeddings',
vector: [0.1, 0.2, ...],
topK: 10,
});
Map<String, Object> result = ductape.graph.vectorSearch(Map.of(
"indexName", "embeddings",
vector: [0.1, 0.2, ...],
"topK", 10
));
result := client.graph.vectorSearch({
"indexName": "embeddings",
vector: [0.1, 0.2, ...],
"topK": 10,
});
var result = await ductape.graph.vectorSearch({
["indexName"] = "embeddings",
vector: [0.1, 0.2, ...],
["topK"] = 10,
});
Raw Queries
Execute native queries for your database:
- TypeScript
- Java
- Go
- .NET
// Cypher (Neo4j, Memgraph)
const result = await ductape.graph.query(
'MATCH (p:Person)-[:FRIENDS_WITH]->(f) WHERE p.name = $name RETURN f',
{ name: 'Alice' }
);
// Cypher (Neo4j, Memgraph)
Map<String, Object> result = ductape.graph.query(
'MATCH (p:Person)-[:FRIENDS_WITH]->(f) WHERE p.name = $name RETURN f',
Map.of( "name", "Alice" )
);
// Cypher (Neo4j, Memgraph)
result := client.graph.query(
'MATCH (p:Person)-[:FRIENDS_WITH]->(f) WHERE p.name = $name RETURN f',
{ "name": "Alice" }
);
// Cypher (Neo4j, Memgraph)
var result = await ductape.graph.query(
'MATCH (p:Person)-[:FRIENDS_WITH]->(f) WHERE p.name = $name RETURN f',
{ ["name"] = "Alice" }
);
Schema Management
Create Index
- TypeScript
- Java
- Go
- .NET
await ductape.graph.createNodeIndex({
name: 'idx_person_email',
label: 'Person',
properties: ['email'],
unique: true,
});
ductape.graph.createNodeIndex(Map.of(
"name", "idx_person_email",
"label", "Person",
properties: ['email'],
"unique", true
));
client.graph.createNodeIndex({
"name": "idx_person_email",
"label": "Person",
properties: ['email'],
"unique": true,
});
await ductape.graph.createNodeIndex({
["name"] = "idx_person_email",
["label"] = "Person",
properties: ['email'],
["unique"] = true,
});
Create Constraint
- TypeScript
- Java
- Go
- .NET
await ductape.graph.createNodeConstraint({
name: 'unique_person_email',
label: 'Person',
property: 'email',
type: 'UNIQUE',
});
ductape.graph.createNodeConstraint(Map.of(
"name", "unique_person_email",
"label", "Person",
"property", "email",
"type", "UNIQUE"
));
client.graph.createNodeConstraint({
"name": "unique_person_email",
"label": "Person",
"property": "email",
"type": "UNIQUE",
});
await ductape.graph.createNodeConstraint({
["name"] = "unique_person_email",
["label"] = "Person",
["property"] = "email",
["type"] = "UNIQUE",
});
List Indexes
- TypeScript
- Java
- Go
- .NET
const indexes = await ductape.graph.listIndexes();
Map<String, Object> indexes = ductape.graph.listIndexes();
indexes := client.graph.listIndexes();
var indexes = await ductape.graph.listIndexes();
Transactions
Callback API (Recommended)
- TypeScript
- Java
- Go
- .NET
const result = await ductape.graph.executeTransaction(async (transaction) => {
const alice = await ductape.graph.createNode({
labels: ['Person'],
properties: { name: 'Alice' },
}, transaction);
const bob = await ductape.graph.createNode({
labels: ['Person'],
properties: { name: 'Bob' },
}, transaction);
await ductape.graph.createRelationship({
type: 'FRIENDS_WITH',
startNodeId: alice.node.id,
endNodeId: bob.node.id,
}, transaction);
return { alice, bob };
});
Map<String, Object> result = ductape.graph.executeTransaction(async (transaction) => Map.of(
Map<String, Object> alice = ductape.graph.createNode(Map.of(
labels: ['Person'],
properties: Map.of( "name", "Alice" )
), transaction);
Map<String, Object> bob = ductape.graph.createNode(Map.of(
labels: ['Person'],
properties: Map.of( "name", "Bob" )
), transaction);
ductape.graph.createRelationship(Map.of(
"type", "FRIENDS_WITH",
startNodeId: alice.node.id,
endNodeId: bob.node.id
), transaction);
return Map.of( alice, bob );
));
result := client.graph.executeTransaction(async (transaction) => {
alice := client.graph.createNode({
labels: ['Person'],
properties: { "name": "Alice" },
}, transaction);
bob := client.graph.createNode({
labels: ['Person'],
properties: { "name": "Bob" },
}, transaction);
client.graph.createRelationship({
"type": "FRIENDS_WITH",
startNodeId: alice.node.id,
endNodeId: bob.node.id,
}, transaction);
return { alice, bob };
});
var result = await ductape.graph.executeTransaction(async (transaction) => {
var alice = await ductape.graph.createNode({
labels: ['Person'],
properties: { ["name"] = "Alice" },
}, transaction);
var bob = await ductape.graph.createNode({
labels: ['Person'],
properties: { ["name"] = "Bob" },
}, transaction);
await ductape.graph.createRelationship({
["type"] = "FRIENDS_WITH",
startNodeId: alice.node.id,
endNodeId: bob.node.id,
}, transaction);
return { alice, bob };
});
Manual Transaction
- TypeScript
- Java
- Go
- .NET
const transaction = await ductape.graph.beginTransaction();
try {
await ductape.graph.createNode({ ... }, transaction);
await ductape.graph.createRelationship({ ... }, transaction);
await transaction.commit();
} catch (error) {
await transaction.rollback();
throw error;
}
Map<String, Object> transaction = ductape.graph.beginTransaction();
try Map.of(
ductape.graph.createNode(Map.of( ... ), transaction);
ductape.graph.createRelationship(Map.of( ... ), transaction);
transaction.commit();
) catch (error) Map.of(
transaction.rollback();
throw error;
)
transaction := client.graph.beginTransaction();
try {
client.graph.createNode({ ... }, transaction);
client.graph.createRelationship({ ... }, transaction);
transaction.commit();
} catch (error) {
transaction.rollback();
throw error;
}
var transaction = await ductape.graph.beginTransaction();
try {
await ductape.graph.createNode({ ... }, transaction);
await ductape.graph.createRelationship({ ... }, transaction);
await transaction.commit();
} catch (error) {
await transaction.rollback();
throw error;
}
Disconnect
- TypeScript
- Java
- Go
- .NET
await ductape.graph.disconnect();
// Or disconnect all
await ductape.graph.disconnectAll();
ductape.graph.disconnect();
// Or disconnect all
ductape.graph.disconnectAll();
client.graph.disconnect();
// Or disconnect all
client.graph.disconnectAll();
await ductape.graph.disconnect();
// Or disconnect all
await ductape.graph.disconnectAll();
Provider Reference
Neo4j
Connection URL:
bolt://hostname:7687
bolt+s://hostname:7687 # with TLS
bolt://user:pass@hostname:7687 # with credentials
Query Language: Cypher
CREATE (p:Person {name: 'Alice', age: 30})
MATCH (p:Person) WHERE p.age > 25 RETURN p
MATCH (a:Person), (b:Person) WHERE a.name = 'Alice' AND b.name = 'Bob'
CREATE (a)-[:FRIENDS_WITH {since: 2020}]->(b)
AWS Neptune
Connection URL:
wss://cluster.region.neptune.amazonaws.com:8182/gremlin
https://cluster.region.neptune.amazonaws.com:8182/openCypher
Query Languages: Gremlin or openCypher
- TypeScript
- Java
- Go
- .NET
await ductape.graph.create({
name: 'Neptune Graph',
tag: 'neptune-graph',
type: 'neptune',
envs: [{
slug: 'prd',
connection_url: 'wss://cluster.us-east-1.neptune.amazonaws.com:8182/gremlin',
region: 'us-east-1',
}],
});
ductape.graph.create(Map.of(
"name", "Neptune Graph",
"tag", "neptune-graph",
"type", "neptune",
envs: [Map.of(
"slug", "prd",
"connection_url", "wss://cluster.us-east-1.neptune.amazonaws."com", 8182/gremlin",
"region", "us-east-1"
)]
));
client.graph.create({
"name": "Neptune Graph",
"tag": "neptune-graph",
"type": "neptune",
envs: [{
"slug": "prd",
"connection_url": "wss://cluster.us-east-1.neptune.amazonaws."com": 8182/gremlin",
"region": "us-east-1",
}],
});
await ductape.graph.create({
["name"] = "Neptune Graph",
["tag"] = "neptune-graph",
["type"] = "neptune",
envs: [{
["slug"] = "prd",
["connection_url"] = "wss://cluster.us-east-1.neptune.amazonaws.["com"] = 8182/gremlin",
["region"] = "us-east-1",
}],
});
ArangoDB
Connection URL:
http://hostname:8529
https://hostname:8529
http://user:pass@hostname:8529
Query Language: AQL
- TypeScript
- Java
- Go
- .NET
await ductape.graph.create({
name: 'ArangoDB Graph',
tag: 'arango-graph',
type: 'arangodb',
envs: [{
slug: 'dev',
connection_url: 'http://localhost:8529',
database: 'myapp',
graphName: 'social_graph',
}],
});
ductape.graph.create(Map.of(
"name", "ArangoDB Graph",
"tag", "arango-graph",
"type", "arangodb",
envs: [Map.of(
"slug", "dev",
"connection_url", "http://"localhost", 8529",
"database", "myapp",
"graphName", "social_graph"
)]
));
client.graph.create({
"name": "ArangoDB Graph",
"tag": "arango-graph",
"type": "arangodb",
envs: [{
"slug": "dev",
"connection_url": "http://"localhost": 8529",
"database": "myapp",
"graphName": "social_graph",
}],
});
await ductape.graph.create({
["name"] = "ArangoDB Graph",
["tag"] = "arango-graph",
["type"] = "arangodb",
envs: [{
["slug"] = "dev",
["connection_url"] = "http://["localhost"] = 8529",
["database"] = "myapp",
["graphName"] = "social_graph",
}],
});
Memgraph
Connection URL:
bolt://hostname:7687
bolt+ssc://hostname:7687 # with TLS
Query Language: Cypher (Neo4j compatible)
Memgraph includes MAGE library with pre-built graph algorithms:
CALL pagerank.get() YIELD node, rank
CALL community_detection.get() YIELD node, community_id
Error Handling
- TypeScript
- Java
- Go
- .NET
import { GraphError, GraphErrorType } from '@ductape/sdk';
try {
await ductape.graph.createNode({ ... });
} catch (error) {
if (error instanceof GraphError) {
switch (error.type) {
case GraphErrorType.CONNECTION_ERROR:
console.error('Cannot connect to graph database');
break;
case GraphErrorType.CONSTRAINT_ERROR:
console.error('Constraint violation');
break;
case GraphErrorType.QUERY_ERROR:
console.error('Query failed:', error.message);
break;
}
}
}
import Map.of( GraphError, GraphErrorType ) from '@ductape/sdk';
try Map.of(
ductape.graph.createNode(Map.of( ... ));
) catch (error) Map.of(
if (error instanceof GraphError) Map.of(
switch (error.type) Map.of(
case GraphErrorType.CONNECTION_ERROR:
console.error('Cannot connect to graph database');
break;
case GraphErrorType.CONSTRAINT_ERROR:
console.error('Constraint violation');
break;
case GraphErrorType.QUERY_ERROR:
console.error('Query failed:', error.message);
break;
)
)
)
import { GraphError, GraphErrorType } from '@ductape/sdk';
try {
client.graph.createNode({ ... });
} catch (error) {
if (error instanceof GraphError) {
switch (error.type) {
case GraphErrorType.CONNECTION_ERROR:
console.error('Cannot connect to graph database');
break;
case GraphErrorType.CONSTRAINT_ERROR:
console.error('Constraint violation');
break;
case GraphErrorType.QUERY_ERROR:
console.error('Query failed:', error.message);
break;
}
}
}
import { GraphError, GraphErrorType } from '@ductape/sdk';
try {
await ductape.graph.createNode({ ... });
} catch (error) {
if (error instanceof GraphError) {
switch (error.type) {
case GraphErrorType.CONNECTION_ERROR:
console.error('Cannot connect to graph database');
break;
case GraphErrorType.CONSTRAINT_ERROR:
console.error('Constraint violation');
break;
case GraphErrorType.QUERY_ERROR:
console.error('Query failed:', error.message);
break;
}
}
}