Arke
BuildSearch & Query

Graph Traversal

Direct graph traversal queries using Neo4j via the GraphDB worker.

Overview

Beyond the Argo DSL, Arke provides direct graph traversal endpoints powered by Neo4j (via the GraphDB service binding). Entities and their relationships are synced to a graph database for efficient path-finding and traversal.

Graph Endpoints

EndpointMethodPurpose
/graph/pathsPOSTFind shortest paths between entity sets
/graph/reachablePOSTFind entities of a type reachable from sources
/graph/entity/{id}GETGet entity with all relationships from graph

Find Paths Between Entities

Find all shortest paths between source and target entity sets:

POST /graph/paths
Content-Type: application/json
Authorization: Bearer <token>

{
  "source_pis": ["01KE4ZY69F9R40E88PK9S0TQRQ"],
  "target_pis": ["01KE506KZGD8M2P1XK3VNQT4YR"],
  "max_depth": 3,
  "direction": "both",
  "limit": 10
}

Request Parameters

ParameterTypeDefaultDescription
source_pisstring[]requiredStarting entity PIs
target_pisstring[]requiredTarget entity PIs
max_depthnumber4Maximum path depth (1-4)
directionstring"both""outgoing", "incoming", or "both"
limitnumber100Maximum paths to return (max 1000)

Response

{
  "paths": [
    {
      "source_pi": "01KE4ZY...",
      "target_pi": "01KE506...",
      "length": 2,
      "edges": [
        {
          "subject_pi": "01KE4ZY...",
          "subject_label": "Project Folder",
          "subject_type": "folder",
          "predicate": "contains",
          "object_pi": "01KE506...",
          "object_label": "Research Paper.pdf",
          "object_type": "file"
        }
      ]
    }
  ],
  "truncated": false
}

Find Reachable Entities

Find all entities of a specific type reachable from source entities:

POST /graph/reachable
Content-Type: application/json
Authorization: Bearer <token>

{
  "source_pis": ["01KE4ZY69F9R40E88PK9S0TQRQ"],
  "target_type": "file",
  "max_depth": 3,
  "direction": "outgoing",
  "limit": 50
}

Request Parameters

ParameterTypeDefaultDescription
source_pisstring[]requiredStarting entity PIs
target_typestringrequiredTarget entity type to find
max_depthnumber4Maximum path depth (1-4)
directionstring"both""outgoing", "incoming", or "both"
limitnumber100Maximum results (max 1000)

Response

{
  "results": [
    {
      "source_pi": "01KE4ZY...",
      "target_pi": "01KE506...",
      "target_label": "Research Paper.pdf",
      "target_type": "file",
      "length": 1,
      "edges": [...]
    }
  ],
  "truncated": false
}

Get Entity with Relationships

Get entity details with all relationships from the graph:

GET /graph/entity/01KE4ZY69F9R40E88PK9S0TQRQ
Authorization: Bearer <token>

Unlike the entity manifest endpoint, this includes both outgoing AND incoming relationships -- showing not just what this entity links to, but also what links to it.

Response

{
  "pi": "01KE4ZY...",
  "type": "folder",
  "label": "Project Folder",
  "collection_pi": "01JCOLL...",
  "created_at": "2025-01-10T08:00:00.000Z",
  "updated_at": "2025-01-18T16:45:00.000Z",
  "relationships": [
    {
      "direction": "outgoing",
      "predicate": "contains",
      "peer_pi": "01KE506...",
      "peer_type": "file",
      "peer_label": "Research Paper.pdf",
      "properties": {}
    },
    {
      "direction": "incoming",
      "predicate": "contains",
      "peer_pi": "01KPARENT...",
      "peer_type": "folder",
      "peer_label": "Root Folder",
      "properties": {}
    }
  ]
}

Entity Expansion

All graph endpoints support the expand query parameter to fetch fresh entity data:

ValueDescription
(omitted) or previewLightweight previews for path entities
fullComplete entity manifests
noneGraph metadata only (fastest)

Example:

GET /graph/entity/01KE4ZY...?expand=preview
POST /graph/paths?expand=full

With expansion, edges include additional fields:

  • subject_preview / subject_entity for the source
  • object_preview / object_entity for the target
  • peer_preview / peer_entity for relationships

Performance Note: 100 paths can reference 400-800 unique entities. Use limit: 10-20 when using expansion, or use expand=none for large result sets and fetch specific entities separately.

Use CaseRecommended Endpoint
Semantic search + graph traversal with rankingPOST /query (Argo DSL)
Exhaustive exploration from known entitiesPOST /graph/reachable
Find all paths between two entity setsPOST /graph/paths
Get all relationships for one entityGET /graph/entity/{id}
Find entities by text similarityPOST /search/* endpoints

On this page