<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.wsmo.org/wsml/wrl-syntax#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ruleml="http://www.ruleml.org/0.89/xsd"
xmlns="http://www.wsmo.org/wsml/wrl-syntax#"
elementFormDefault="qualified" attributeFormDefault="unqualified"> 
	<xs:annotation>
		<xs:documentation>
    version: $Revision: 1.1 $
    date: $Date: 2005/06/20 17:14:32 $
    author: Jos de Bruijn, Reto Krummenacher

    this document provides an XML Schema for the XML version of the WRL syntax
    The syntax presented in this document can be used for all WRL
    variants. The WRL variant is identified through the 'variant'
    attribute of the root element 'wrl'.

    A modular approach has been chosen when creating this schema. This
        schema contains the conceptual syntax. Separate schemas have
        been developed for the WRL identifiers and for the WRL logical
        expressions. These schemas are therefore included in this
        schema.
        </xs:documentation>
	</xs:annotation>
	<!-- the following schema contains the definitions for the logical expression syntax-->

	<!-- the following schema contains the definitions for the auxiliary identifiers -->
	<xs:include schemaLocation="wrl-identifiers.xsd"/>

	<!-- the following schema contains the basic RuleML logical
	expression syntax which can be used for arbitrary rules
	including Lloyd-Topor and negation-as-failure -->
	<xs:import namespace="http://www.ruleml.org/0.89/xsd" schemaLocation="http://www.ruleml.org/0.89/xsd/naffolog.xsd"/>
	<!-- the following schema contains the RuleML module for
	frames syntax, used for the specification of WRL modules -->
	<xs:import namespace="http://www.ruleml.org/0.89/xsd" schemaLocation="http://www.ruleml.org/0.89/xsd/modules/frame_module.xsd"/>

	<!-- import the Dublin Core schema -->
	<xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="http://dublincore.org/schemas/xmls/qdc/2003/04/02/dc.xsd"/>
	<!-- start of the global elements, to be used by all parts of the schema -->
	<xs:element name="wrl">
		<xs:annotation>
			<xs:documentation>
                The element 'wrl' is the preferred root element for any WRL specification.
                It allows the user to explicity specify, through the 'variant' attribute, which WRL variant is used. 
                If the WRL variant has not been specified, the application has to "guess" the variant and in the worst case, 
                WRL-Full will be assumed.
            </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence minOccurs="0" maxOccurs="unbounded">
				<xs:any/>
			</xs:sequence>
			<xs:attribute name="variant" type="wrlIRI"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="importsOntology" type="wrlIRI">
		<xs:annotation>
			<xs:documentation>
                This element is used for indicating which ontologies to import. 
                Importing ontologies is the most basic (and inflexible) modularization mechanism. 
                The result of the import is merely the union of the axioms in the importing and the imported ontology.
            </xs:documentation>
		</xs:annotation>
	</xs:element>

	<!-- start of the non-functional properties part -->
	<xs:element name="nonFunctionalProperties">
		<xs:annotation>
			<xs:documentation>
                Any element can be used inside the non-functional properties. 
                Non-functional properties function as annotation for the containing element. 
                The recommended set of non-functional properties is the set of elements offered by Dublin Core. 
                WRL further defines one element, named 'version'.
            </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="attributeValue" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- end of the non-functional properties part -->
	<!-- start of the ontology part -->
	<xs:element name="ontology">
		<xs:annotation>
			<xs:documentation>An ontology specification.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:choice minOccurs="0" maxOccurs="unbounded">
					<xs:element ref="nonFunctionalProperties"/>
					<xs:element ref="importsOntology"/>
					<xs:element ref="concept"/>
					<xs:element ref="relation"/>
					<xs:element ref="instance"/>
					<xs:element ref="relationInstance"/>
					<xs:element ref="axiom"/>
				</xs:choice>
			</xs:sequence>
			<xs:attribute name="name" type="wrlIRI" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="axiom" type="axiomType"/>
	<xs:complexType name="axiomType">
		<xs:annotation>
			<xs:documentation>
                An axiom reference or specification. 
                In case no elements are nested inside the axiom, it is merely a reference to an axiom definition.
                Otherwise, it is an axiom specification, consisting of a number of annotations in the form of non-functional 
                properties and the actual logical expression, contained in the definedBy keyword.
            </xs:documentation>
		</xs:annotation>
		<xs:sequence minOccurs="0">
			<xs:element ref="nonFunctionalProperties" minOccurs="0"/>
			<xs:group ref="content-assert.content"/>
		</xs:sequence>
		<xs:attribute name="name" type="wrlIRI" use="optional"/>
	</xs:complexType>
	<xs:element name="concept">
		<xs:annotation>
			<xs:documentation>A concept specification or reference. In case no elements are nested inside the concept, it is a reference to the concept identified by the name. Otherwise, it is a concept specification.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="superConcept" type="wrlIRI" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="nonFunctionalProperties" minOccurs="0"/>
				<xs:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="name" type="wrlIRI" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="attribute">
		<xs:annotation>
			<xs:documentation>A concept can have zero or
	more attributes. The type of the attribute can be inferring or
	constraining. A constraining attribute (corresponding to
	'ofType') is used to check the type of parameter values; an
	inferring parameter (corresponding to 'impliesType') is used
	to derive the type of attribute values. By default an
	attribute is constraining. Furthermore, an attribute can be
	symmetric, transitive, reflexive or the inverse of another
	attribute. Finally, it is possible to specify the minimal and
	maximal cardinality of an attribute. By default the minimal
	cardinality is 0 and the maximal cardinality is n (i.e. not
	restricted).
            </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="range" type="wrlIRI" minOccurs="0"/>
				<xs:element name="symmetric" minOccurs="0"/>
				<xs:element name="transitive" minOccurs="0"/>
				<xs:element name="reflexive" minOccurs="0"/>
				<xs:element name="inverseOf" type="wrlID" minOccurs="0"/>
				<xs:element name="minCardinality" type="xs:integer" minOccurs="0"/>
				<xs:element name="maxCardinality" type="xs:integer" minOccurs="0"/>
				<xs:element name="cardinality" type="xs:integer" minOccurs="0"/>
				<xs:element ref="nonFunctionalProperties" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="name" type="wrlIRI" use="required"/>
			<xs:attribute name="type" default="constraining">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="constraining"/>
						<xs:enumeration value="inferring"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="relation" type="relationType"/>
	<xs:complexType name="relationType">
		<xs:annotation>
			<xs:documentation>
                A relation specification or reference. 
                In case no elements are nested inside the relation, it is a reference to the relation identified by the name. 
                Otherwise, it is a relation specification.
            </xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="superRelation" type="wrlIRI" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element ref="parameters" minOccurs="0"/>
			<xs:element ref="nonFunctionalProperties" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="name" type="wrlIRI" use="required"/>
		<xs:attribute name="arity" type="xs:integer" use="optional"/>
	</xs:complexType>
	<xs:element name="parameters">
		<xs:annotation>
			<xs:documentation>The ordered list of parameter types</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="range" type="wrlIRI" maxOccurs="unbounded"/>
						</xs:sequence>
						<xs:attribute name="type" default="constraining">
							<xs:simpleType>
								<xs:restriction base="xs:string">
									<xs:enumeration value="constraining"/>
									<xs:enumeration value="inferring"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="instance">
		<xs:annotation>
			<xs:documentation>
                An instance can be member of zero or more concepts. 
                Furthermore, zero or more attribute values can be associated with this particular instance.
            </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="memberOf" type="wrlIRI" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="nonFunctionalProperties" minOccurs="0"/>
				<xs:element ref="attributeValue" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="name" type="wrlIRI" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="attributeValue">
		<xs:annotation>
			<xs:documentation>
                The value of an attribute is either the identifier of another WRL element or a literal.
            </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="value" type="wrlAnyValue" maxOccurs="unbounded"/>
				<!-- can be instance, ID or literal -->
			</xs:sequence>
			<xs:attribute name="name" type="wrlIRI" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="relationInstance">
		<xs:complexType>
			<xs:annotation>
				<xs:documentation>
                An instance of a relation corresponds with a tuple in the extension of the relation. 
                The values of the parameters are explicitly specified. 
                In case the relation does not have named parameters,
		the parameter values only have a value and not a name. 
                The order of the XML elements then corresponds with the order of the arguments of the relation.
            </xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="memberOf" type="wrlIRI" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="nonFunctionalProperties" minOccurs="0"/>
				<xs:element ref="parameterValue" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="name" type="wrlIRI" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="parameterValue">
		<xs:complexType>
			<xs:choice>
				<xs:element name="value" type="wrlAnyValue" maxOccurs="unbounded"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
	<!-- End of the ontology part -->
</xs:schema>

