# org.latha.island.deriveIsland

> Published by [nandi.uk](https://lexicon.garden/identity/did:plc:ngokl2gnmpbvuvrfckja3g7p)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ngokl2gnmpbvuvrfckja3g7p/org.latha.island.deriveIsland)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ngokl2gnmpbvuvrfckja3g7p/org.latha.island.deriveIsland/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ngokl2gnmpbvuvrfckja3g7p/org.latha.island.deriveIsland/examples)

## Definitions

### `org.latha.island.deriveIsland#edge`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |
| `note` | `string` | No |  |
| `handle` | `string` | No |  |
| `source` | `string` | Yes |  |
| `target` | `string` | Yes |  |
| `connectionType` | `string` | Yes |  |

### `org.latha.island.deriveIsland`

**Type**: `procedure`

Derive connected components (islands) from the connection graph. Sends all connections to the container for BFS traversal. Without a seed, returns all islands. With a seed vertex, returns the single island containing it.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `seed` | `string` | No | Optional seed vertex. If provided, returns only the island containing this vertex. If omitted, returns all islands. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `islands` | `array` | Yes |  |

### `org.latha.island.deriveIsland#island`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Stable ID: truncated SHA-256 of the lexmin vertex. |
| `edges` | `array` | Yes |  |
| `lexmin` | `string` | Yes | Lexicographically smallest vertex in the component — the canonical reference. |
| `vertices` | `array` | Yes |  |

## Raw Schema

```json
{
  "id": "org.latha.island.deriveIsland",
  "defs": {
    "edge": {
      "type": "object",
      "required": [
        "uri",
        "did",
        "source",
        "target",
        "connectionType"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        },
        "note": {
          "type": "string"
        },
        "handle": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "target": {
          "type": "string"
        },
        "connectionType": {
          "type": "string"
        }
      }
    },
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "properties": {
            "seed": {
              "type": "string",
              "description": "Optional seed vertex. If provided, returns only the island containing this vertex. If omitted, returns all islands."
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "islands"
          ],
          "properties": {
            "islands": {
              "type": "array",
              "items": {
                "ref": "#island",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Derive connected components (islands) from the connection graph. Sends all connections to the container for BFS traversal. Without a seed, returns all islands. With a seed vertex, returns the single island containing it."
    },
    "island": {
      "type": "object",
      "required": [
        "id",
        "lexmin",
        "vertices",
        "edges"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable ID: truncated SHA-256 of the lexmin vertex."
        },
        "edges": {
          "type": "array",
          "items": {
            "ref": "#edge",
            "type": "ref"
          }
        },
        "lexmin": {
          "type": "string",
          "description": "Lexicographically smallest vertex in the component — the canonical reference."
        },
        "vertices": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
