<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.biopax.org/release/biopax-level3.owl#"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
 	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:owl="http://www.w3.org/2002/07/owl#"
	xmlns:bp="http://www.biopax.org/release/biopax-level3.owl#"
	xml:base="http://www.biopax.org/release/biopax-level3.owl"
	elementFormDefault="qualified"
	>

	<!-- BioPAX as used in Graphical Pathway Markup Language version 2013a

		BioPAX as used in GPML2013a differs from BioPAX Level 3 (http://www.biopax.org/release/biopax-level3.owl#)
		in several ways, such as:
		* "openControlledVocabulary" is not in BioPAX Level 3 (it is in Level 2). Level 3 does have "ControlledVocabulary".
			http://biopax.org/owldoc/Level2/classes/openControlledVocabulary___928462216.html
			http://biopax.org/owldoc/Level3/classes/ControlledVocabulary___36696285.html
		* "ontology" is not in Level 3 (technically, it's in there as a concept, but not as a term, class, property, etc.)
		* rdf:id vs. rdf:ID
			RDF spec calls for uppercase ID
			https://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-ID-xml-base
			http://www.w3.org/1999/02/22-rdf-syntax-ns#ID
		* AUTHORS vs. author
			BioPAX spec calls for singular and lowercase
		  	http://biopax.org/owldoc/Level3/dataproperties/author___446097204.html
		* ID vs. id, DB vs. db, TITLE vs. title, SOURCE vs. source, YEAR vs. year, TERM vs. term
			BioPAX spec calls for lowercase

		Note that there is not an XSD available for BioPAX Level 3, because:
		"An early vote resulted in the decision to use OWL instead of XML Schema to represent BioPAX. The main reasons were:
		* The ability to describe a class hierarchy
		* The ability to use the same language for the ontology and the data exchange format
		* Compatible with future technologies like the semantic web that some users are interested in
		* There was a promise that many tools for OWL would quickly become available to match the existing tools for XML Schema.
			As of 2005, these tools are still being matured.
		* OWL is a type of XML, so XML tools would still be useful for parsing OWL"
		(See http://www.biopax.org/mediawiki/index.php/FAQ)
	     -->

	<!--
	 ==============================================================
		Includes and Imports
		============================================================== 
	-->
	<xs:import namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" schemaLocation="./rdf.xsd"/>

	<xs:attributeGroup name="RDFAttributes">
		<xs:attribute ref="rdf:datatype" use="optional"/>
	</xs:attributeGroup>

	<xs:complexType name="IntegerElementType">
		<xs:simpleContent>
			<xs:extension base="xs:integer">
				<xs:attributeGroup ref="bp:RDFAttributes"/>
				<xs:anyAttribute/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="StringElementType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attributeGroup ref="bp:RDFAttributes"/>
				<xs:anyAttribute/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:element name="PublicationXref">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="ID" minOccurs="1"
					maxOccurs="1" type="bp:StringElementType">
				</xs:element>
				<xs:element name="DB" minOccurs="1"
					maxOccurs="1" type="bp:StringElementType">
				</xs:element>
				<xs:element name="TITLE" minOccurs="1"
					maxOccurs="1" type="bp:StringElementType">
				</xs:element>
				<xs:element name="SOURCE" minOccurs="1"
					maxOccurs="1" type="bp:StringElementType">
				</xs:element>
				<xs:element name="YEAR" minOccurs="1"
					maxOccurs="1" type="bp:IntegerElementType">
				</xs:element>
				<xs:element name="AUTHORS" minOccurs="1"
					maxOccurs="unbounded" type="bp:StringElementType">
				</xs:element>
			</xs:sequence>
			<!-- The actual GPML uses rdf:id, which is wrong, because "id" is not the name
			     of an attribute in rdf. It's "ID".
			     It's not possible to specify a name of "rdf:id" here, so our actual GPML
			     will always fail when validated against any XSD.
			     -->
			<xs:attribute ref="rdf:id"/>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="openControlledVocabulary">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="TERM" minOccurs="1"
					maxOccurs="1">
					<xs:complexType>
						<xs:simpleContent>
							<xs:extension base="xs:string">
							</xs:extension>
						</xs:simpleContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="ID" minOccurs="1"
					maxOccurs="1">
					<xs:complexType>
						<xs:simpleContent>
							<xs:extension base="xs:string">
							</xs:extension>
						</xs:simpleContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="Ontology" minOccurs="1"
					maxOccurs="1">
					<xs:complexType>
						<xs:simpleContent>
							<xs:extension base="xs:string">
							</xs:extension>
						</xs:simpleContent>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
