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/resource-metadata/1.0" targetNamespace="http://qgis.org/resource-metadata/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
25	<xs:include schemaLocation="qgis-base-metadata.xsd"/>
26	<xs:element name="ResourceMetadata" type="rm:ResourceMetadataType" base="rm:BaseMetadataType">
27		<xs:annotation>
28			<xs:appinfo>QGIS Resource Metadata Schema</xs:appinfo>
29			<xs:documentation>Copyright (C) 2017 Tom Kralidis (tomkralidis@gmail.com)</xs:documentation>
30			<xs:documentation>Copyright (C) 2017 Angelos Tzotsos (gcpp.kalxas@gmail.com)</xs:documentation>
31		</xs:annotation>
32	</xs:element>
33	<xs:complexType name="ResourceMetadataType">
34		<xs:sequence>
35			<xs:element name="fees" type="xs:string" minOccurs="0">
36				<xs:annotation>
37					<xs:documentation>Any fees associated with a given resource.</xs:documentation>
38				</xs:annotation>
39			</xs:element>
40			<xs:element name="constraints" type="rm:constraintsType" minOccurs="0" maxOccurs="unbounded">
41				<xs:annotation>
42					<xs:documentation>List of constraints associated with a given resource.</xs:documentation>
43				</xs:annotation>
44			</xs:element>
45			<xs:element name="rights" type="xs:string" minOccurs="0" maxOccurs="unbounded">
46				<xs:annotation>
47					<xs:documentation>Attribution or copyright associated with a given resource.</xs:documentation>
48				</xs:annotation>
49			</xs:element>
50      <xs:element name="license" type="xs:string" minOccurs="1" maxOccurs="unbounded">
51				<xs:annotation>
52					<xs:documentation>License associated with a given resource (examples: http://opendefinition.org/licenses/).</xs:documentation>
53				</xs:annotation>
54      </xs:element>
55			<xs:element name="encoding" type="xs:string" minOccurs="0">
56				<xs:annotation>
57					<xs:documentation>Character encoding of the data of a given resource.</xs:documentation>
58				</xs:annotation>
59			</xs:element>
60			<xs:element name="crs" type="xs:string">
61				<xs:annotation>
62					<xs:documentation>Coordinate reference system associated with the data of a given resource.  Examples:
63						* EPSG:EPSGCODE
64						* http://www.opengis.net/def/crs/EPSG/0/EPSGCODE (URI Style 1)
65						* http://www.opengis.net/gml/srs/epsg.xml#EPSGCODE (URI Style 2)
66						* urn:EPSG:geographicCRS:EPSGCODE
67						* urn:ogc:def:crs:EPSG::EPSGCODE
68						* urn:ogc:def:crs:EPSG:EPSGCODE
69					</xs:documentation>
70				</xs:annotation>
71			</xs:element>
72			<xs:element name="extent" type="rm:extentType" maxOccurs="1">
73				<xs:annotation>
74					<xs:documentation>Spatial and temporal extents associated with a given resource.</xs:documentation>
75				</xs:annotation>
76			</xs:element>
77		</xs:sequence>
78		<xs:attribute name="version" use="required" fixed="1.0">
79			<xs:annotation>
80				<xs:documentation>Version of QGIS Resource Metadata schema used. </xs:documentation>
81			</xs:annotation>
82		</xs:attribute>
83	</xs:complexType>
84	<xs:complexType name="constraintsType">
85		<xs:simpleContent>
86			<xs:extension base="xs:string">
87				<xs:attribute name="type" type="xs:string">
88					<xs:annotation>
89						<xs:documentation>Type of constraint.  Suggested types are 'access', 'other'.</xs:documentation>
90					</xs:annotation>
91				</xs:attribute>
92			</xs:extension>
93		</xs:simpleContent>
94	</xs:complexType>
95	<xs:complexType name="extentType">
96		<xs:sequence>
97			<xs:element name="spatial" type="rm:spatialType" maxOccurs="unbounded">
98				<xs:annotation>
99					<xs:documentation>Geospatial Extent of a given resource.</xs:documentation>
100				</xs:annotation>
101			</xs:element>
102			<xs:element name="temporal" type="rm:temporalType" minOccurs="0" maxOccurs="unbounded">
103				<xs:annotation>
104					<xs:documentation>Temporal extent associated with a given resource.  It is advised to use ISO 8601 for consistency.</xs:documentation>
105				</xs:annotation>
106			</xs:element>
107		</xs:sequence>
108	</xs:complexType>
109	<xs:complexType name="spatialType">
110		<xs:attribute name="dimensions" type="xs:integer" default="2"/>
111		<xs:attribute name="crs" type="xs:string" use="required">
112			<xs:annotation>
113				<xs:documentation>Coordinate reference system.</xs:documentation>
114			</xs:annotation>
115		</xs:attribute>
116		<xs:attribute name="minx" type="xs:decimal" use="required">
117			<xs:annotation>
118				<xs:documentation>Minimum x value according to crs.</xs:documentation>
119			</xs:annotation>
120		</xs:attribute>
121		<xs:attribute name="miny" type="xs:decimal" use="required">
122			<xs:annotation>
123				<xs:documentation>Minimum y value according to crs.</xs:documentation>
124			</xs:annotation>
125		</xs:attribute>
126		<xs:attribute name="minz" type="xs:decimal" use="optional">
127			<xs:annotation>
128				<xs:documentation>Minimum z value according to crs.</xs:documentation>
129			</xs:annotation>
130		</xs:attribute>
131		<xs:attribute name="maxx" type="xs:decimal" use="required">
132			<xs:annotation>
133				<xs:documentation>Maximum x value according to crs.</xs:documentation>
134			</xs:annotation>
135		</xs:attribute>
136		<xs:attribute name="maxy" type="xs:decimal" use="required">
137			<xs:annotation>
138				<xs:documentation>Maximum y value according to crs.</xs:documentation>
139			</xs:annotation>
140		</xs:attribute>
141		<xs:attribute name="maxz" type="xs:decimal" use="optional">
142			<xs:annotation>
143				<xs:documentation>Maximum z value according to crs.</xs:documentation>
144			</xs:annotation>
145		</xs:attribute>
146	</xs:complexType>
147	<xs:complexType name="temporalType">
148		<xs:choice>
149			<xs:element name="instant" type="xs:dateTime">
150				<xs:annotation>
151					<xs:documentation>Single point in time.</xs:documentation>
152				</xs:annotation>
153			</xs:element>
154			<xs:element name="period" type="rm:periodType">
155				<xs:annotation>
156					<xs:documentation>Time period or envelope.</xs:documentation>
157				</xs:annotation>
158			</xs:element>
159		</xs:choice>
160	</xs:complexType>
161	<xs:complexType name="periodType">
162		<xs:sequence>
163			<xs:element name="start" type="xs:dateTime">
164				<xs:annotation>
165					<xs:documentation>Begin date/time.</xs:documentation>
166				</xs:annotation>
167			</xs:element>
168			<xs:element name="end" type="xs:dateTime" minOccurs="0">
169				<xs:annotation>
170					<xs:documentation>End date/time.</xs:documentation>
171				</xs:annotation>
172			</xs:element>
173		</xs:sequence>
174		<xs:attribute name="indeterminatePosition" type="xs:boolean">
175			<xs:annotation>
176				<xs:documentation>Whether resource has no end date/time (i.e. continuous acquisition).</xs:documentation>
177			</xs:annotation>
178		</xs:attribute>
179	</xs:complexType>
180</xs:schema>
181