###### 3.1.5.1.18 subjectRel

The <subjectRel> element contains a set of subjects that are related in some manner. Each group of subjects is contained in a <subjectRole> element; the associations between different columns in the same row are evaluated in the same way as those in a <relrow> (from which <subjectRel> is specialized) but define relationships between the subjects instead of links between topic documents.

###### Contains

Doctype | Content model
subjectScheme | ( (subjectRole) (one or more) )

###### Contained by

Doctype | Content model
subjectScheme | subjectRelTable

###### Inheritance

- map/relrow subjectScheme/subjectRel

###### Example

The subject relationship table in this example establishes environmentFor relationships between operating systems and applications. Based on the subjectRole element, subjects in the first column are operating systems which are the environment for an application, while subjects in the second column are applications that run in that environment. For a user interested in content about the operating system, content about the applications may also be relevant.

    <subjectScheme>
      <hasKind>
        <subjectdef keys="operatingSystem">
            <subjectdef keys="linuxOS"/>
            <subjectdef keys="windowsOS"/>
        </subjectdef>
        <subjectdef keys="application">
            <subjectdef keys="IDE">
                <subjectdef keys="eclipseIDE"/>
                <subjectdef keys="visualStudioIDE"/>
            </subjectdef>
            <subjectdef keys="webBrowser">
                <subjectdef keys="firefoxBrowser"/>
                <subjectdef keys="ieBrowser"/>
            </subjectdef>
        </subjectdef>
      </hasKind>
      ...
      <subjectRelTable>
        <subjectRelHeader>
          <subjectRole>
            <subjectdef keyref="operatingSystem">
              <hasRelated keyref="environmentFor">
                <subjectdef keyref="application"/>
              </hasRelated>
            </subjectdef>
          </subjectRole>
          <subjectRole>
            <subjectdef keyref="application"/>
          </subjectRole>
        </subjectRelHeader>
        <subjectRel>
          <subjectRole>
            <subjectdef keyref="linuxOS"/>
            <subjectdef keyref="windowsOS"/>
          </subjectRole>
          <subjectRole>
            <subjectdef keyref="eclipseIDE"/>
            <subjectdef keyref="firefoxBrowser"/>
          </subjectRole>
        </subjectRel>
        <subjectRel>
          <subjectRole>
            <subjectdef keyref="windowsOS"/>
          </subjectRole>
          <subjectRole>
            <subjectdef keyref="ieBrowser"/>
            <subjectdef keyref="visualStudioIDE"/>
          </subjectRole>
        </subjectRel>
      </subjectRelTable>
    </subjectScheme>

A table view of the subjectRelTable may look like this; each <subjectRel> represents a single row, and each <subjectRole> represents a cell.

subjectRelTable as a table

    <subjectdef keyref="operatingSystem">
     <hasRelated keyref="environmentFor">
      <subjectdef keyref="application"/>
     </hasRelated>
    </subjectdef>
    <subjectdef keyref="application"/>
<subjectdef keyref="linuxOS"/> <subjectdef keyref="windowsOS"/> | <subjectdef keyref="eclipseIDE"/> <subjectdef keyref="firefoxBrowser"/>
<subjectdef keyref="windowsOS"/> | <subjectdef keyref="ieBrowser"/> <subjectdef keyref="visualStudioIDE"/>

###### Attributes

Name | Description | Data Type | Default Value | Required?
univ-atts attribute group (includes select-atts, id-atts, and localization-atts groups) | A set of related attributes, described in 3.4.1.3 univ-atts attribute group |  |  |
global-atts attribute group (xtrf, xtrc) | A set of related attributes, described in 3.4.1.2 global-atts attribute group |  |  |
class | A common attribute described in 3.4.1.9 Other common DITA attributes |  |  |

Previous Topic: 3.1.5.1.17 subjectRelHeader

Next Topic: 3.1.5.1.19 subjectRole

Parent Topic: 3.1.5.1 Subject scheme maps

Sibling Topics:

3.1.5.1.1 subjectScheme

3.1.5.1.2 schemeref

3.1.5.1.3 hasInstance

3.1.5.1.4 hasKind

3.1.5.1.5 hasNarrower

3.1.5.1.6 hasPart

3.1.5.1.7 hasRelated

3.1.5.1.8 enumerationdef

3.1.5.1.9 elementdef

3.1.5.1.10 attributedef

3.1.5.1.11 defaultSubject

3.1.5.1.12 subjectHead

3.1.5.1.13 subjectHeadMeta

3.1.5.1.14 subjectdef

3.1.5.1.15 relatedSubjects

3.1.5.1.16 subjectRelTable

3.1.5.1.17 subjectRelHeader

3.1.5.1.19 subjectRole