\hypertarget{union}{}\subsection{union}\label{union}
Union datatypes merge the lexical spaces of several existing types to create another. Because OWL does not currently support user-defined datatypes, \hyperlink{classcom_1_1hp_1_1gloze_1_1_gloze}{Gloze} uses only the union member types to define datatyped literals.



\begin{DocInclude}\begin{verbatim}<?xml version="1.0" encoding="UTF-8"?>
<union xmlns="http://example.org/">foobar</union>

\end{verbatim}
\end{DocInclude}


This XML conforms to the schema below. The content is either an xs:int or an xs:string.



\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:element name="union">
                <xs:simpleType>
                        <xs:union memberTypes="xs:int xs:string" />
                </xs:simpleType>
        </xs:element>
        
</xs:schema>
\end{verbatim}
\end{DocInclude}


The XML content is validated against both xs:int and xs:string to determine its type. In this case it is an xs:string.



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/union.xml
@prefix ns1:     <http://example.org/def/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .

<>    ns2:union "foobar" .
\end{verbatim}
\end{DocInclude}


There's little to say about the range of the property. A simple type may sometimes map to an object type (e.g. QNames), so a union is not necessarily a datatype property. In this case, both member types map to datatype properties so 'union' is a datatype property.



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

ns2:union
      a       owl:DatatypeProperty , rdf:Property .

<>    a       owl:Ontology .

(xs_:int xs_:string) .
\end{verbatim}
\end{DocInclude}
\hypertarget{union_unionChildren}{}\subsubsection{Child components}\label{union_unionChildren}
\begin{itemize}
\item \hyperlink{annotation}{annotation}\item \hyperlink{simpletype}{simple\-Type} \end{itemize}
