<?xml version="1.0" encoding="utf-8"?>
<!--
  *Notice*
-->
<!--
  This is a working draft of the Web Description Resources (WDR) datatypes, open to be modified based on the POWDER WG comments and the related POWDER specifications. Please address any comments to the POWDER member list ( member-powderwg@w3.org ).
-->
<!--
  *Overview*
-->
<!--
  Most properties defined in the WDR vocabulary (http://www.w3.org/TR/powder-voc ) have as range space-separated list of strings, which may be either "generic" strings or URI strings (strings of specific URI components). XML Schema built-in datatypes (http://www.w3.org/TR/xmlschema-2/ ) are not suitable to define the range of such attributes, and, to the best of our knowledge, no user-defined datatypes can be used for the same purpose. For this reason, we define here a set of atomic datatypes for both generic and URI strings, and the corresponding set of list datatypes (we remind that XML Schema list datatypes denote space-separated list of literals; see http://www.w3.org/TR/xmlschema-2/#datatype-dichotomies ). 
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2007/05/powder-xsd" targetNamespace="http://www.w3.org/2007/05/powder-xsd" elementFormDefault="qualified" version="1.0" xml:lang="en">
	<xsd:annotation>
		<xsd:documentation xml:lang="en">3</xsd:documentation>
	</xsd:annotation>
	<!--
  *Atomic datatypes*
-->
	<!--
  POWDER atomic datatypes denote the types of strings which may be used in a space-separated list. For each URI component (scheme, userInfo, host, port, path, query, and fragment), we define a specific type of string (wdrd:uriScheme, wdrd:uriUserInfo, etc.). In addition, atomic datatypes are defined for URI port ranges (wdrd:uriPortRange), IP addresses (wdrd:ip), and IP ranges, expressed as CIDR blocks (wdrd:cidr).
-->
	<!--
  We do not define atomic datatypes for generic strings or absolute/relative URIs, since xsd:string and xsd:anyURI, respectively, can be used for this purpose.
-->
	<xsd:simpleType name="uriScheme">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the scheme component of a URI.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[a-zA-Z]+[a-zA-Z0-9\+\-\.]*"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriUserInfo">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the userInfo component of a URI.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[^/?#@\s]+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriHost">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the host component of a URI, carrying a registered name.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[^/?#@:\s]+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriPort">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the port component of a URI.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="(\d{1}|[1-9]\d*)"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriPath">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the path component of a URI.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[^?#\s]+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriQuery">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the query component of a URI.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[^#\s]+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriFragment">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to the fragment component of a URI.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[^#\s]+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriPortRange">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to a range of logical ports.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="(\d{1}|[1-9]\d*)\-(\d{1}|[1-9]\d*))"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="ip">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to a IPv4 or IPv6 address.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="(((([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5]))|((([\da-fA-F]{1,4})|(\:))\:){7}(([\da-fA-F]{1,4})|(\:))))"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="cidr">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a string corresponding to a CIDR block.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="(((([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\/(\d|[1-2]\d|3[0-2]))|((([\da-fA-F]{0,4})|(\:))\:){7}(([\da-fA-F]{0,4})|(\:)))\/([1-9]?\d|1[01]\d|12[0-8])))"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!--

*List Datatypes*

-->
	<xsd:simpleType name="stringList">
		<xsd:list itemType="xsd:string"/>
	</xsd:simpleType>
	<!--

The wdrd:stringList datatype is for WDR properties having as value a list of generic strings.

-->
	<xsd:simpleType name="uriList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URIs.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="xsd:anyURI"/>
	</xsd:simpleType>
	<!--

The wdrd:uriList datatype is for WDR properties having as value a list of absolute URIs.

-->
	<xsd:simpleType name="uriSchemeList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI schemes.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriScheme"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriUserInfoList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI userInfos.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriUserInfo"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriHostList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI hosts.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriHost"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriPortList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI ports.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriPort"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriPathList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI paths.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriPath"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriQueryList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI queries.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriQuery"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriFragmentList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of URI fragments.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriFragment"/>
	</xsd:simpleType>
	<xsd:simpleType name="uriPortRangeList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of logical port ranges.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="uriPortRange"/>
	</xsd:simpleType>
	<xsd:simpleType name="ipList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of IP addresses.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="ip"/>
	</xsd:simpleType>
	<xsd:simpleType name="cidrList">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The datatype denoting a space-separated list of CIDR blocks.</xsd:documentation>
		</xsd:annotation>
		<xsd:list itemType="cidr"/>
	</xsd:simpleType>
</xsd:schema>
