> For the complete documentation index, see [llms.txt](https://docs.snomed.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-compositional-grammar-specification/design/4-logical-model.md).

# Logical Model

A SNOMED CT Compositional Grammar expression begins with an optional definition status, contains one or more focus concepts (represented by a concept identifier) and optionally has a refinement. Each refinement may contain grouped or ungrouped attributes (or both). An attribute[^1] consists of the attribute name (represented by a concept identifier) together with the value of the attribute. The attribute value is either an expression or a concrete value (i.e. string, integer, decimal or boolean). Figure 2 below illustrates the overall structure of a compositional grammar expression using an abstract representation. Please note that no specific semantics should be attributed to each arrow in this abstract diagram.

<figure><img src="https://4141246834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVgpC90r7t9DyATri97GG%2Fuploads%2Fgit-blob-a9c6a5d77871104cd08792b362d9ac8bea97bb2f%2F29951551.png?alt=media" alt=""><figcaption><p><strong>Figure 2: Abstract model of a compositional grammar expression</strong></p></figcaption></figure>

Figure 3 below shows an example of an expression with the main components marked. These components will be explained further in the subsequent sections of this document.

<figure><img src="https://4141246834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVgpC90r7t9DyATri97GG%2Fuploads%2Fgit-blob-c449ca9f65ea4bbf8bef42063e17d1271ffc8dd1%2F162727196.png?alt=media" alt=""><figcaption><p><strong>Figure 3: The main parts of an example expression</strong></p></figcaption></figure>

## Details

Figure 4 below provides a more formal representation of the logical model of SNOMED CT Compositional Grammar using a UML class diagram.

<figure><img src="https://4141246834-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVgpC90r7t9DyATri97GG%2Fuploads%2Fgit-blob-9e88fa97c4d686d5bdcaff2c7660a9bc9dea582d%2F110335948.png?alt=media" alt=""><figcaption><p><strong>Figure 4: Logical Model of SNOMED CT Compositional Grammar</strong></p></figcaption></figure>

...

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=Compositional-Grammar-Specification&#x26;entry.670899847=Logical%20Model" class="button primary">Provide Feedback</a>

[^1]: Please note that, in the context of an expression, the word 'Attribute' is used to refer to the name/value pair within a refinement. However, in the context of the SNOMED CT concept model, the word 'Attribute' is often used to refer specifically to the 'attribute name' (i.e. the concept used as the relationship type).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snomed.org/snomed-ct-specifications/snomed-ct-compositional-grammar-specification/design/4-logical-model.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
