Copyright © 2026 the Contributors to the FHIR OWL Ontology Reference Community Group Report, published by the W3C Semantic Web in Health Care and Life Sciences Community Group under the W3C Community Contributor License Agreement (CLA). A human-readable summary is available.
The HL7® FHIR® (Fast Healthcare Interoperability Resources) [[FHIR]] standard includes a specification of healthcare data models. This document describes the canonical OWL 2 ontology for FHIR R6 (Pre-Release 6, Sept 2026) data represented in RDF [[FHIR-RDF]].
The FHIR OWL ontology [[FHIR-OWL]] [[FHIR-OWL-Current]] is developed jointly by the RDF subgroup of the HL7 ITS (Implementable Technology Specifications) Working Group [[HL7-ITS]] and the W3C HCLS (Semantic Web in Health Care and Life Sciences) Community Group [[W3C-HCLSG]].
HL7® and FHIR® are the registered trademarks of Health Level Seven International and the use of these trademarks does not constitute an endorsement by HL7.
This report is entirely informative (non-normative), supplemental documentation intended to inform users of W3C standards who may not be familiar with FHIR. This report is not endorsed by HL7. The authoritative, normative specification of FHIR RDF is published by HL7 [[FHIR-RDF]] and supersedes this document where any conflicts may arise.
This report was published by the W3C Semantic Web in Health Care and Life Sciences Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.
GitHub Issues are preferred for discussion of this report.
FHIR (Fast Healthcare Interoperability Resources) [[FHIR]] data models define types of resources and data elements designed primarily for exchanging healthcare data. The most commonly used serializations of FHIR resources are XML [[xml]] and JSON [[JSON]].
RDF (Resource Description Framework) [[rdf11-primer]] is an abstract data model designed for modeling data in a way that is less dependent on syntax and schemas, though it can be extended with schemas [[rdf-schema]]. An RDF triple is composed of a subject, a predicate, and an object, where each is an IRI (Internationalized Resource Identifier) [[rfc3987]] that denotes a resource in a broader sense than "FHIR resource". The subject and object of a triple could also be a blank node. RDF has multiple serializations, including Turtle [[rdf-turtle]], JSON-LD [[json-ld]], and RDF/XML [[rdf11-xml]].
FHIR RDF [[FHIR-RDF]] is the canonical RDF representation of FHIR resources and elements, designed to make FHIR data more interoperable with other RDF data [[RDF-Healthcare]]. FHIR RDF data is modeled using nested blank nodes to be more easily readable by humans, but blank nodes can generally be named (skolemized) for internal use.
Turtle is the serialization format required for conformant exchange of FHIR RDF. This document mostly uses "FHIR RDF" when discussing the data model and only "FHIR Turtle" when discussing specific features of the Turtle serialization. FHIR Turtle can be converted "round-trip" between FHIR JSON and FHIR XML formats without loss of information.
These prefixes are typically used in FHIR Turtle data:
@prefix fhir: <http://hl7.org/fhir/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix loinc: <http://loinc.org/rdf/> . # For LOINC codes
@prefix sct: <http://snomed.info/id/> . # For SNOMED-CT codes
# These are normally only used in the OWL ontology or ShEx schema:
@prefix fhirvs: <http://hl7.org/fhir/ValueSet/> .
@prefix fhirsd: <http://hl7.org/fhir/StructureDefinition/> .
@prefix fhirw5: <http://hl7.org/fhir/w5#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
FHIR RDF uses rdf:type (or a in Turtle) to represent what type of FHIR resource the data is expected to conform to. This is analogous to the resource type name being used as the top-level element name in FHIR XML and the "resourceType" property in FHIR JSON.
| Format | Example |
|---|---|
| FHIR XML | <Patient xmlns="http://hl7.org/fhir"/> |
| FHIR JSON | { "resourceType": "Patient" } |
| FHIR RDF | :example a fhir:Patient . |
FHIR RDF defines extra properties which are useful for RDF, SPARQL [[sparql11-query]], ShEx [[ShExSpec]], and OWL [[owl2-overview]].
First, FHIR RDF data elements with URI literals, including relative references to other FHIR resources, can include an additional resource link with fhir:l to an IRI, which can be natively dereferenced by RDF applications.
Second, coded data elements can include a concept IRI, which similarly make their codes dereferenceable to externally defined RDF resources, such as OWL ontology classes.
Concept IRIs asserted with rdf:type are useful for reasoning but, depending on what they denote, require careful interpretation
in some mapping contexts to avoid confusing data elements, functioning as information models, with instances of ontology classes.
Alternatively, the Concept IRI Extension encodes concept IRIs as resource links so that these may be represented in FHIR JSON or FHIR XML for exchange.
@prefix : <http://example.org/> .
:exampleObservation a fhir:Observation ;
fhir:subject [
fhir:reference [ fhir:v "Patient/example" ] ;
fhir:l :examplePatient # OPTIONAL resource link
] ;
fhir:code [
a loinc:29463-7 ; # OPTIONAL concept IRI
a sct:27113001 ; # OPTIONAL concept IRI
fhir:coding ( [
fhir:system [
fhir:l <http://loinc.org> ; # OPTIONAL resource link
fhir:v "http://loinc.org"^^xsd:anyURI
] ;
fhir:code [ fhir:v "29463-7" ] ;
fhir:display [ fhir:v "Body Weight" ]
] [
fhir:system [
fhir:l <http://snomed.info/sct> ; # OPTIONAL resource link
fhir:v "http://snomed.info/sct"^^xsd:anyURI
] ;
fhir:code [ fhir:v "27113001" ] ;
fhir:display [ fhir:v "Body weight" ]
] ) ;
] .
:examplePatient a fhir:Patient . # Abbreviated
FHIR ShEx [[FHIR-ShEx]] [[Developing-FHIR-ShEx]] is a set of ShEx (Shape Expressions) [[ShExSpec]] schemas designed for validating FHIR RDF data conformance with FHIR StructureDefinition and ElementDefinition conformance rules represented as ShEx shapes. ShEx schemas use closed-world semantics, where missing data is assumed to be false and different IRIs are assumed to name different things.
Every publication of the FHIR specification re-builds the FHIR ShEx schemas from all core StructureDefinition resources and includes them for download. The most recent build corresponding to the next pre-release version is also available at [[FHIR-ShEx-Build]].
OWL 2 (Web Ontology Language) [[owl2-overview]] is a language designed for knowledge representation. OWL 2 has a model-theoretic semantics based on the description logic SROIQ [[owl2-direct-semantics]] and also has a mapping to RDF [[owl2-rdf-based-semantics]] [[owl2-mapping-to-rdf]]. Both RDF and OWL 2 use open-world semantics, where missing data is not assumed to be false and different IRIs are not assumed to name different things.
The FHIR OWL ontology [[FHIR-OWL]] ("FHIR Model Ontology" or "FHIR OWL" or simply "FHIR ontology") is a controlled vocabulary of terms used in FHIR RDF data and a formal model of conformant FHIR resources designed to support logical inference and interoperability with other OWL ontologies. It is automatically derived from the core FHIR StructureDefinition resources and ElementDefinition elements that define all other core FHIR resources and elements.
FHIR resources are information models designed for data exchange to support healthcare operations. Information models are often understood by users implicitly in practical contexts, like interacting with a health record system [[Principles-Health-Interop]]. The FHIR ontology represents the set of conformant FHIR resources, data elements, and some of their internal relationships. It does not fully define what each type of resource means as a health record, which is often implicitly understood in different contexts of use.
FHIR ontology users are also advised to interpret FHIR data as typically carrying information about its use.
For example, Patient.active represents the status of a record, but Patient.birthDate does not represent the birth date of a record.
Every publication of the FHIR specification re-builds the FHIR ontology from all core StructureDefinition resources and includes it for download. The most recent build, corresponding to the next pre-release version, is also available at [[FHIR-OWL-Current]].
The FHIR ontology uses OWL 2 DL (Description Logic) [[owl2-syntax]] vocabulary, which includes subclass axioms defined with
owl:allValuesFrom, owl:unionOf, and owl:cardinality.
The ontology is not entirely conformant with OWL 2 due it its inclusion of a few data types described below.
FHIR primitive type elements include literal data types from XML Schema [[xmlschema11-2]] such as xsd:string,
xsd:integer, xsd:anyURI, and xsd:dateTime.
OWL 2 does not support xsd:date, xsd:time, xsd:gYear, or xsd:gYearMonth, so values of
these types need to be converted to a supported data type such as
xsd:dateTime, or to a qualified time:DateTimeDescription, for use with an OWL 2 reasoner.
FHIR R5+ RDF uses RDF collections to track element order,
but OWL 2 does not generally support RDF collections because that vocabulary is reserved for the RDF serialization of OWL axioms [[owl2-mapping-to-rdf]].
Applications could translate RDF collections into indexed triples with the
fhir:index property used by earlier FHIR RDF versions, either for use with OWL or to enable more
concise SPARQL queries. However, conformant FHIR R5+ RDF data is expected to be exchanged and validated using RDF
collections.
Because it is intended for use with FHIR Turtle data, the FHIR ontology is currently distributed only in Turtle, while conformant OWL 2 [[owl2-conformance]] tools are only required to support ontologies serialized in RDF/XML. The FHIR ontology could be converted to RDF/XML if needed, but that serialization is not intended to be used with the FHIR XML representation, which does not use RDF.
:patient1 a fhir:Patient ;
# RDF collections
fhir:name ( [
fhir:given ( [ fhir:v "Peter" ] [ fhir:v "James" ] )
] [
fhir:given ( [ fhir:v "Jim" ] )
] ) .
:patient2 a fhir:Patient ;
# Indexed triples
fhir:name [
fhir:given [ fhir:v "Peter" ; fhir:index 0 ],
[ fhir:v "James" ; fhir:index 1 ] ;
fhir:index 0 ;
] , [
fhir:given [ fhir:v "Jim" ; fhir:index 0 ] ;
fhir:index 1 ;
] .
Every FHIR StructureDefinition and ElementDefinition defined for a FHIR resource has a mapping to an informal, non-normative taxonomy called
W5 ("Five Ws"), which stands for "Who, What, Where, When, Why". The FHIR ontology is distributed with
these mappings represented as rdfs:subClassOf and rdfs:subPropertyOf relations and with the W5 OWL taxonomy imported, which
offers a more intuitive view of how each FHIR resource type is categorized across contexts of use such as clinical,
administrative, or financial. These mappings are neither normative nor required, so removing the
owl:imports statement and corresponding mappings will not affect the FHIR ontology.
FHIR resources may also be mapped to the HL7 RIM (Reference Information Model) [[HL7v3-comparison]], but those mappings are neither required nor represented in the FHIR ontology.
The FHIR ontology is primarily composed of OWL classes representing sets of conformant or "valid" FHIR resources and elements.
The definition of each class derives from a StructureDefinition or complex ElementDefinition created by an organization designated as the StructureDefinition.publisher.
fhir:Base as the root has two subclasses: fhir:Element and fhir:Resource.
No FHIR ontology classes are explicitly declared to be disjoint but it is plausible that some are intended to be, e.g. fhir:Resource and fhir:Element, or many of their subclasses.
fhir:Element is the class of elements used in instances of fhir:Resource and includes subclasses like fhir:DataType and fhir:BackboneElement.
fhir:Resource is the class of FHIR resources, which includes subclasses fhir:DomainResource, fhir:Bundle, fhir:Binary, and fhir:Parameters.
Most FHIR resources are instances of fhir:DomainResource subclasses like fhir:Patient, fhir:Observation, fhir:Condition, and fhir:Encounter.
A FHIR structure definition or StructureDefinition defines rules about the structure and content of FHIR resources, elements, and data types. Every FHIR StructureDefinition resource is itself an instance of the StructureDefinition type.
The FHIR ontology maps each StructureDefinition in the core FHIR specification [[FHIR]], except for example FHIR profiles, to an OWL class representing the set of valid
instances of that FHIR resource or data type. For example, the class fhir:Patient represents the set of valid FHIR
Patient resources, while fhir:Address represents the set of valid FHIR Address typed data elements.
Each class is assigned an IRI mapped from the StructureDefinition's name, prefixed with the FHIR namespace
http://hl7.org/fhir/. The fhir:Patient class
has the IRI http://hl7.org/fhir/Patient, while the
StructureDefinition instance itself is assigned an IRI mapped from its canonical URL,
http://hl7.org/fhir/StructureDefinition/Patient.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
StructureDefinition |
owl:Class |
fhir:Patient |
StructureDefinition.id |
rdfs:label |
fhir:Patient rdfs:label "Patient" |
StructureDefinition.description |
rdfs:comment |
fhir:Patient rdfs:comment "Demographics and other administrative information about an individual or animal that is [...]"
|
StructureDefinition.baseDefinition |
rdfs:subClassOf |
fhir:Patient SubClassOf: fhir:DomainResource |
StructureDefinition.differential.element |
owl:allValuesFrom ('only') |
fhir:Patient SubClassOf: (fhir:name only fhir:HumanName) |
StructureDefinition.url
|
rdfs:isDefinedBy
|
fhir:Patient rdfs:isDefinedBy fhirsd:Patient
|
An OWL class interpreted as an RDF class is just another RDF resource.
A class extension is the set of resources that are instances of that class.
An rdf:type triple asserts class membership, but membership may also be inferred from axioms and is not limited to explicitly asserted rdf:type triples.
The FHIR ontology represents the relationship between a StructureDefinition resource instance and its corresponding OWL class with an
rdfs:isDefinedBy annotation on the class, so RDF applications can navigate from a FHIR resource to the OWL class it is an instance of, and then to the defining StructureDefinition resource.
FHIR ontology classes therefore act as links between FHIR RDF resource or data type instances and their StructureDefinitions.
To summarize: A StructureDefinition resource defines rules about a FHIR resource or data type. Its corresponding FHIR ontology class represents a set of valid instances of that type. Both are encoded as data in Turtle.
# Abbreviated example corresponding to the FHIR StructureDefinition for 'Patient'
fhir:Patient a owl:Class ;
rdfs:label "Patient" ;
# Provenance annotation and link to StructureDefinition resource instance
rdfs:isDefinedBy fhirsd:Patient ;
# StructureDefinition.description
rdfs:comment "Demographics and other administrative information about an individual or animal that is the subject of potential, past, current, or future health-related care, services, or processes." ;
# StructureDefinition.baseDefinition and mappings
rdfs:subClassOf fhir:DomainResource, fhirw5:administrative.individual ;
# ...
# Example type and cardinality axioms:
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty fhir:name ;
owl:allValuesFrom fhir:HumanName
] ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty fhir:birthDate ;
owl:allValuesFrom fhir:Date
] ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty fhir:birthDate ;
owl:maxCardinality 1
] ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:allValuesFrom fhir:Patient.contact ;
owl:onProperty fhir:contact
] ;
# ...
A FHIR element definition or ElementDefinition
defines rules about the content of a data element used in a FHIR resource defined in a StructureDefinition.
A complex element like Patient.contact has child elements, each defined by its own ElementDefinition.
The canonical FHIR ontology maps each complex ElementDefinition to a separate OWL class to avoid complex nesting of axioms in the corresponding StructureDefinition class.
Most of these are subclasses of fhir:BackboneElement but some are subclasses of fhir:Element.
Complex elements in FHIR RDF do not include type assertions for these classes. They are simply used to organize the ontology and have no effect on FHIR data generally.
A FHIR "elements ontology" can be derived for all ElementDefinitions, but is not included in the canonical FHIR ontology.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
ElementDefinition |
owl:Class |
fhir:Patient.contact |
ElementDefinition.id
|
rdfs:label |
fhir:Patient.contact rdfs:label "Patient.contact" |
ElementDefinition.definition
|
rdfs:comment |
fhir:Patient.contact rdfs:comment "A contact party (e.g. guardian, partner, friend) for the patient [...]"
|
ElementDefinition.type.code
|
rdfs:subClassOf |
fhir:Patient.contact SubClassOf: fhir:BackboneElement |
Parent StructureDefinition.url + # ElementDefinition.id |
rdfs:isDefinedBy |
fhir:Patient.contact rdfs:isDefinedBy <http://hl7.org/fhir/StructureDefinition/Patient#Patient.contact>
|
Classes derived from ElementDefinitions are indicated by an rdfs:isDefinedBy annotation to a fragment of a StructureDefinition, e.g.
http://hl7.org/fhir/StructureDefinition/Patient#Patient.contact shown in Example 5.
# Abbreviated example corresponding to the FHIR ElementDefinition for 'Patient.contact'
fhir:Patient.contact a owl:Class ;
rdfs:label "Patient.contact" ;
# Provenance annotation and link to ElementDefinition element instance
rdfs:isDefinedBy <http://hl7.org/fhir/StructureDefinition/Patient#Patient.contact> ;
# ElementDefinition.definition
rdfs:comment "A contact party (e.g. guardian, partner, friend) for the patient." ;
# ElementDefinition.type.code
rdfs:subClassOf fhir:BackboneElement ;
# ...
# Example type and cardinality axioms:
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty fhir:name ;
owl:allValuesFrom fhir:HumanName
] ;
rdfs:subClassOf [ rdf:type owl:Restriction;
owl:onProperty fhir:name ;
owl:maxCardinality 1
] ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty fhir:telecom ;
owl:allValuesFrom fhir:ContactPoint
] ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty fhir:address ;
owl:allValuesFrom fhir:Address
] ;
# ...
All class IRI local names are named with an uppercase first letter (e.g. http://hl7.org/fhir/Patient or fhir:Patient), while all object properties are named with a lowercase first letter.
This case-sensitivity avoids punning,
where an object property could have the same IRI as a class corresponding to the wrong StructureDefinition.
Classes for FHIR primitive types are also named with
an uppercase first letter, such as fhir:Code, but are given an rdfs:label annotation with
their conventional lowercasing, e.g. "code".
FHIR RDF data uses RDF properties to link FHIR resources and elements. Their meanings are defined by FHIR ontology object properties, the classes these properties restrict in axioms, and the StructureDefinition instances from which they are derived.
Each ElementDefinition within a StructureDefinition is mapped to an OWL object property and assigned an
IRI corresponding to the last segment of the ElementDefinition.path.
The object property fhir:l is used only in FHIR RDF for resource links.
The object property fhir:nodeRole is used only in FHIR RDF and only when serializing contained FHIR resources as separate RDF resources in a single document.
For example, fhir:nodeRole fhir:treeRoot identifies the top-level, containing FHIR resource.
| FHIR | FHIR OWL | Example |
|---|---|---|
Last segment of ElementDefinition.path with [x] removed
|
owl:ObjectProperty |
Patient.active maps to fhir:active |
fhir:l |
owl:ObjectProperty |
:observation fhir:subject [ fhir:l :patient ] |
fhir:nodeRole |
owl:ObjectProperty |
:observation fhir:nodeRole fhir:treeRoot |
Since version R5, FHIR RDF uses short, unqualified object property IRIs corresponding to each
ElementDefinition.path, which makes the Turtle serialization easier to read and makes
SPARQL queries easier to write. FHIR object properties have lowercased first letters, which avoids punning them with
a class of the same name. For example, fhir:Code is a class and fhir:code is an object property.
Unqualified object property names result in different ElementDefinitions being mapped to the same object property. FHIR R5+ object property names are therefore ambiguous except in the context of their use in FHIR data and OWL class axioms. Each object property instance in a FHIR RDF resource can be disambiguated either from the corresponding ElementDefinition in the StructureDefinition for the resource, or from the corresponding property restriction axioms in the OWL class for the resource. Object properties can also be disambiguated with SPARQL queries (Example 6) or SWRL (Semantic Web Rule Language) [[SWRL]] rules (Example 7), which could result in punning, but only for a class corresponding to the correct ElementDefinition:
CONSTRUCT {
?p fhir:Patient.name ?n .
} WHERE {
?p a fhir:Patient .
?p fhir:name ?n .
}
fhir:Patient(?p) ^ fhir:name(?p, ?n) -> fhir:Patient.name(?p, ?n)
fhir:Account(?a) ^ fhir:name(?a, ?n) -> fhir:Account.name(?a, ?n)
fhir:Patient.name(?p, ?n) -> fhir:name(?p, ?n)
fhir:Account.name(?a, ?n) -> fhir:name(?a, ?n)
FHIR RDF represents primitive types — elements with a single literal value such as an xsd:string — using the single data property fhir:v.
Primitive types, like all FHIR data types, are extensible, and so the fhir:v assertion allows a primitive type element to add a FHIR Extension.
The extra fhir:v also prevents punning some choice type elements that can either be a primitive type or non-primitive type (e.g. Observation.value) as both an data property and object property, which would be non-conformant with OWL 2.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
| Primitive type value | owl:allValuesFrom/cardinality |
fhir:Code SubClassOf: fhir:v only xsd:string |
No FHIR-specific annotation properties are currently defined.
StructureDefinition.description
and ElementDefinition.definition
map to rdfs:comment, and rdfs:isDefinedBy links each derived OWL class or object property to its
corresponding StructureDefinition or ElementDefinition(s).
FHIR conformance rules [[FHIR-Conformance]] include the required data types and cardinalities of elements defined in StructureDefinitions. Not all conformance rules are computable and some are only informally documented in Implementation Guides.
The FHIR ontology represents some, but not all, computable conformance rules as property restriction axioms using terms from OWL 2 DL
like owl:allValuesFrom, owl:cardinality, and owl:unionOf.
All axioms are stated with rdfs:subClassOf, representing necessary conditions, or logical consequences, of being an instance of a class.
Because of its open-world semantics, axioms in OWL should not be understood as syntactic constraints on what data must be present.
Instead, FHIR ontology axioms describe what is true of conformant FHIR data, rather than prescribe any particular syntactic representation of FHIR data.
FHIR RDF data could be invalid or non-conformant while logically consistent with the FHIR ontology for two different reasons. First, data might violate a conformance rule that is not represented as an axiom, such as a FHIRPath constraint. Second, data might violate a conformance rule that is represented as an axiom, such as minimum cardinality, while still being consistent with that axiom in an open-world interpretation. In summary: FHIR ontology axioms are always true of valid FHIR data, but not always inconsistent with invalid FHIR data. A closed-world system like FHIR ShEx should be used for validating data, while the FHIR ontology axioms are intended for open-world, logical inference.
In practice, invalid FHIR data is exchanged, stored, and analyzed in some FHIR workflows.
A SPARQL query for anything that is rdf:type fhir:Patient will return data that includes this assertion, regardless of whether it is invalid or inconsistent with the FHIR ontology.
The base definition
of a StructureDefinition is another StructureDefinition, which the FHIR ontology maps to an rdfs:subClassOf relation
between the corresponding OWL classes. For example, fhir:Patient is a subclass of
fhir:DomainResource, which is equivalent to the universal statement: Anything that is a FHIR Patient is also a FHIR DomainResource.
If a resource is rdf:type fhir:Patient, then an OWL reasoner will infer that it is also rdf:type fhir:DomainResource.
StructureDefinition.abstract means that resources defined by this type shall not be instantiated without instantiating a more specific, non-abstract type.
For example, a FHIR resource is invalid if it is asserted to be an instance of fhir:Resource and not a more specific class corresponding to a non-abstract StructureDefinition.
The FHIR ontology does not represent StructureDefinition.abstract with an axiom because, in this example, every resource is already implicitly rdf:type fhir:Resource.
But OWL does not require this inference to be asserted due to its open-world semantics.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
StructureDefinition.baseDefinition |
rdfs:subClassOf |
fhir:Patient SubClassOf: fhir:DomainResource |
An ElementDefinition may define a target
element type, the value of which is defined by a
StructureDefinition, and therefore represented as an OWL class. For example, if a valid
Patient.active element has a value,
then its type is boolean,
represented as the class fhir:Boolean.
The FHIR ontology represents target type relations with owl:allValuesFrom axioms.
A FHIR dateTime is defined as a union of the XML Schema types xsd:dateTime,
xsd:date, xsd:gYearMonth, and xsd:gYear.
Because the literal value of a primitive type element is represented with fhir:v, fhir:DateTime has an owl:unionOf axiom stating that all
of its fhir:v values are one of those XML Schema types.
FHIR choice types, or polymorphic types, are also represented with owl:unionOf. For example,
Observation.effective can be a dateTime, instant, Period, or
Timing, so fhir:Observation is a subclass of the things whose fhir:effective
values are only instances of fhir:DateTime, fhir:Instant, fhir:Period, or
fhir:Timing. In FHIR RDF, an instance of a choice type includes an rdf:type assertion stating which of these types it is. This is analogous to the type being suffixed to
the element name in JSON, as in the "effectiveDateTime" property of a FHIR JSON Observation.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
Non-complex ElementDefinition.type.code |
rdfs:subClassOf &
owl:allValuesFrom ('only') |
fhir:Patient SubClassOf: fhir:deceased only (fhir:Boolean or fhir:DateTime)
|
The reference type of an ElementDefinition defines the type of FHIR resource the element refers to, if at all.
For example, every valid Condition.subject refers only to a resource of type Patient or Group.
Each FHIR RDF fhir:Reference element optionally asserts an additional fhir:l (resource link) to an IRI for the referenced resource.
The FHIR ontology represents reference type relations with owl:allValuesFrom axioms on
fhir:l.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
ElementDefinition.type.targetProfile |
rdfs:subClassOf &
owl:allValuesFrom ('only') & fhir:l (resource link) |
fhir:Condition SubClassOf: fhir:subject only (fhir:l only (fhir:Patient or fhir:Group))
|
The cardinality
of an ElementDefinition defines how many values the element could have.
The FHIR ontology represents element cardinality with owl:cardinality, owl:minCardinality, and
owl:maxCardinality axioms on the class corresponding to its StructureDefinition or parent, complex ElementDefinition. For example,
Condition.subject has a minimum and maximum cardinality of 1, so
every valid fhir:Condition instance is related via fhir:subject to exactly one thing. Cardinality axioms are separate from reference type axioms.
Minimum cardinality axioms in OWL are usually not inconsistent with RDF data due to its open-world semantics.
An instance of fhir:Condition may be missing a fhir:subject, but an
OWL reasoner will not assume that the missing data does not exist anywhere, or that the represented condition is not associated with anyone.
A closure axiom stating that the fhir:Condition resource only has the fhir:subject values explicitly stated would be needed for an inconsistency.
For validation purposes, the FHIR ShEx schema can instead be
used to check whether the required data is present. Minimum cardinality axioms are more useful as sufficient conditions
in owl:equivalentClass axioms for analytics.
Maximum cardinality axioms can detect some inconsistencies for invalid data, but they can also lead to unintuitive
inferences. If a fhir:Condition has more than one fhir:subject (which would be invalid in a closed-world interpretation),
an OWL reasoner would infer that the subjects are the same, unless given a reason why they are distinct.
Fortunately, FHIR resources and elements can be distinguished by their primitive type elements.
Two instances of fhir:Patient with different fhir:id values will be inferred to be distinct, because fhir:Id has at most one fhir:v literal value.
Similarly, any other primitive type elements like fhir:String or fhir:Uri are uniquely identifiable by their required fhir:v values, and therefore necessarily distinct.
| FHIR | FHIR OWL | Example abbr. [[owl2-manchester-syntax]] |
|---|---|---|
ElementDefinition.min/max |
owl:min/max/cardinality ('min' or 'max') |
fhir:Condition SubClassOf: fhir:subject exactly 1
|
A FHIR sliced element type could have multiple values of different element types and with different cardinalities.
Slicing types are only used in FHIR profiles, not in the core, normative FHIR StructureDefinitions, and therefore are not represented in the FHIR ontology.
Profiles may be similarly mapped to OWL classes and slicing types represented with owl:qualifiedCardinality axioms.
FHIRPath expressions are not mapped to OWL axioms but could be in the future.
The ValueSet bindings of an ElementDefinition specifies which sets of codes are intended be used as values for this element. The FHIR ontology does not represent ValueSet bindings but could in the future.
The FHIR ontology can be used by either materializing inferences from an OWL reasoner or rewriting certain subsets of OWL axioms [[owl2-profiles]] to queries. The HermiT [[HermiT]] reasoner is recommended for OWL 2 DL reasoning and the ELK [[ELK]] reasoner for OWL 2 EL. A few pre-processing steps are recommended:
xsd:date to supported data types like xsd:dateTime or time:DateTimeDescription, but avoid relying on any invented precision.
Custom, defined classes can encode reusable logic that composes with SPARQL queries [[Blending-FHIR-OWL]].
This works especially well with concept IRIs for external OWL classes corresponding to terminology codes.
Example 8 is a FHIR SPARQL query for all Patients with some DiagnosticReport with the SNOMED code for "Malignant neoplastic disease", 363346000.
This simplified query assumes the data includes no RDF collections.
SELECT ?patient WHERE {
?diagnosticReport a fhir:DiagnosticReport ;
fhir:conclusionCode [
fhir:concept [
fhir:coding [
fhir:code [ fhir:v "363346000" ] ;
fhir:system [ fhir:v "http://snomed.info/sct"^^xsd:anyURI ]
]
]
] ;
fhir:subject/fhir:l ?patient .
?patient a fhir:Patient .
}
This logic can be re-defined in an OWL class in Example 9 that takes advantage of FHIR RDF concept IRIs instead of relying on literal code values.
The owl:someValuesFrom axiom is equivalent to owl:minCardinality 1 owl:Thing.
# "fhir:DiagnosticReport
# and fhir:conclusionCode some
# (fhir:concept some 'Malignant neoplastic disease (disorder)')"
:CancerReport a owl:Class ;
owl:equivalentClass [
owl:intersectionOf (
fhir:DiagnosticReport
[ rdf:type owl:Restriction ;
owl:onProperty fhir:conclusionCode ;
owl:someValuesFrom [
rdf:type owl:Restriction ;
owl:onProperty fhir:concept ;
owl:someValuesFrom sct:363346000
]
]
)
] .
Given a relevant fragment of SNOMED OWL (at least the term sct:363346000 and its subclasses) [[SNOMED-OWL-Toolkit]], an OWL 2 EL [[owl2-profiles]] reasoner like ELK [[ELK]] will infer the statement a :CancerReport on any matching data.
These inferred statements can be saved to a materialized graph, similar to a materialized view.
The defined OWL class :CancerReport provides two benefits:
First, it can classify not only DiagnosticReports coded with 363346000, but also DiagnosticReports with any code subsumed by 363346000.
Second, it can be reused to compose multiple different queries like in Example 10 or other classes in a consistent way.
SELECT ?patient WHERE {
?diagnosticReport a :CancerReport ;
fhir:subject/fhir:l ?patient .
?patient a fhir:Patient .
}
Example 11 shows further composition using terms like owl:inverseOf, which goes beyond OWL 2 EL.
# "fhir:Patient
# and ( inverse (fhir:l) some
# ( inverse (fhir:subject) some :CancerReport))"
:PatientWithCancerReport rdf:type owl:Class ;
owl:equivalentClass [
owl:intersectionOf (
fhir:Patient
[ rdf:type owl:Restriction ;
owl:onProperty [ owl:inverseOf fhir:l ] ;
owl:someValuesFrom [ rdf:type owl:Restriction ;
owl:onProperty [ owl:inverseOf fhir:subject ] ;
owl:someValuesFrom :CancerReport
]
]
)
] .
Materializing the inferred instances of this class enables SPARQL queries to be further reduced to Example 12:
SELECT ?patient WHERE {
?patient a :PatientWithCancerReport .
}
In other contexts, simplified "knowledge graphs" may also be derived from the FHIR ontology, using SPARQL queries, for the purpose of more compactly representing queryable FHIR resource type and element type relationships.
For example, one might derive a triple like fhir:Patient fhir:contact fhir:Patient.contact.
Note that this is not conformant OWL 2, which distinguishes between classes and individuals.
The FHIR ontology can be used to map between FHIR and non-FHIR concepts or data using techniques that do not rely on FHIR-specific tooling, for example in .
Ontology-based data access systems such as Ontop (open-source) can rewrite OWL 2 QL [[owl2-profiles]] axioms and SPARQL queries to SQL. This has been used with the FHIR ontology to dynamically rewrite FHIR SPARQL [[FHIR-Ontop-OMOP]] to SQL queries on OMOP relational data [[OMOP]].
Terminology mappings using rdfs:subClassOf, owl:equivalentClass, or SKOS [[skos-reference]] can sometimes be used instead of FHIR ConceptMap resources.
This enables FHIR data to be queried with both terminology expansion and mapping transformations implemented as logical inference.
Finally, FHIR resources could be interpreted more literally as information models to better integrate with some scientific ontologies, like those from the Open Biological and Biomedical Ontology Foundry [[OBO]].
For example, the relationship between a coded data element and a concept IRI could be interpreted with a mapping from the Information Artifact Ontology.
Example 13 shows an Observation.code element that is about (obo:IAO_0000136) a clinical finding of tinnitus, interpreted to be something that someone participates in (to say the least) [[SNOMED-BFO-Schulz]].
The tinnitus itself is represented as a phenotypic abnormality in the context of the Human Phenotype Ontology, but its direct relationship to the clinical finding is left unspecified.
The person who has the tinnitus is represented by both a fhir:Patient and a fhir:Person resource to show that these are distinct in FHIR.
Many alternative interpretations are possible. Tinnitus can be modeled as associated with a kind of symptom, disease, disorder, process, disposition, etc. depending on the context. A mapping is valuable not only when it is correct, but also when it helps us understand exactly why it might be incorrect. Note that the FHIR RDF data in Example 13 is not conformant for exchange and the core FHIR specification does not endorse any mappings like these, which will vary depending on the data, codes, and ontologies involved.
@prefix obo: <http://purl.obolibrary.org/obo/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
:exampleObservationRecord a fhir:Observation ;
fhir:subject [
fhir:reference [ fhir:v "Patient/examplePatientRecord" ] ;
fhir:l :examplePatientRecord # OPTIONAL resource link
] ;
# Re-interpretation of concept IRI. Coding omitted for brevity.
fhir:code [
# 'is about' from Information Artifact Ontology
obo:IAO_0000136 :exampleTinnitusFinding ;
] .
# 'Tinnitus (finding)' from SNOMED
:exampleTinnitusFinding a sct:60862001 .
# 'tinnitus' from Human Phenotype Ontology
:exampleTinnitus a obo:HP_0000360 .
# Alternative, non-specific terminology mapping
sct:60862001 skos:relatedMatch obo:HP_0000360 .
# Associated Patient and Person records
:examplePatientRecord a fhir:Patient .
:examplePersonRecord a fhir:Person ;
fhir:link [
fhir:target [
fhir:l :examplePatientRecord ;
fhir:reference [ fhir:v "Patient/examplePatientRecord" ] ;
] ;
] .
# Monotonic mapping to ontologies
:examplePatientRecord a obo:OBI_0000078 ; # 'eMedical Record' from Ontology for Biomedical Investigations
# 'is about'
obo:IAO_0000136 :examplePerson .
:examplePersonRecord a obo:OBI_0000078 ; # 'eMedical Record' from Ontology for Biomedical Investigations
# 'is about'
obo:IAO_0000136 :examplePerson .
:examplePerson a obo:MF_0000016 ; # 'human being' from Mental Functioning Ontology
# 'has role' from Relations Ontology
obo:RO_0000087 [
a obo:OBI_0000093 ; # 'patient role' from Ontology for Biomedical Investigations
] ;
# 'participates in' from Relations Ontology
obo:RO_0000056 :exampleTinnitusFinding ;
# 'has phenotype' from Relations Ontology
obo:RO_0002200 :exampleTinnitus .
OWL ontologies for FHIR RDF versions STU3 [[FHIR-OWL-STU3]], R4 [[FHIR-OWL-R4]], and R5 [[FHIR-OWL-R5]] are available to use but will only be officially updated if their corresponding FHIR specification versions publish new updates.
FHIR ontology versions can generally be made syntactically compatible with if a few differences and bugs are accounted for.
Different FHIR core versions are not typically used in the same contexts, but the ontology versions could be by adding a version prefix to the base IRI (e.g. http://hl7.org/fhir/r4/), like in the owl:versionIRI.
Version R6:
fhir:Code to differentiate from object properties like fhir:code.ElementDefinition.id for the names of BackboneElement subclasses.rdfs:isDefinedBy provenance annotations.Versions R5 and R6:
fhir:name instead of fhir:Patient.name for legibility.fhir:l for resource links and fhir:v for primitive type literal values.Version R5:
Versions R5, R4, and STU3:
fhir:code, resulting in some ambiguity (in R5).Versions R4 and STU3:
fhir:Patient.name instead of short names like fhir:name.fhir:link for resource links and fhir:value for primitive type literal values.HL7® and FHIR® are the registered trademarks of Health Level Seven International and the use of these trademarks does not constitute an endorsement by HL7.
This document contains content that is copyright of SNOMED International. Implementers must have the appropriate SNOMED CT Affiliate license.
This document contains content from LOINC. LOINC is copyright © Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc.
David Booth, Eric Prud'hommeaux, Harold Solbrig, and Anthony Mallia conceived of the FHIR ontology.
Tim Prudhomme authored this document. Programmers for the FHIR OWL ontology generator: Anthony Mallia for STU3, Harold Solbrig for R4, Daniel Stone for R5, Tim Prudhomme for R6.
W3C HCLS Community Group (previously "Interest Group") and HL7 contributors to the development of the FHIR ontology include: Jim Balhoff, David Booth, Erich Bremer, Grahame Grieve, Detlef Grittner, Rob Hausam, Anthony Mallia, Josh Mandel, Lloyd McKenzie, Claude Nanjo, Tim Prudhomme, Eric Prud'hommeaux, Harold Solbrig, Daniel Stone, and Gaurav Vaidya.