\hypertarget{attribute}{}\subsection{attribute}\label{attribute}
Attributes map to RDF properties. An instance of an attribute maps to an RDF statement. A qualified attribute is defined in the target namespace of the schema. The target namespace is the namespace of the corresponding RDF property.

e.g. The following schema declares a global and therefore qualified attribute 'foo' defined in the target namespace.



\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/">
        <xs:attribute name="foo" />
</xs:schema>
\end{verbatim}
\end{DocInclude}


By default, we take the closure over global attributes, assuming that {\em all\/} uses of the property conform to this global declaration. This means that 'foo' globally ranges over rdfs:Literal (the datatype corresponding to xs:any\-Simple\-Type). If this assumption is false, attribute closure may be disabled (closed=false), and global ranges are not asserted.



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/attribute1.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#> .

<>    a       owl:Ontology .

ns1:foo
      a       owl:DatatypeProperty , rdf:Property ;
      rdfs:range rdfs:Literal .
\end{verbatim}
\end{DocInclude}


Like elements, if the target namespace ends with an alpha-numeric a fragment separator '\#' is introduced.

Unqualified attributes are not defined in the target namespace. Unqualified attributes occur if no target namespace is defined, or where the attribute is defined locally and its form is unqualified. The example below defines the attribute 'foo' locally within an attribute\-Group; it's form is unqualified by default.



\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/">
        <xs:attributeGroup name="myGroup">
                <xs:attribute name="foo"/>
        </xs:attributeGroup>
</xs:schema>
\end{verbatim}
\end{DocInclude}


All we can say about the attribute is that it is a property, for the same name may be re-used where its range is a different datatype or even an object type. Closure doesn't apply to local attributes.

The following OWL was produced with lang=N3. The unqualified attribute is defined in the user-supplied default namespace, with xmlns=http://example.org/def/ .



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/attribute2.owl
@prefix ns1:     <http://example.org/def/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/> .
@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:foo
      a       owl:DatatypeProperty , rdf:Property .

<>    a       owl:Ontology .
\end{verbatim}
\end{DocInclude}


In xml schema, attributes have their own symbol space, distinct from other components such as elements and types. If there are overlaps between these symbol spaces, it is advisable to introduce a symbolic prefix to keep them distinct.

e.g. the attribute named 'foo' and type named 'foo' in the target namespace \href{http://example.org/}{\tt http://example.org/} will clash. Introducing a symbolic prefix '@' (at the command line) for attributes resolves the clash giving us an RDF property name \href{http://example.org/@foo.}{\tt http://example.org/@foo.}

The OWL mapping below was generated from the first schema above, but with attribute=@



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/attribute3.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#> .

<http://example.org/@foo>
      a       owl:DatatypeProperty , rdf:Property ;
      rdfs:range rdfs:Literal .

<>    a       owl:Ontology .
\end{verbatim}
\end{DocInclude}
\hypertarget{attributenotation_attributeChildren}{}\subsubsection{Child components}\label{attributenotation_attributeChildren}
\begin{itemize}
\item \hyperlink{simpletype}{simple\-Type}\item \hyperlink{annotation}{annotation} \end{itemize}
