Connections
Endpoints
Section titled “Endpoints”Each database provides three connection endpoints:
| Protocol | URL | Port | Use Case |
|---|---|---|---|
| HTTP | https://your-db.owlgraph.ai | 443 | Queries, mutations, ontology management |
| gRPC | your-db.owlgraph.ai:9080 | 9080 | High-performance client access |
| GraphQL | https://your-db.owlgraph.ai/graphql | 443 | Auto-generated GraphQL API |
Authentication
Section titled “Authentication”All requests require an API key passed in the X-OWLGraph-Key header:
curl -X POST https://your-db.owlgraph.ai/query \ -H "X-OWLGraph-Key: your-api-key" \ -H "Content-Type: application/dql" \ -d '{ q(func: type(Animal)) { name } }'Generate API keys from Dashboard > Settings > API Keys.
Client Examples
Section titled “Client Examples”export OWLGRAPH_URL="https://your-db.owlgraph.ai"export OWLGRAPH_KEY="your-api-key"
curl -X POST "$OWLGRAPH_URL/query" \ -H "X-OWLGraph-Key: $OWLGRAPH_KEY" \ -H "Content-Type: application/dql" \ -d '{ q(func: type(Animal)) { name dgraph.type } }'conn, err := grpc.Dial("your-db.owlgraph.ai:9080", grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),)client := dgo.NewDgraphClient(api.NewDgraphClient(conn))Python
Section titled “Python”import pydgraph
stub = pydgraph.DgraphClientStub("your-db.owlgraph.ai:9080")client = pydgraph.DgraphClient(stub)JavaScript
Section titled “JavaScript”const dgraph = require("dgraph-js");const grpc = require("@grpc/grpc-js");
const stub = new dgraph.DgraphClientStub( "your-db.owlgraph.ai:9080", grpc.credentials.createSsl());const client = new dgraph.DgraphClient(stub);