# com.lognship.richtext.facet

> Published by [lognship.com](https://lexicon.garden/identity/did:plc:ln7l376244zkvhwu4wgr3rzz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ln7l376244zkvhwu4wgr3rzz/com.lognship.richtext.facet)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ln7l376244zkvhwu4wgr3rzz/com.lognship.richtext.facet/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ln7l376244zkvhwu4wgr3rzz/com.lognship.richtext.facet/examples)

## Definitions

### `com.lognship.richtext.facet#link`

**Type**: `object`

Facet feature for any non-AT URI link (https://, mailto:, etc.). For AT URIs, prefer atLink instead so the lexicon validator and the PDS enforce strict at-uri syntax at write time.

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

### `com.lognship.richtext.facet`

**Type**: `object`

Annotation of a sub-string within a host record's text. Holds a byte range and one or more semantic features describing what the range means.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `index` | `ref` → `#byteSlice` | Yes |  |
| `features` | `array` | Yes |  |

### `com.lognship.richtext.facet#atLink`

**Type**: `object`

Facet feature for a link to an atproto record (at:// URI). The authority should be normalised to DID form at write time so handle migrations don't break the reference.

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

### `com.lognship.richtext.facet#mention`

**Type**: `object`

Facet feature for a mention of an atproto account by DID. The visible handle in the host record's text is informational; the DID is the canonical reference and survives handle migrations.

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

### `com.lognship.richtext.facet#byteSlice`

**Type**: `object`

The sub-string range a facet is active for. Indices are UTF-8 byte offsets into the host record's text; byteStart is inclusive, byteEnd is exclusive.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `byteEnd` | `integer` | Yes |  |
| `byteStart` | `integer` | Yes |  |

## Raw Schema

```json
{
  "id": "com.lognship.richtext.facet",
  "defs": {
    "link": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri"
        }
      },
      "description": "Facet feature for any non-AT URI link (https://, mailto:, etc.). For AT URIs, prefer atLink instead so the lexicon validator and the PDS enforce strict at-uri syntax at write time."
    },
    "main": {
      "type": "object",
      "required": [
        "index",
        "features"
      ],
      "properties": {
        "index": {
          "ref": "#byteSlice",
          "type": "ref"
        },
        "features": {
          "type": "array",
          "items": {
            "refs": [
              "#mention",
              "#link",
              "#atLink"
            ],
            "type": "union"
          },
          "minLength": 1
        }
      },
      "description": "Annotation of a sub-string within a host record's text. Holds a byte range and one or more semantic features describing what the range means."
    },
    "atLink": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri"
        }
      },
      "description": "Facet feature for a link to an atproto record (at:// URI). The authority should be normalised to DID form at write time so handle migrations don't break the reference."
    },
    "mention": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        }
      },
      "description": "Facet feature for a mention of an atproto account by DID. The visible handle in the host record's text is informational; the DID is the canonical reference and survives handle migrations."
    },
    "byteSlice": {
      "type": "object",
      "required": [
        "byteStart",
        "byteEnd"
      ],
      "properties": {
        "byteEnd": {
          "type": "integer",
          "minimum": 0
        },
        "byteStart": {
          "type": "integer",
          "minimum": 0
        }
      },
      "description": "The sub-string range a facet is active for. Indices are UTF-8 byte offsets into the host record's text; byteStart is inclusive, byteEnd is exclusive."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
