\hypertarget{documentation}{}\subsection{Documentation}\label{documentation}
Documentation on a schema, element, attribute or complex type is recorded as rdfs:comment. Documentation for the schema is added to the owl:Ontology header. Documentation for a complex type is added to the corresponding class. Documentation for an element or attribute is added to the corresponding property.



\begin{DocInclude}\begin{verbatim}<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://example.org/" xmlns="http://example.org/"
        elementFormDefault="qualified">
        
        <xs:annotation>
                <xs:documentation>annotated schema</xs:documentation>
        </xs:annotation>
        
        <xs:attribute name="attribute" >
                <xs:annotation>
                        <xs:documentation xml:lang="en">annotated attribute</xs:documentation>
                </xs:annotation>
        </xs:attribute>

        <xs:element name="element" type="ComplexType">
                <xs:annotation>
                        <xs:documentation xml:lang="en">annotated element</xs:documentation>
                </xs:annotation>
        </xs:element>

        <xs:complexType name="ComplexType">
                <xs:annotation>
                        <xs:documentation xml:lang="en">annotated type</xs:documentation>
                </xs:annotation>
        </xs:complexType>

</xs:schema>
\end{verbatim}
\end{DocInclude}


The translation into OWL is as follows:



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/documentation.owl
@prefix ns1:     <http://example.org/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/def/> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix daml:    <http://www.daml.org/2001/03/daml+oil#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .

ns1:attribute
      a       owl:DatatypeProperty , rdf:Property ;
      rdfs:comment "annotated attribute"@en ;
      rdfs:range rdfs:Literal .

ns1:element
      a       owl:ObjectProperty ;
      rdfs:comment "annotated element"@en ;
      rdfs:range ns1:ComplexType .

<>    a       owl:Ontology ;
      rdfs:comment "annotated schema" .

ns1:ComplexType
      a       owl:Class ;
      rdfs:comment "annotated type"@en .
\end{verbatim}
\end{DocInclude}
 