<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:html="http://www.w3.org/1999/xhtml"
	xmlns:eca="http://www.semwebtech.org/eca/2006/eca-ml"
	xmlns:r3="http://rewerse.net/I5/NS/r3/2005#"
	xmlns:log="http://www.semwebtech.org/lang/2006/logic"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	elementFormDefault="unqualified"
	attributeFormDefault="unqualified"
	version="0.12">
	<xsd:annotation>
		<xsd:documentation>
			<html:a
				href="http://rewerse.net/I5/r3/"
				target="_blank">
				r3
			</html:a>
			provides and supports this XML Schema for compatibility with the
			<html:a
				href="http://www.semwebtech.org/eca/frontend/"
				target="_blank">
				ECA Framework
			</html:a>
			(by translation between ECA-ML and r3).
			<html:br />
			All the elements here included translate into elements of the
			<html:a href="r3_xsd.html">r3</html:a>
			namespace and are limited versions of the ones supported by the
			<html:a href="http://www.semwebtech.org/">ECA Framework</html:a>
			.
			<html:br />
			Currently, elements that do not belong to the
			<html:a href="ecaml_xsd.html">eca</html:a>
			or
			<html:a href="r3_xsd.html">r3</html:a>
			namespaces are not supported outside of a
			<html:a href="#element_response">response</html:a>
			or of an
			<html:a href="ecaml_xsd.html">eca</html:a>
			:
			<html:a href="ecaml_xsd.html#element_opaque">opaque</html:a>
			(viz. any
			<html:a href="ecaml_xsd.html">eca</html:a>
			:
			<html:a href="ecaml_xsd.html#group_Expression">Expression</html:a>
			is ignored and may cause an error; unless it is an
			<html:a href="ecaml_xsd.html">eca</html:a>
			:
			<html:a href="ecaml_xsd.html#element_opaque">opaque</html:a>
			or an
			<html:a href="r3_xsd.html">r3</html:a>
			:
			<html:a href="r3_xsd.html#group_Expression">Expression</html:a>
			).
			<html:br />
			Beware that none of the
			<html:a href="http://www.semwebtech.org/">ECA Framework</html:a>
			namespaces (viz. logic and eca) is slash (/) or hash (#)
			terminated.
		</xsd:documentation>
	</xsd:annotation>

	<xsd:import
		namespace="http://www.semwebtech.org/eca/2006/eca-ml"
		schemaLocation="ecaml.xsd" />
	<xsd:import
		namespace="http://rewerse.net/I5/NS/r3/2005#"
		schemaLocation="r3.xsd" />
	<xsd:import
		namespace="http://www.semwebtech.org/lang/2006/logic"
		schemaLocation="logic.xsd" />
	<xsd:import
		namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
		schemaLocation="rdf.xsd" />

	<xsd:element name="register">
		<xsd:annotation>
			<xsd:documentation>
				This element translates into an
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Load">Load</html:a>
				if it contains any
				<html:a href="ecaml_xsd.html">eca</html:a>
				:
				<html:a href="ecaml_xsd.html#element_rule">rule</html:a>
				or any form of
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#group_RulePackage">
					RulePackage
				</html:a>
				. Otherwise it translates into an
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Install">Install</html:a>
				.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element
					name="subject"
					type="xsd:anyURI" />
				<xsd:choice>
					<xsd:choice>
						<xsd:element ref="eca:rule" />
						<xsd:group ref="r3:RulePackage" />
					</xsd:choice>
					<xsd:choice>
						<xsd:element ref="eca:opaque" />
						<xsd:group ref="r3:Native" />
					</xsd:choice>
				</xsd:choice>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="deregister">
		<xsd:annotation>
			<xsd:documentation>
				This element translates into an
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Terminate">
					Terminate
				</html:a>
				.
				<html:br />
				The &lt;subject&gt; refers to a previous
				<html:a href="#element_register">register</html:a>
				or asynch
				<html:a href="#element_request">request</html:a>
				(viz. for events).
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element
					name="subject"
					type="xsd:anyURI">
					<xsd:annotation>
						<xsd:documentation></xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="request">
		<xsd:annotation>
			<xsd:documentation>
				This element translates into an
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Evaluate">Evaluate</html:a>
				.
				<html:br />
				The &lt;reply-to&gt; is required to an asynch
				<html:a href="#element_request">request</html:a>
				(viz. for events).
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element
					name="subject"
					type="xsd:anyURI" />
				<xsd:element
					name="reply-to"
					type="xsd:anyURI"
					minOccurs="0" />
				<xsd:element
					ref="log:variable-bindings"
					minOccurs="0" />
				<xsd:choice>
					<xsd:group ref="eca:SimplifiedComponent" />
					<xsd:group ref="r3:Expression">
						<xsd:annotation>
							<xsd:documentation>
								<html:a href="r3_xsd.html">r3</html:a>
								:
								<html:a
									href="r3_xsd.html#element_NormalizedExpression">
									NormalizedExpression
								</html:a>
								.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:group>
				</xsd:choice>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="response">
		<xsd:annotation>
			<xsd:documentation>
				This element is returned as a response to a request, viz.:
				<html:a href="#element_register">register</html:a>
				,
				<html:a href="#element_deregister">deregister</html:a>
				,
				<html:a href="#element_request">request</html:a>
				.
				<html:br />
				It is a translation of the appropriate response to the
				associated request:
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Loaded">Loaded</html:a>
				or
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Installed">
					Installed
				</html:a>
				,
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_Terminated">
					Terminated
				</html:a>
				,
				<html:a href="r3_xsd.html">r3</html:a>
				:
				<html:a href="r3_xsd.html#element_EvaluateResponse">
					EvaluateResponse
				</html:a>
				.
				<html:br />
				Errors processing a request may be signalled using an
				appropriate HTTP status (e.g. 500), in which case the body of
				the HTTP response is not expected to be a &lt;response&gt;.
				<html:br />
				The &lt;response&gt; is usually returned synchrounously with
				the POST request, but it may also be used to asynchronously
				POST additional responses in case of a &lt;request&gt; that
				includes a &lt;reply-to&gt;.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element
					name="subject"
					type="xsd:anyURI">
					<xsd:annotation>
						<xsd:documentation>
							Refers to a register, a deregister or a request.
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:group
					ref="log:Response"
					minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							Include only if subject refers to a request (even
							so, not required).
						</xsd:documentation>
					</xsd:annotation>
				</xsd:group>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

</xsd:schema>

