Anatomic Site Relations
In this section, we explain how structured data for anatomic site relations is represented in the NLP API JSON output and in the Output Database schema. We also provide sample queries to illustrate the key aspects of the data schema.
After reading this page, we hope you will:
- Understand what anatomic site relations are.
- Understand what site entities and situated entities are and how to search for them.
- Know how to use anatomic site relations.
The content in this section builds on the concepts and data models explained in earlier sections (see Entity-level Tables, and Document-level Tables)
What are Anatomic Site Relations?
An anatomic site relation is a relation between a SNOMED body structure entity and entities that about a disease or condition, typically disorders, findings and morphologic abnormalities. An anatomic site relation has two arguments:
- the
site idassociated with the body structure mention, and - the
situated entity idwhich is the associated observation.
Let’s consider this sentence.
For the above sentence, the NLP API extracts the subject and value entities that comprise the anatomic site relation as shown:

The site of the relation is upper back, and the terms that indicate or describe a disease state is the situated entity. In this sentence, the situated entity is pruritic rash. In addition to disorders, a situated entity may be a finding, morphologic abnormality, or qualifier entity type.
Anatomic site relations are one-to-one relations. If there are several situated entities per site, then each pair of site and situated entity will be represented by its own anatomic site relation instance.
Here are a two more examples:
In this sentence, the site entity is epigastric region which is the affected body structure. The situated entity is pain, a finding.
Likewise, in the sentence above, the site entity is external capsule, and the situated entity is bleed, a morphologic abnormality.
The site entity are mapped to a subset of SNOMED concepts of semantic tag body structure.
JSON Data Model
Consider the following sentence:
An anatomic site relation is extracted from the sentence above as shown in the following JSON excerpt:
Notice the following:
- The
relationsobject contains ananatomicsitesarray. This array contains objects that are anatomic site relation instances. - An anatomic site relation instance has two named arguments: the
siteand thesituated_entity. Each is a reference to an Entity. - Each entity reference resolves to an object in the
entitiesandfoundentitiesarray. Key information about an entity is stored asattributesof these objects. - Each entity reference also resolves to a unique concept id in supported ontologies.
Anatomic Site Relation Tables
The following ER diagram, shows the relationship between the anatomicsiterelation table and the entity tables

From the diagram above, notice the following key points about the anatomic site relation schema:
- The anatomicsiterelation table contains foreign key IDs for the entity table: the site_id and situated_entity_id keys respectively.
- By joining these keys with the primary key of the entity table, you can retrieve information stored in entity-related tables such as associated concepts, entity types and location for the entity. See Entity-level Tables.
Sample Queries
In this section, we provide examples of SQL queries that retrieve information about anatomic site relations. The first query shows how to work with the anatomicsiterelation table. The second query shows how to combine data retrieved about body structures and qualifiers by querying anatomic site and qualifier relations.
This section contains the following queries:
- Query: Retrieve information about anatomic site relations
- Query: Find anatomic site and qualifiers for disorders
Query: Retrieve information about anatomic site relations
This query finds anatomic site relations and displays the annotated terms for its arguments. To provide context, this query also displays the sentence which contains the anatomic site relation. Note that this query only returns situated entities that are positively asserted and certain.
To find information about anatomic site relations we begin with the anatomicsiterelation table. From there various JOIN clauses are used to retrieve the attributes about the site and situated entities from the tables that store them in the NLP API’s relational database schema. These include the foundentity table.
Because this query touches a large number of tables, it may appear to be complex. However, it is quite straight-forward. The key is to ensure you keep track of whether you are retrieving entity information for the site or the situated argument of the relation in the JOIN clauses. The query consist of three parts:
- Part 1: Retrieve the attributes of the site argument by performing an inner join between the anatomicsiterelation table
site_idwith the entity tableidkey. - Part 2: Retrieve the attributes of the situated_entity argument by performing an inner join between the anatomicsiterelation table
situated_entity_idwith the entity tableidkey. - Part 3: Retrieve the sentence where the anatomic site is found by joining with the foundentitylocation table which then allows us to access the location and document tables. For more information about document-related attributes see Document-level Tables.
Query: Find anatomic site and qualifiers for disorders
In the sample query below, we provide a more complex query that finds all SNOMED disorders, and retrieves associated qualifier and anatomic site information. To do this, we first find all disorder entities from the foundentity table, where the found entity has an entity type of disorder, then we perform joins with two relation tables: the qualifierrelation and anatomicsiterelation tables. For readability, we will write two CTEs (common table expressions) to query for anatomic sites and qualifiers respectively.
Because not all disorder mentions have qualifiers or anatomic site information, we must be careful to use LEFT JOINs.
To return fewer rows, we limit the query results as follows:
- return positively asserted and certain disorder mentions
- return qualifiers of type status and size/severity, as these are more pertinent for disorder concepts.
- return only those disorder mentions which have an anatomic site relation (i.e. which are associated with a body structure site entity).
Utility SQL Queries
Below are some helpful queries for exploring anatomic site relations.

