\hypertarget{elementString}{}\subsection{Datatype example xs:string}\label{elementString}
The 'string' element contains an xs:string \char`\"{}foobar\char`\"{} as its content.



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


This is defined in its schema.



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


The N3 translation declares a namespace prefix 'xs\_\-' that allows the full URI $<$\href{http://www.w3.org/2001/XMLSchema#string}{\tt http://www.w3.org/2001/XMLSchema\#string}$>$ to be abbreviated to xs\_\-:string. Note that the RDF mapping preserves namespaces declared in the XML (so they can be recovered in the reverse mapping), the namespace 'xs' defined as $<$\href{http://www.w3.org/2001/XMLSchema}{\tt http://www.w3.org/2001/XMLSchema}$>$ is already taken, so \hyperlink{classcom_1_1hp_1_1gloze_1_1_gloze}{Gloze} defines an {\em extended\/} version with a trailing '\#' and adds the underscore to the name. The XML base is \href{http://example.org/}{\tt http://example.org/}



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/elementString.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:string "foobar"^^xs_:string .
\end{verbatim}
\end{DocInclude}
 