API Documentation

Get All Graph Links

GET /api/v1/graph/links

⚠️ Large Response Warning
This endpoint returns 16,000+ relationships. Testing in Swagger UI may impact browser performance. Consider using command-line tools or applications designed for large datasets.

Returns all relationships/links between nodes in the graph visualization. This includes all types of relationships like managing, funding, affiliation, DLT support, regulatory compliance, and more.

Features

  • Complete relationship dataset for network visualization
  • All types of relationships between entities
  • Directional links showing source and target nodes
  • Relationship type classification
  • Optimized for graph rendering libraries

Request

Query Parameters

Parameter Type Required Default Description
format string No json Response format: "json"

Example Request

bash
# Get all graph links
curl -X GET "https://www.weboftrust.org/api/v1/graph/links" \
  -H "X-API-Key: YOUR_API_KEY" \
  -o links.json

# With format parameter (for future compression support)
curl -X GET "https://www.weboftrust.org/api/v1/graph/links?format=json" \
  -H "X-API-Key: YOUR_API_KEY"

Response

Success Response (200 OK)

Response Headers

Header Value Description
Cache-Control public, max-age=300, s-maxage=3600, stale-while-revalidate=7200 Aggressive caching for performance

Response Schema

typescript
interface GraphLinksResponse {
  data: GraphLink[];
  metadata: {
    total: number;              // Total number of links
    compressed: boolean;        // Whether data is compressed
    format: "json" | "compressed";
    cache_timestamp: string;    // ISO 8601 timestamp
  };
}

interface GraphLink {
  targetNodeId: string;    // Target node ID (e.g., "project-118")
  sourceNodeId: string;    // Source node ID (e.g., "entity-456")
  type: LinkType;          // Relationship type
  label: string;           // Human-readable description
}

type LinkType = 
  | "Managing"           // Entity manages project
  | "Funding"            // Entity funds project
  | "Affiliation"        // Entity affiliated with project
  | "Member"             // Entity/project is member of consortium
  | "Person of Interest" // Person involved with project
  | "DLTinstancesupport" // Project uses DLT instance
  | "DLT based on"       // DLT instance based on DLT technology
  | "followsRegulation"  // Project follows regulation
  | "Follows"            // Project follows standard or DID method
  | "Management"         // Project manages standard
  | "Interoperability";  // Projects have interoperability

Example Response (Abbreviated)

json
{
  "data": [
    {
      "targetNodeId": "project-118",
      "sourceNodeId": "entity-36",
      "type": "Managing",
      "label": "TradeTrust is managed by Infocomm Media Development Authority"
    },
    {
      "targetNodeId": "project-118",
      "sourceNodeId": "dltinstance-2",
      "type": "DLTinstancesupport",
      "label": "TradeTrust uses Ethereum"
    },
    {
      "targetNodeId": "project-118",
      "sourceNodeId": "standard-12",
      "type": "Follows",
      "label": "TradeTrust follows W3C Verifiable Credentials Data Model"
    },
    {
      "targetNodeId": "entity-649",
      "sourceNodeId": "project-325",
      "type": "Managing",
      "label": "European Commission manages EU Digital Identity Wallet"
    },
    {
      "targetNodeId": "project-415",
      "sourceNodeId": "person-1082",
      "type": "Person of Interest",
      "label": "Stephen Curran involved with OWF - Open Wallet Foundation"
    }
  ],
  "metadata": {
    "total": 16453,
    "compressed": false,
    "format": "json",
    "cache_timestamp": "2025-01-09T10:30:00.000Z"
  }
}

Relationship Types

Entity-Project Relationships

  • Managing: Entity manages or oversees the project
  • Funding: Entity provides funding for the project
  • Affiliation: Entity is affiliated with the project
  • Member: Entity is a member of a consortium

Technical Relationships

  • DLTinstancesupport: Project uses a specific blockchain/DLT instance
  • DLT based on: DLT instance is based on a DLT technology
  • followsRegulation: Project complies with a regulation
  • Follows: Project follows a standard or implements a DID method
  • Management: Project manages or maintains a standard

People Relationships

  • Person of Interest: Person has a role in a project or entity

Project-to-Project Relationships

  • Member: Project is member of a consortium
  • Interoperability: Projects have technical interoperability

Graph Directionality

Links are directional, flowing from source to target:

  • sourceNodeIdtargetNodeId
  • The relationship type determines the semantic meaning
  • Some relationships are naturally bidirectional (e.g., interoperability)

Performance Considerations

Large Dataset: This endpoint returns the entire link dataset (16,000+ relationships)

  • Response size: ~4-6 MB uncompressed JSON
  • Parse time may be significant in browsers
  • Consider implementing pagination in your application
  • Cache the response locally to avoid repeated downloads
  • Results are heavily cached at CDN level (1 hour)

Usage with Visualization Libraries

D3.js Force Graph Example

javascript
// Fetch nodes and links
Promise.all([
  fetch('https://www.weboftrust.org/api/v1/graph/nodes', {
    headers: { 'X-API-Key': 'YOUR_API_KEY' }
  }),
  fetch('https://www.weboftrust.org/api/v1/graph/links', {
    headers: { 'X-API-Key': 'YOUR_API_KEY' }
  })
])
.then(responses => Promise.all(responses.map(r => r.json())))
.then(([nodesResult, linksResult]) => {
  const nodes = nodesResult.data;
  const links = linksResult.data.map(link => ({
    source: link.sourceNodeId,
    target: link.targetNodeId,
    type: link.type
  }));
  
  // Create force simulation
  const simulation = d3.forceSimulation(nodes)
    .force("link", d3.forceLink(links).id(d => d.id))
    .force("charge", d3.forceManyBody())
    .force("center", d3.forceCenter(width / 2, height / 2));
});

Network Analysis Example

javascript
// Calculate degree centrality
const degreeMap = {};
links.forEach(link => {
  degreeMap[link.sourceNodeId] = (degreeMap[link.sourceNodeId] || 0) + 1;
  degreeMap[link.targetNodeId] = (degreeMap[link.targetNodeId] || 0) + 1;
});

// Find most connected nodes
const mostConnected = Object.entries(degreeMap)
  .sort(([,a], [,b]) => b - a)
  .slice(0, 10);