# Subset

A **subset** is defined as a set of members all of which are members of another set (from *set theory* in mathematics).

#### Notes

* In SNOMED CT, the definition of *subset* applies to SNOMED CT components as follows:
  * A subset of SNOMED CT concepts is a set of concepts taken from a wider set of concepts.
  * A subset of SNOMED CT descriptions is a set of descriptions taken from a wider set of descriptions.
* The members of a subset can be defined in one of two ways:
  * **Extensionally**, by enumeration, with a **simple reference set** as the standard distribution format.
  * **Intensionally**, using rules to determine inclusion, with a **query reference set** as the standard distribution format.

## Subset Example

The diagram below shows an example of a subset. The English vowels are a subset of the set of alphabet characters included in the English alphabet

<figure><img src="/files/aydAhZpQu5ZYA3zFExdJ" alt=""><figcaption><p>Subset example</p></figcaption></figure>

## Subset Definitions

There are two distinct ways to define the membership of a subset. These are known as **extensional** and **intensional** subset definitions. These terms are defined and illustrated below.

### Extensional subset definition

A subset in which the members are represented by enumeration.

<figure><img src="/files/3eLP2wuvssSYVc2YIlBP" alt=""><figcaption><p>Illustration of an extensionally defined subset</p></figcaption></figure>

### Intensional subset definition

A subset definition in which the membership is represented by a set of rules specifying the conditions for inclusion.

<figure><img src="/files/nGqMNbSrsMrR2IvufpN6" alt=""><figcaption><p>Illustration of intensionally defined subset</p></figcaption></figure>

## Extensional Definitions

Extensionally defined subsets of SNOMED CT components consist of a list of SNOMED CT component identifiers, which are typically either concept or description identifiers. Extensionally defined SNOMED CT subsets are formally represented using the **simple reference set** type.

<figure><img src="/files/JfBvk5H80fdGByHdQHY6" alt=""><figcaption><p>Illustration of an extensionally defined subset of SNOMED CT concepts</p></figcaption></figure>

## Intensional Definitions

The design of SNOMED CT lends itself to intensional subset definitions, because rules can be formulated to specify the conditions for member inclusion. The subtype hierarchy and formal definitions of SNOMED CT concepts enable constraints to be specified, such as:

* Concepts that are descendants of a particular concept.
  * For example: <mark style="color:red;"><</mark> 118794001 <mark style="color:blue;">|</mark> Procedure on lung<mark style="color:blue;">|</mark> (i.e. all descendants of the concept 118794001 <mark style="color:blue;">|</mark> Procedure on lung<mark style="color:blue;">|</mark> )
* Concepts that share a set of defining characteristics.
  * For example: <mark style="color:red;"><</mark> 64572001 <mark style="color:blue;">|</mark>Disorder<mark style="color:blue;">|</mark> <mark style="color:red;">:</mark> 116676008 <mark style="color:blue;">|</mark>Associated morphology<mark style="color:blue;">|</mark> <mark style="color:red;">=</mark> 257552002 <mark style="color:blue;">|</mark>Inflammation<mark style="color:blue;">|</mark> (i.e. all disorders with an associated morphology of inflammation)
* Concepts that are members of a particular subset AND share one or more defining characteristics.
  * For example: <mark style="color:red;">^</mark> 450984003 <mark style="color:blue;">|</mark>Symptoms and signs reference set for GP/FP health issu<mark style="color:blue;">e|</mark> <mark style="color:red;">AND <</mark> 95324001 <mark style="color:blue;">|</mark>Skin lesion<mark style="color:blue;">|</mark> (i.e. all members of the 450984003 <mark style="color:blue;">|</mark> Symptoms and signs reference set for GP/FP health issue<mark style="color:blue;">|</mark> which are also descendants of 95324001 <mark style="color:blue;">|</mark> Skin lesion<mark style="color:blue;">|</mark> )

Intensionally defined SNOMED CT subsets are formally represented using a [query specification reference set](/snomed-ct-practical-guides/snomed-ct-reference-set-guide/5-reference-set-types.md#query-specification-reference-set). The query string in this reference set represents the intensional definition of the subset. The standard way of representing the query is using the SNOMED CT [Expression Constraint Language](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/) (ECL).

## Substrate

The substrate is the superset of members to which an intensional subset definition is applied. Related to subsets of SNOMED CT components the 'Substrate' is the SNOMED CT content against which an intensional query is executed. Typically, the substrate is a specified version of a particular SNOMED CT Edition. Regardless of whether the subset members are intentionally defined or extensionally defined it is important to be specific about the substrate used to generate the subset, because the result of running a query, or manually selecting the subset members, may vary depending on the substrate used.

## Expansion

The expansion is the result of applying an intensional definition to a given substrate. The Expansion may differ depending on the substrate that the query is run against. The expansion that results from running the query against a specific SNOMED CT substrate can be represented extensionally as a simple reference set. Alternatively, the expansion may be computed dynamically or represented in an internal format within a software application.

For more information about the process and methods for developing subsets and reference sets, see the section about refset development.

<figure><img src="/files/BO5xfoAzTQMJJ0Ya486E" alt=""><figcaption><p>Illustration of a substrate, intentional subset definition and expansion</p></figcaption></figure>

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=Refset+Guide&#x26;entry.670899847=Subset" class="button primary">Provide Feedback</a>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-reference-set-guide/2-subsets-value-sets-and-reference-sets/2.1-subset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
