1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3###############################################################################
4#
5# Copyright (C) 2017 Tom Kralidis (tomkralidis@gmail.com)
6# Copyright (C) 2017 Angelos Tzotsos (gcpp.kalxas@gmail.com)
7#
8# This source is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free
10# Software Foundation; either version 2 of the License, or (at your option)
11# any later version.
12#
13# This code is distributed in the hope that it will be useful, but WITHOUT ANY
14# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16# details.
17#
18# You should have received a copy of the GNU General Public License along
19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21#
22###############################################################################
23-->
24<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rm="http://qgis.org/base-metadata/1.0" targetNamespace="http://qgis.org/base-metadata/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
25	<xs:element name="BaseMetadata" type="rm:BaseMetadataType">
26		<xs:annotation>
27			<xs:appinfo>QGIS Base Metadata Schema</xs:appinfo>
28			<xs:documentation>Copyright (C) 2017 Tom Kralidis (tomkralidis@gmail.com)</xs:documentation>
29			<xs:documentation>Copyright (C) 2017 Angelos Tzotsos (gcpp.kalxas@gmail.com)</xs:documentation>
30		</xs:annotation>
31	</xs:element>
32	<xs:complexType name="BaseMetadataType">
33		<xs:sequence>
34			<xs:element name="identifier" type="xs:string">
35				<xs:annotation>
36					<xs:documentation>Reference, URI, URL or some other mechanism to identify a given resource. </xs:documentation>
37				</xs:annotation>
38			</xs:element>
39			<xs:element name="parentidentifier" type="xs:string" minOccurs="0">
40				<xs:annotation>
41					<xs:documentation>Reference, URI, URL or some other mechanism that that a given resource is a part of (child).</xs:documentation>
42				</xs:annotation>
43			</xs:element>
44			<xs:element name="language" type="xs:string">
45				<xs:annotation>
46					<xs:documentation>Human language associated with a given resource.  While a formal vocabulary is not imposed, it is advised to use ISO 3166/ISO 639.</xs:documentation>
47				</xs:annotation>
48			</xs:element>
49			<xs:element name="type" type="xs:string">
50				<xs:annotation>
51					<xs:documentation>Nature of a given resource.  While a formal vocabulary is not imposed, it is advised to use the ISO 19115 MD_ScopeCode.</xs:documentation>
52				</xs:annotation>
53			</xs:element>
54			<xs:element name="title" type="xs:string">
55				<xs:annotation>
56					<xs:documentation>Human readable name of a given resource typically displayed in search results.</xs:documentation>
57				</xs:annotation>
58			</xs:element>
59			<xs:element name="abstract" type="xs:string">
60				<xs:annotation>
61					<xs:documentation>Description of a given resource.</xs:documentation>
62				</xs:annotation>
63			</xs:element>
64			<xs:element name="keywords" type="rm:keywordsType" minOccurs="0" maxOccurs="unbounded">
65				<xs:annotation>
66					<xs:documentation>Set of descriptive keywords associated with a given resource.</xs:documentation>
67				</xs:annotation>
68			</xs:element>
69			<xs:element name="contact" type="rm:contactType" maxOccurs="unbounded">
70				<xs:annotation>
71					<xs:documentation>Contact person/entity associated with a given resource.</xs:documentation>
72				</xs:annotation>
73			</xs:element>
74			<xs:element name="links" type="rm:linksType">
75				<xs:annotation>
76					<xs:documentation>Set of online resources associated with a given resource.</xs:documentation>
77				</xs:annotation>
78			</xs:element>
79      <xs:element name="history" type="xs:string" minOccurs="0" maxOccurs="unbounded">
80        <xs:annotation>
81    	    <xs:documentation>Freeform description of the history or lineage of the resource.</xs:documentation>
82        </xs:annotation>
83      </xs:element>
84		</xs:sequence>
85		<xs:attribute name="version" use="required" fixed="1.0">
86			<xs:annotation>
87				<xs:documentation>Version of QGIS Base Metadata schema used. </xs:documentation>
88			</xs:annotation>
89		</xs:attribute>
90	</xs:complexType>
91	<xs:complexType name="keywordsType">
92		<xs:sequence>
93			<xs:element name="keyword" maxOccurs="unbounded">
94				<xs:annotation>
95					<xs:documentation>Descriptive keyword associated with a resource.  While a formal vocabulary is not imposed, it is advised to use rm:keywords/@vocabulary to identify a codelist or applicable vocabulary.</xs:documentation>
96				</xs:annotation>
97			</xs:element>
98		</xs:sequence>
99		<xs:attribute name="vocabulary" type="xs:string">
100			<xs:annotation>
101				<xs:documentation>Reference (URI/URL preferred) to a codelist or vocabulary associated with keyword list.</xs:documentation>
102			</xs:annotation>
103		</xs:attribute>
104	</xs:complexType>
105	<xs:complexType name="contactType">
106		<xs:sequence>
107			<xs:element name="name" type="xs:string">
108				<xs:annotation>
109					<xs:documentation>Name of contact.</xs:documentation>
110				</xs:annotation>
111			</xs:element>
112			<xs:element name="organization" type="xs:string" minOccurs="0">
113				<xs:annotation>
114					<xs:documentation>Organization contact belongs to/represents.</xs:documentation>
115				</xs:annotation>
116			</xs:element>
117			<xs:element name="position" type="xs:string" minOccurs="0">
118				<xs:annotation>
119					<xs:documentation>Position/title of contact.</xs:documentation>
120				</xs:annotation>
121			</xs:element>
122			<xs:element name="contactAddress" type="rm:addressType" minOccurs="0" maxOccurs="unbounded">
123				<xs:annotation>
124					<xs:documentation>Address associated with a given contact.</xs:documentation>
125				</xs:annotation>
126			</xs:element>
127			<xs:element name="voice" type="xs:string" minOccurs="0">
128				<xs:annotation>
129					<xs:documentation>Voice telephone.</xs:documentation>
130				</xs:annotation>
131			</xs:element>
132			<xs:element name="fax" type="xs:string" minOccurs="0">
133				<xs:annotation>
134					<xs:documentation>Facsimile telephone.</xs:documentation>
135				</xs:annotation>
136			</xs:element>
137			<xs:element name="email" type="xs:string" minOccurs="0">
138				<xs:annotation>
139					<xs:documentation>Electronic mail address (note, do not include mailto: protocol as part of the email address).</xs:documentation>
140				</xs:annotation>
141			</xs:element>
142			<xs:element name="role" type="xs:string" minOccurs="0">
143				<xs:annotation>
144					<xs:documentation>Role of contact. While no vocabulary is imposed, it is advised to use ISO 19115 CI_RoleCode.</xs:documentation>
145				</xs:annotation>
146			</xs:element>
147		</xs:sequence>
148	</xs:complexType>
149	<xs:complexType name="addressType">
150		<xs:sequence>
151			<xs:element name="type" type="xs:string" minOccurs="0">
152				<xs:annotation>
153					<xs:documentation>Type of address (e.g. 'postal').</xs:documentation>
154				</xs:annotation>
155			</xs:element>
156			<xs:element name="address" type="xs:string" minOccurs="0">
157				<xs:annotation>
158					<xs:documentation>Physical address.</xs:documentation>
159				</xs:annotation>
160			</xs:element>
161			<xs:element name="city" type="xs:string" minOccurs="0">
162				<xs:annotation>
163					<xs:documentation>City.</xs:documentation>
164				</xs:annotation>
165			</xs:element>
166			<xs:element name="administrativearea" type="xs:string" minOccurs="0">
167				<xs:annotation>
168					<xs:documentation>Administrative area (state, province/territory, etc.).</xs:documentation>
169				</xs:annotation>
170			</xs:element>
171			<xs:element name="postalcode" type="xs:string" minOccurs="0">
172				<xs:annotation>
173					<xs:documentation>Postal code.</xs:documentation>
174				</xs:annotation>
175			</xs:element>
176			<xs:element name="country" type="xs:string" minOccurs="0">
177				<xs:annotation>
178					<xs:documentation>Country.</xs:documentation>
179				</xs:annotation>
180			</xs:element>
181		</xs:sequence>
182	</xs:complexType>
183	<xs:complexType name="linksType">
184		<xs:sequence>
185			<xs:element name="link" type="rm:linkType" maxOccurs="unbounded">
186				<xs:annotation>
187					<xs:documentation>Online resource associated with a given resource.  Attribute definitions:
188						* name: short name (like WMS layer name)
189						* type: link type.  Strongly suggested to use values from the 'identifier' column in https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv
190						* description: abstract text about link
191						* url: endpoint.  If the URL is an OWS server, specify the *base* URL only without parameters like service=xxx.....
192						* format: format specification of online resource.  Strongly suggested to use GDAL/OGR format values
193						* mimeType: MIME type representative of the online resource response (image/png, application/json, etc.)
194						* size: estimated size (in bytes) of the online resource response
195					</xs:documentation>
196				</xs:annotation>
197			</xs:element>
198		</xs:sequence>
199	</xs:complexType>
200	<xs:complexType name="linkType">
201		<xs:attributeGroup ref="rm:linkAttrs"/>
202	</xs:complexType>
203	<xs:attributeGroup name="linkAttrs">
204		<xs:attribute name="name" type="xs:string" use="required"/>
205		<xs:attribute name="type" type="xs:string" use="required"/>
206		<xs:attribute name="url" type="xs:anyURI" use="required"/>
207    <xs:attribute name="description" type="xs:string" use="optional"/>
208    <xs:attribute name="format" type="xs:string" use="optional"/>
209		<xs:attribute name="mimeType" type="xs:string" use="optional"/>
210		<xs:attribute name="size" type="xs:string" use="optional"/>
211	</xs:attributeGroup>
212</xs:schema>
213