# Comments and Annotations

## Overview

Annotations and comments critical in providing a well documented instance document. These annotations can be either human generated (e.g. notes taken by researcher during an fMRI 'study' that discuss the subject's demeanor during a scan 'segment') or generated by processing tools (e.g. when a software tool reads/modifies/generates a document).

## Examples

The use of annotations (and comments) is embedded within the XCEDE schema itself.

Annotation Schema Components

    	<xs:simpleType name="comment_t">
    		<xs:restriction base="xs:string">
    		</xs:restriction>
    	</xs:simpleType>

    	<xs:attributeGroup name="authoredText_ag">
    		<xs:attribute name="author" type="xs:string"/>
    		<xs:attribute name="timestamp" type="xs:dateTime"/>
    	</xs:attributeGroup>

    	<xs:complexType name="abstract_annotation_t" abstract="true">
    		<xs:attributeGroup ref="authoredText_ag"/>
    	</xs:complexType>

    	<xs:complexType name="textAnnotation_t">
    		<xs:complexContent>
    			<xs:extension base="abstract_annotation_t">
    				<xs:sequence>
    					<xs:element name="comment" type="comment_t" minOccurs="1" maxOccurs="1"/>
    				</xs:sequence>
    			</xs:extension>
    		</xs:complexContent>
    	</xs:complexType>

As an example of the use of annotations, in the context of a subject detailed above, the following example shows a quick example.

Terminology String Instance

    <?xml version="1.0" encoding="UTF-8"?>
    <XCEDE xmlns="http://www.xcede.org/xcede-2"
           <subject>
            <annotationList>
                <annotation author="Annotation Author">
                    <comment>This is an example annotation</comment>
                </annotation>
            </annotationList>
        </subject>
    </XCEDE>

## Reference

comment_t

abstract_annotation_t

abstract_annotation_t