# blue.deniz.poly.relationship

> Published by [deniz.blue](https://lexicon.garden/identity/did:plc:ir2qabq56znbbinhktehjmc6)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ir2qabq56znbbinhktehjmc6/blue.deniz.poly.relationship)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ir2qabq56znbbinhktehjmc6/blue.deniz.poly.relationship/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ir2qabq56znbbinhktehjmc6/blue.deniz.poly.relationship/examples)

## Definitions

### `blue.deniz.poly.relationship`

**Type**: `record`

A relationship between two subjects

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `via` | `ref` → `#recordLink` | No |  |
| `subject` | `union` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |

### `blue.deniz.poly.relationship#didLink`

**Type**: `object`

A link to someone using their DID

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `blue.deniz.poly.relationship#recordLink`

**Type**: `object`

Link to someone using a record, can be a `host.plural.system.member` record for example

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |

## Raw Schema

```json
{
  "id": "blue.deniz.poly.relationship",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "subject",
          "createdAt"
        ],
        "properties": {
          "via": {
            "ref": "#recordLink",
            "type": "ref"
          },
          "subject": {
            "refs": [
              "#didLink",
              "#recordLink"
            ],
            "type": "union"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          }
        }
      },
      "description": "A relationship between two subjects"
    },
    "didLink": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        }
      },
      "description": "A link to someone using their DID"
    },
    "recordLink": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        }
      },
      "description": "Link to someone using a record, can be a `host.plural.system.member` record for example"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
