# app.tempomusic.richtext.facet

> Published by [lexicons.tempomusic.fan](https://lexicon.garden/identity/did:plc:pxsuqmultto34oks44m2lgxm)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.richtext.facet)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.richtext.facet/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.richtext.facet/examples)

## Definitions

### `app.tempomusic.richtext.facet#tag`

**Type**: `object`

Facet feature for a topical hashtag. The tag string omits any leading '#' character.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `tag` | `string` | Yes |  |

### `app.tempomusic.richtext.facet#link`

**Type**: `object`

Facet feature for an external URL embedded inline in text.

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

### `app.tempomusic.richtext.facet`

**Type**: `object`

Annotation of a sub-string within text. Features describe the meaning of the annotated range: mention, link, tag, or inline music reference.

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

### `app.tempomusic.richtext.facet#music`

**Type**: `object`

Facet feature for an inline reference to a musical entity (song, album, or artist). Allows linking music inside the text body of a post, distinct from the post's primary subject.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `subject` | `union` | Yes |  |

### `app.tempomusic.richtext.facet#mention`

**Type**: `object`

Facet feature for a mention of another Tempo account by DID.

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

### `app.tempomusic.richtext.facet#byteSlice`

**Type**: `object`

Specifies the sub-string range a facet annotates. Indices are zero-indexed byte offsets, inclusive of byteStart and exclusive of byteEnd, against the UTF-8 encoding of the text field.

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

## Raw Schema

```json
{
  "id": "app.tempomusic.richtext.facet",
  "defs": {
    "tag": {
      "type": "object",
      "required": [
        "tag"
      ],
      "properties": {
        "tag": {
          "type": "string",
          "maxLength": 640,
          "maxGraphemes": 64
        }
      },
      "description": "Facet feature for a topical hashtag. The tag string omits any leading '#' character."
    },
    "link": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri"
        }
      },
      "description": "Facet feature for an external URL embedded inline in text."
    },
    "main": {
      "type": "object",
      "required": [
        "index",
        "features"
      ],
      "properties": {
        "index": {
          "ref": "#byteSlice",
          "type": "ref"
        },
        "features": {
          "type": "array",
          "items": {
            "refs": [
              "#mention",
              "#link",
              "#tag",
              "#music"
            ],
            "type": "union"
          }
        }
      },
      "description": "Annotation of a sub-string within text. Features describe the meaning of the annotated range: mention, link, tag, or inline music reference."
    },
    "music": {
      "type": "object",
      "required": [
        "subject"
      ],
      "properties": {
        "subject": {
          "refs": [
            "app.tempomusic.feed.defs#songRef",
            "app.tempomusic.feed.defs#albumRef",
            "app.tempomusic.feed.defs#artistRef"
          ],
          "type": "union"
        }
      },
      "description": "Facet feature for an inline reference to a musical entity (song, album, or artist). Allows linking music inside the text body of a post, distinct from the post's primary subject."
    },
    "mention": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        }
      },
      "description": "Facet feature for a mention of another Tempo account by DID."
    },
    "byteSlice": {
      "type": "object",
      "required": [
        "byteStart",
        "byteEnd"
      ],
      "properties": {
        "byteEnd": {
          "type": "integer",
          "minimum": 0
        },
        "byteStart": {
          "type": "integer",
          "minimum": 0
        }
      },
      "description": "Specifies the sub-string range a facet annotates. Indices are zero-indexed byte offsets, inclusive of byteStart and exclusive of byteEnd, against the UTF-8 encoding of the text field."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
