﻿<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:afp="http://www.wipo.int/standards/XMLSchema/AFPatent"
            xmlns:com="http://www.wipo.int/standards/XMLSchema/ST96/Common"
            xmlns:pat="http://www.wipo.int/standards/XMLSchema/ST96/Patent"
            targetNamespace="http://www.wipo.int/standards/XMLSchema/AFPatent"
            elementFormDefault="qualified"
            attributeFormDefault="qualified"
            version="V2_2">
	<xsd:import namespace="http://www.wipo.int/standards/XMLSchema/ST96/Patent"
	            schemaLocation="http://www.wipo.int/standards/XMLSchema/AFPatent/V2_1/ST96_Patent_V4_0.xsd"/>
	<xsd:import namespace="http://www.wipo.int/standards/XMLSchema/ST96/Common"
	            schemaLocation="http://www.wipo.int/standards/XMLSchema/AFPatent/V2_1/ST96_Common_V4_0.xsd"/>
	<xsd:annotation>
		<xsd:appinfo>
			<com:SchemaLastModifiedDate>2021-11-05</com:SchemaLastModifiedDate>
			<com:SchemaContactPoint>xml.standards@wipo.int</com:SchemaContactPoint>
			<com:SchemaReleaseNoteURL>http://www.wipo.int/standards/XMLSchema/AFPatent/V2_2/ReleaseNotes.pdf</com:SchemaReleaseNoteURL>
		</xsd:appinfo>
	</xsd:annotation>
	<xsd:element name="PatentAuthorityFile"
	             type="afp:PatentAuthorityFileType">
		<xsd:annotation>
			<xsd:documentation>Authority file for patent documents provided by patent offices according to WIPO Standard ST.37</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="AuthorityFileDataCoverage"
	             type="afp:AuthorityFileDataCoverageType">
		<xsd:annotation>
			<xsd:documentation>List of patent documents published by industrial property offices grouped according to their ST.16 kind-of-document codes for a given date range</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="AuthorityFileDataCoverageType">
		<xsd:sequence>
			<xsd:element ref="com:PublicationDateRange"/>
			<xsd:element ref="afp:PublicationNumberRange"
			             minOccurs="0"/>
			<xsd:element ref="afp:KindCodeCoverageBag"
			             minOccurs="0"/>
			<xsd:element ref="afp:ExceptionCodeCoverageBag"
			             minOccurs="0"/>
			<xsd:element ref="com:DataCoverageURI"
			             minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="AuthorityFileDefinition"
	             type="afp:AuthorityFileDefinitionType">
		<xsd:annotation>
			<xsd:documentation>Provide definition file information relating to this associated authority file, including file coverage</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="AuthorityFileDefinitionType">
		<xsd:choice maxOccurs="unbounded">
			<xsd:element ref="afp:ExceptionCodeDefinitionBag"/>
			<xsd:element ref="pat:PatentDocumentKindCodeDefinitionBag"/>
			<xsd:element ref="com:MostRecentDocument"/>
			<xsd:element ref="afp:AuthorityFileDataCoverage"/>
			<xsd:element ref="com:CommentText"/>
			<xsd:element ref="com:DocumentLocationURI"/>
		</xsd:choice>
		<xsd:attribute ref="com:id"/>
		<xsd:attribute ref="afp:groupedAFIndicator"
		               use="required"/>
		<xsd:attribute ref="afp:groupAFCategory"/>
		<xsd:attribute ref="com:updateAFCategory"
		               use="required"/>
	</xsd:complexType>
	<xsd:element name="AuthorityFileEntry"
	             type="afp:AuthorityFileEntryType">
		<xsd:annotation>
			<xsd:documentation>An authority file entry consists of data required to uniquely identify a patent publication according to WIPO ST.37</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SearchableDescriptionCode"
	             type="afp:TextSearchableCodeType">
		<xsd:annotation>
			<xsd:documentation>A code which indicates the language of the description if a text-searchable description is available, or otherwise the code values N (not available) or U (unknown) </xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="TextSearchableCodeType">
		<xsd:choice>
			<xsd:element ref="afp:NotSearchableCode"/>
			<xsd:element ref="afp:SearchableLanguageCode"
			             minOccurs="1"
			             maxOccurs="unbounded"/>
		</xsd:choice>
		<xsd:attribute ref="com:id"/>
	</xsd:complexType>
	<xsd:element name="NotSearchableCode"
	             type="afp:NotSearchableCodeType">
		<xsd:annotation>
			<xsd:documentation>Where the text is not available, the indicator is the code N if the information is not available or the code U if it is unknown whether this information is available</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SearchableLanguageCode"
	             type="com:ISOLanguageCodeType">
		<xsd:annotation>
			<xsd:documentation> A two-letter language code indicates, for searchable text, the language made available by the Office either as the original language or an official language</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SearchableClaimsCode"
	             type="afp:TextSearchableCodeType">
		<xsd:annotation>
			<xsd:documentation>A code which indicates the language of the claims if a text-searchable claims is available, or otherwise the code values N (not available) or U (unknown) </xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SearchableAbstractCode"
	             type="afp:TextSearchableCodeType">
		<xsd:annotation>
			<xsd:documentation>A code which indicates the language of the abstract if a text-searchable abstract is available, or otherwise the code values N (not available) or U (unknown) as defined in WIPO ST.37 </xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:simpleType name="NotSearchableCodeType">
		<xsd:restriction base="xsd:token">
			<xsd:enumeration value="N">
				<xsd:annotation>
					<xsd:documentation>Not available</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="U">
				<xsd:annotation>
					<xsd:documentation>Unknown if available</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="AuthorityFileEntryType">
		<xsd:sequence>
			<xsd:element ref="pat:PatentPublicationIdentification"/> <!-- For all those publications for which we do not have the publication date available, this element will not be informed. -->
			<xsd:element ref="afp:ExceptionCode"
			             minOccurs="0"/>
			<xsd:element ref="pat:ApplicationIdentification"
			             minOccurs="0"/>
			<xsd:element ref="pat:PriorityApplicationIdentificationBag"
			             minOccurs="0"/>
			<xsd:element ref="afp:SearchableAbstractCode"
			             minOccurs="0"
			             maxOccurs="1"/>
			<xsd:element ref="afp:SearchableDescriptionCode"
			             minOccurs="0"
			             maxOccurs="1"/>
			<xsd:element ref="afp:SearchableClaimsCode"
			             minOccurs="0"
			             maxOccurs="1"/>
		</xsd:sequence>
		<xsd:attribute ref="com:id"/>
	</xsd:complexType>
	<xsd:complexType name="PatentAuthorityFileType">
		<xsd:sequence>
			<xsd:element ref="afp:AuthorityFileDefinition"
			             minOccurs="0"/>
			<xsd:element ref="afp:AuthorityFileEntry"
			             maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute ref="com:id"/>
		<xsd:attribute ref="com:officeCode"
		               use="required"/>
		<xsd:attribute ref="com:creationDate"/>
		<xsd:attribute ref="afp:st37Version"
		               use="required"/>
		<xsd:attribute ref="com:ipoVersion"/>
	</xsd:complexType>
	<xsd:attribute name="groupedAFIndicator"
	               type="xsd:boolean">
		<xsd:annotation>
			<xsd:documentation>Indicates that the authority file has been grouped, or not, according to one of the defined categories</xsd:documentation>
		</xsd:annotation>
	</xsd:attribute>
	<xsd:element name="ExceptionCode"
	             type="afp:ExceptionCodeType">
		<xsd:annotation>
			<xsd:documentation>Exception code as indicated in WIPO ST.37</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="ExceptionCodeCoverage"
	             type="afp:ExceptionCodeCoverageType">
		<xsd:annotation>
			<xsd:documentation>Data coverage summary by exception code including total quantity of documents</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="ExceptionCodeCoverageType">
		<xsd:sequence>
			<xsd:element ref="afp:ExceptionCode"/>
			<xsd:element ref="com:DocumentTotalQuantity"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="ExceptionCodeCoverageBag"
	             type="afp:ExceptionCodeCoverageBagType">
		<xsd:annotation>
			<xsd:documentation>Collection of data coverage summary by exception code</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="ExceptionCodeCoverageBagType">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element ref="afp:ExceptionCodeCoverage"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="ExceptionCodeDefinition"
	             type="afp:ExceptionCodeDefinitionType">
		<xsd:annotation>
			<xsd:documentation>A set of Exception codes, particularly the codes N, W and X, and their descriptions as defined by the IP Office, which are different from definitions in WIPO ST.37</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="ExceptionCodeDefinitionType">
		<xsd:sequence>
			<xsd:element ref="afp:ExceptionCode"/>
			<xsd:element ref="afp:ExceptionCodeDescriptionText"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="ExceptionCodeDescriptionText"
	             type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>A different or specific description of an exceptioncode, which an IP Office uses in their authority file</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="ExceptionCodeDefinitionBag"
	             type="afp:ExceptionCodeDefinitionBagType">
		<xsd:annotation>
			<xsd:documentation>List of exception codes that have a different or specific definition in use by the IP Office rather than the definitions of exception codes defined in WIPO ST.37</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="ExceptionCodeDefinitionBagType">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element ref="afp:ExceptionCodeDefinition"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:simpleType name="ExceptionCodeType">
		<xsd:restriction base="xsd:token">
			<xsd:enumeration value="C">
				<xsd:annotation>
					<xsd:documentation>Defective publication documents</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="D">
				<xsd:annotation>
					<xsd:documentation>The document was deleted after the publication</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="E">
				<xsd:annotation>
					<xsd:documentation>Publication number allocated by the IPO representing a PCT national/regional phase entry (for example Euro-PCT). No corresponding document published. A Euro-PCT application is an international (PCT) patent application that entered the European regional phase</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="M">
				<xsd:annotation>
					<xsd:documentation>Published document is missing</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="N">
				<xsd:annotation>
					<xsd:documentation>This code is for Office internal-use and the code description for 'N' must be provided using ExceptionCodeDefinition, for instance in the IP Office's Authority Definition File</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="P">
				<xsd:annotation>
					<xsd:documentation>Document available only on paper</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="R">
				<xsd:annotation>
					<xsd:documentation>Reissued publication</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="U">
				<xsd:annotation>
					<xsd:documentation>Unknown publication number, for example, when during compilation of the authority file one or a list of publication number(s) has been found in the database, but the corresponding document(s) is(are) missing without known cause. Typically this code can indicate a database error that requires further analysis</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="W">
				<xsd:annotation>
					<xsd:documentation>This code is for Office internal-use and the code description for 'W' must be provided using ExceptionCodeDefinition, for instance in the IP Office's Authority Definition File</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="X">
				<xsd:annotation>
					<xsd:documentation>The use of code 'X' must be described in the IP Office's Authority Definition File</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:attribute name="groupAFCategory"
	               type="afp:GroupCategoryType">
		<xsd:annotation>
			<xsd:documentation>Identifies how the authority files has been grouped i.e., by date, publication-level or document-kind code</xsd:documentation>
		</xsd:annotation>
	</xsd:attribute>
	<xsd:simpleType name="GroupCategoryType">
		<xsd:restriction base="xsd:token">
			<xsd:enumeration value="date">
				<xsd:annotation>
					<xsd:documentation>Date</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="publication-level">
				<xsd:annotation>
					<xsd:documentation>Publication level</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
			<xsd:enumeration value="document-kind">
				<xsd:annotation>
					<xsd:documentation>Document kind</xsd:documentation>
				</xsd:annotation>
			</xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:element name="KindCodeCoverage"
	             type="afp:KindCodeCoverageType">
		<xsd:annotation>
			<xsd:documentation>Data coverage summary by kind code including document total quantity</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="KindCodeCoverageType">
		<xsd:sequence>
			<xsd:element ref="com:PatentDocumentKindCode"/>
			<xsd:element ref="com:DocumentTotalQuantity"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="KindCodeCoverageBag"
	             type="afp:KindCodeCoverageBagType">
		<xsd:annotation>
			<xsd:documentation>Collection of data coverage summary by kind code</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="KindCodeCoverageBagType">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element ref="afp:KindCodeCoverage"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="PublicationNumberRange"
	             type="afp:PublicationNumberRangeType">
		<xsd:annotation>
			<xsd:documentation>A range of patent publication numbers which are included within this authority file</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="PublicationNumberRangeType">
		<xsd:sequence>
			<xsd:element ref="pat:BeginRangeNumber"/>
			<xsd:element ref="pat:EndRangeNumber"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:attribute name="st37Version"
	               type="xsd:token"
	               fixed="V2_2">
		<xsd:annotation>
			<xsd:documentation>A specific release version of ST.37 XML Schema</xsd:documentation>
		</xsd:annotation>
	</xsd:attribute>
</xsd:schema>