Project

General

Profile

Revision 9857

Merge changes from 2.7 branch

View differences:

lib/schema/onedcx/onedcx.xsd
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3

  
4
DataOne Dublin Core Extended Schema v1.0
5

  
6
This schema is based on the Library of Congres Dublin Core Extended Schema:
7
www.loc.gov/standards/sru/cql/contextSets/dcx/dcx.xsd
8
by Ray Denenberg (Library of Congress)
9

  
10
However this schema uses an unmodified dcterms.xsd schema and 
11
removes use of the 'mediator' and 'educationLevel' elements.  This is done
12
to avoid the substitution group ambiguity issues found in these elements
13
 when used in <xs:choice> defined parent element.
14

  
15
This schema allows you to include
16
1. dcterm simple elements (original 15)
17
2. dcterms elements
18
3. other elements
19

  
20
An instance looks like this:
21

  
22
<metadata>
23
	<simpleDc>
24
		<dcterms:title/>
25
		<dcterms:creator/>
26
	</simpleDc>
27
	<dcTerms>
28
		<dcterms:abstract/>
29
	</dcTerms>
30
	<otherElements>
31
		<other:xyz xmlns:other="info:xxx"/>
32
	</otherElements>
33
</metadata>
34

  
35
It is strongly encouraged that one 'title', 'abstract', at least one 'creator', 
36
	and a 'dateSubmitted' or 'available' date be provided.  This aids in the display of the document
37
	in the search index and search engine views.
38

  
39
-->
40
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
41
	targetNamespace="http://ns.dataone.org/metadata/schema/onedcx/v1.0"
42
 	xmlns="http://ns.dataone.org/metadata/schema/onedcx/v1.0"
43
  	xmlns:dcterms="http://purl.org/dc/terms/" 
44
  	elementFormDefault="qualified" 
45
  	attributeFormDefault="unqualified">
46

  
47
	<xs:import namespace="http://purl.org/dc/terms/" schemaLocation="http://dublincore.org/schemas/xmls/qdc/2008/02/11/dcterms.xsd"/>
48
	<!--
49
Root element declarations:
50
-->
51
	<xs:element name="metadata" type="onedcxType"/>
52
	<!--
53
End root element declarations:
54
-->
55
	<xs:complexType name="onedcxType">
56
		<xs:sequence>
57
			<xs:element name="simpleDc" minOccurs="0" maxOccurs="1" type="simpleDcType"/>
58
			<xs:element name="dcTerms" minOccurs="0" maxOccurs="1" type="dcTermsType"/>
59
			<xs:element name="otherElements" minOccurs="0" maxOccurs="1" type="otherElementsType"/>
60
		</xs:sequence>
61
	</xs:complexType>
62
	<xs:complexType name="simpleDcType">
63
		<xs:choice maxOccurs="unbounded">
64
			<xs:element ref="dcterms:title"/>
65
			<xs:element ref="dcterms:creator"/>
66
			<xs:element ref="dcterms:subject"/>
67
			<xs:element ref="dcterms:description"/>
68
			<xs:element ref="dcterms:publisher"/>
69
			<xs:element ref="dcterms:contributor"/>
70
			<xs:element ref="dcterms:date"/>
71
			<xs:element ref="dcterms:type"/>
72
			<xs:element ref="dcterms:format"/>
73
			<xs:element ref="dcterms:identifier"/>
74
			<xs:element ref="dcterms:source"/>
75
			<xs:element ref="dcterms:language"/>
76
			<xs:element ref="dcterms:relation"/>
77
			<xs:element ref="dcterms:coverage"/>
78
			<xs:element ref="dcterms:rights"/>
79
		</xs:choice>
80
	</xs:complexType>
81
	<xs:complexType name="dcTermsType">
82
		<xs:choice maxOccurs="unbounded">
83
			<xs:element ref="dcterms:alternative"/>
84
			<xs:element ref="dcterms:tableOfContents"/>
85
			<xs:element ref="dcterms:abstract"/>
86
			<xs:element ref="dcterms:created"/>
87
			<xs:element ref="dcterms:valid"/>
88
			<xs:element ref="dcterms:available"/>
89
			<xs:element ref="dcterms:issued"/>
90
			<xs:element ref="dcterms:modified"/>
91
			<xs:element ref="dcterms:dateAccepted"/>
92
			<xs:element ref="dcterms:dateCopyrighted"/>
93
			<xs:element ref="dcterms:dateSubmitted"/>
94
			<xs:element ref="dcterms:extent"/>
95
			<xs:element ref="dcterms:medium"/>
96
			<xs:element ref="dcterms:isVersionOf"/>
97
			<xs:element ref="dcterms:hasVersion"/>
98
			<xs:element ref="dcterms:isReplacedBy"/>
99
			<xs:element ref="dcterms:replaces"/>
100
			<xs:element ref="dcterms:isRequiredBy"/>
101
			<xs:element ref="dcterms:requires"/>
102
			<xs:element ref="dcterms:isPartOf"/>
103
			<xs:element ref="dcterms:hasPart"/>
104
			<xs:element ref="dcterms:isReferencedBy"/>
105
			<xs:element ref="dcterms:references"/>
106
			<xs:element ref="dcterms:isFormatOf"/>
107
			<xs:element ref="dcterms:hasFormat"/>
108
			<xs:element ref="dcterms:conformsTo"/>
109
			<xs:element ref="dcterms:spatial"/>
110
			<xs:element ref="dcterms:temporal"/>
111
			<xs:element ref="dcterms:audience"/>
112
			<xs:element ref="dcterms:accrualMethod"/>
113
			<xs:element ref="dcterms:accrualPeriodicity"/>
114
			<xs:element ref="dcterms:accrualPolicy"/>
115
			<xs:element ref="dcterms:instructionalMethod"/>
116
			<xs:element ref="dcterms:provenance"/>
117
			<xs:element ref="dcterms:rightsHolder"/>
118
			<xs:element ref="dcterms:accessRights"/>
119
			<xs:element ref="dcterms:license"/>
120
			<xs:element ref="dcterms:bibliographicCitation"/>
121
		</xs:choice>
122
	</xs:complexType>
123
	<xs:complexType name="otherElementsType">
124
		<xs:sequence>
125
			<xs:any maxOccurs="unbounded" namespace="##any" processContents="lax"/>
126
		</xs:sequence>
127
	</xs:complexType>
128
</xs:schema>
0 129

  
lib/style/common/dcx/onedcx-common.xsl
33 33

  
34 34
	<xsl:template name="general">
35 35
		<h4>General Content</h4>
36
		
36 37
		<div class="control-group">
37 38
			<label class="control-label">Title</label>
38 39
			<div class="controls controls-well">
......
41 42
				</strong>
42 43
			</div>
43 44
		</div>
45
		
44 46
		<div class="control-group">
45 47
			<label class="control-label">Identifier</label>
46 48
			<div class="controls">
......
49 51
				</div>
50 52
			</div>
51 53
		</div>
52
		<div class="control-group">
53
			<label class="control-label">Alternate Identifier</label>
54
			<div class="controls">
55
				<div class="controls-well">
56
					<xsl:value-of select="normalize-space(dcx:simpleDc/dct:identifier)" />
54
		
55
		<xsl:if test="dcx:simpleDc/dct:identifier!=''">
56
			<div class="control-group">
57
				<label class="control-label">Alternate Identifier</label>
58
				<div class="controls">
59
					<div class="controls-well">
60
						<xsl:value-of select="normalize-space(dcx:simpleDc/dct:identifier)" />
61
					</div>
57 62
				</div>
58 63
			</div>
59
		</div>
64
		</xsl:if>
60 65
		
61
		<div class="control-group">
62
			<label class="control-label">Online Access</label>
63
			<div class="controls controls-well">
64
				<xsl:for-each select="dcx:dcTerms/dct:references">
65
					<a>
66
						<xsl:attribute name="href">
66
		<xsl:if test="dcx:dcTerms/dct:references!=''">
67
			<div class="control-group">
68
				<label class="control-label">Online Access</label>
69
				<div class="controls controls-well">
70
					<xsl:for-each select="dcx:dcTerms/dct:references">
71
						<a>
72
							<xsl:attribute name="href">
73
								<xsl:value-of select="." />
74
							</xsl:attribute>
67 75
							<xsl:value-of select="." />
68
						</xsl:attribute>
69
						<xsl:value-of select="." />
70
					</a>
71
				</xsl:for-each>
76
						</a>
77
					</xsl:for-each>
78
				</div>
72 79
			</div>
73
		</div>
80
		</xsl:if>
74 81
		
75
		
76 82
		<div class="control-group">
77 83
			<label class="control-label">Abstract</label>
78 84
			<div class="controls controls-well">
79 85
				<div class="sectionText">
80 86
					<p>
81
						<xsl:value-of select="normalize-space(dcx:dcTerms/dct:abstract)" />
87
						<xsl:value-of select="normalize-space(dcx:dcTerms/dct:abstract|dcx:simpleDc/dct:description)" />
82 88
					</p>
83 89
				</div>
84 90
			</div>
......
116 122

  
117 123
	<xsl:template name="people">
118 124
		<h4>Creators</h4>
119
		<xsl:for-each select="dcx:simpleDc/dct:creator">
120
			<div class="controls controls-well">
121
				<xsl:value-of select="." />
122
			</div>
123
		</xsl:for-each>
124

  
125
		<div class="controls">
126
			<xsl:for-each select="dcx:simpleDc/dct:creator">
127
				<div class="controls-well">
128
					<xsl:value-of select="." />
129
				</div>
130
			</xsl:for-each>
131
		</div>
132
		<xsl:if test="dcx:simpleDc/dct:contributor!=''">
133
			<label class="control-label">Contributors</label>
134
			<xsl:for-each select="dcx:simpleDc/dct:contributor">
135
				<div class="controls controls-well">
136
					<xsl:value-of select="." />
137
				</div>
138
			</xsl:for-each>
139
		</xsl:if>
125 140
	</xsl:template>
126 141

  
127 142
	<xsl:template name="geography">
128
		<div class="row-fluid">
129
			<div data-content="geographicCoverage" class="row-fluid geographicCoverage">
130
				<h4>Geographic Region</h4>
131
				<div data-content="geographicDescription" class="control-group geographicDescription">
132
					<label class="control-label">Geographic Description</label>
133
					<div class="controls controls-well">
134
						<xsl:value-of
135
							select="//dcx:dcTerms/dct:spatial[not(@xsi:type='dcterms:Box')]" />
143
		<xsl:if test="//dcx:dcTerms/dct:spatial!=''">
144
			<div class="row-fluid">
145
				<div data-content="geographicCoverage" class="row-fluid geographicCoverage">
146
					<h4>Geographic Region</h4>
147
					
148
					<xsl:if test="//dcx:dcTerms/dct:spatial[not(contains(@xsi:type, 'Box'))]!=''">
149
						<div data-content="geographicDescription" class="control-group geographicDescription">
150
							<label class="control-label">Geographic Description</label>
151
							<div class="controls">
152
								<xsl:for-each select="//dcx:dcTerms/dct:spatial[not(contains(@xsi:type, 'Box'))]">
153
									<div class="controls-well">
154
										<xsl:value-of select="." />
155
									</div>
156
								</xsl:for-each>
157
							</div>
158
						</div>
159
					</xsl:if>
160
					
161
					<div data-content="boundingCoordinates" class="control-group boundingCoordinates">
162
						<label class="control-label">Bounding Coordinates</label>
163
						<div class="controls controls-well">					
164
							<xsl:for-each select="//dcx:dcTerms/dct:spatial[contains(@xsi:type, 'Box')]">
165
								<xsl:call-template name="extract-coordinates" />
166
							</xsl:for-each>
167
						</div>	
136 168
					</div>
169
	
137 170
				</div>
138

  
139
				<div data-content="boundingCoordinates" class="control-group boundingCoordinates">
140
					<label class="control-label">Bounding Coordinates</label>
141
					<div class="controls controls-well">					
142
						<xsl:for-each select="//dcx:dcTerms/dct:spatial[@xsi:type='Box']">
143
							<xsl:call-template name="extract-coordinates" />
144
						</xsl:for-each>
145
					</div>	
146
				</div>
147

  
148 171
			</div>
149
		</div>
172
		</xsl:if>
150 173
	</xsl:template>
151 174

  
152 175
	<xsl:template name="extract-coordinates">
......
181 204
		<xsl:param name="corner" />
182 205
		<xsl:param name="label" />
183 206
		<xsl:param name="bound" />
184
		<xsl:variable name="coord"
185
			select="substring-before(substring-after($data,concat($corner,'=')),';')" />
207
		
208
		<xsl:variable name="coord">
209
			<xsl:choose>
210
				<xsl:when test="contains(substring-after($data,concat($corner,'=')), ';')">
211
					<xsl:value-of select="substring-before(substring-after($data,concat($corner,'=')), ';')" />
212
				</xsl:when>
213
				<xsl:otherwise>
214
					<xsl:value-of select="substring-after($data,concat($corner,'='))" />
215
				</xsl:otherwise>
216
			</xsl:choose>
217
		</xsl:variable>	
218
		
186 219
		<div data-value="{$coord}" data-content="{$bound}" class="control-group {$bound}">
187 220
			<label class="control-label">
188 221
				<xsl:value-of select="$label" />
......
222 255
	</xsl:template>
223 256

  
224 257
	<xsl:template name="temporal">
225
		<div class="row-fluid">
226
			<div data-content="temporalCoverage" class="row-fluid temporalCoverage">
227
				<h4>Temporal Coverage</h4>
228
				<div class="control-group">
229
					<xsl:if test="//dcx:dcTerms/dct:temporal[@xsi:type='Period']/text() != ''">
230
						<label class="control-label">Date Range</label>
231
						<div class="controls controls-well">					
232
							<xsl:for-each select="//dcx:dcTerms/dct:temporal[@xsi:type='Period']">
233
								<xsl:call-template name="extract-period" />
234
							</xsl:for-each>
235
						</div>	
236
					</xsl:if>
237
					<xsl:if test="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]/text() != ''">
238
						<label class="control-label">Single Date</label>
239
						<div class="controls controls-well">					
258
		<xsl:if test="//dcx:dcTerms/dct:temporal!=''">
259
			<div class="row-fluid">
260
				<div data-content="temporalCoverage" class="row-fluid temporalCoverage">
261
					<h4>Temporal Coverage</h4>
262
					<div class="control-group">
263
						<xsl:if test="//dcx:dcTerms/dct:temporal[@xsi:type='Period']/text() != ''">
264
							<label class="control-label">Date Range</label>
265
							<div class="controls controls-well">					
266
								<xsl:for-each select="//dcx:dcTerms/dct:temporal[@xsi:type='Period']">
267
									<xsl:call-template name="extract-period" />
268
								</xsl:for-each>
269
							</div>	
270
						</xsl:if>
271
						<xsl:if test="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]/text() != ''">
272
							<label class="control-label">Date(s)</label>
240 273
							<xsl:for-each select="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]">
241
								<xsl:value-of select="." />
274
								<div class="controls controls-well">					
275
									<xsl:value-of select="." />
276
								</div>
242 277
							</xsl:for-each>
243
						</div>	
244
					</xsl:if>
278
						</xsl:if>
279
					</div>
245 280
				</div>
246 281
			</div>
247
		</div>
282
		</xsl:if>
248 283
	</xsl:template>
249 284

  
250 285
</xsl:stylesheet>
src/loaddtdschema-postgres.sql
18 18
        AND system_id LIKE '%/dwc/%';
19 19
DELETE FROM xml_catalog 
20 20
      WHERE entry_type LIKE 'Schema'
21
        AND system_id LIKE '%/dryad/%';                
21
        AND system_id LIKE '%/dryad/%'; 
22
DELETE FROM xml_catalog 
23
      WHERE entry_type LIKE 'Schema'
24
        AND system_id LIKE '%/onedcx/%';                
22 25
INSERT INTO xml_catalog (entry_type, public_id, system_id)
23 26
  VALUES ('DTD', '-//ecoinformatics.org//eml-access-@eml-version@//EN',
24 27
         '/dtd/eml-access-@eml-version@.dtd');
......
166 169
INSERT INTO xml_catalog (entry_type, public_id, format_id, system_id) VALUES ('Schema', 'http://www.isotc211.org/2005/gts', 'http://www.isotc211.org/2005/gmd-noaa', '/schema/isotc211-noaa/gts/gts.xsd');
167 170
INSERT INTO xml_catalog (entry_type, public_id, format_id, system_id) VALUES ('Schema', 'http://www.isotc211.org/2005/srv', 'http://www.isotc211.org/2005/gmd-noaa', '/schema/isotc211-noaa/srv/srv.xsd');
168 171
INSERT INTO xml_catalog (entry_type, public_id, format_id, system_id) VALUES ('Schema', 'http://www.w3.org/1999/xlink', 'http://www.isotc211.org/2005/gmd-noaa', '/schema/isotc211-noaa/xlink/xlinks.xsd');
172
INSERT INTO xml_catalog (entry_type, public_id, system_id) VALUES ('Schema', 'http://ns.dataone.org/metadata/schema/onedcx/v1.0', '/schema/onedcx/onedcx.xsd');
169 173

  
170 174
INSERT INTO db_version (version, status, date_created) 
171 175
  VALUES ('2.8.0',1,CURRENT_DATE);
src/upgrade-db-to-2.7.1-postgres.sql
1 1
/*
2
 * Add onedcx XML schema to xml_catalog table
3
 */
4
 INSERT INTO xml_catalog (entry_type, public_id, system_id) VALUES ('Schema', 'http://ns.dataone.org/metadata/schema/onedcx/v1.0', '/schema/onedcx/onedcx.xsd');
5

  
6
/*
2 7
 * Ensure xml_catalog sequence is at table max
3 8
 */
4 9
SELECT setval('xml_catalog_id_seq', (SELECT max(catalog_id) from xml_catalog));
......
10 15
UPDATE db_version SET status=0;
11 16

  
12 17
INSERT INTO db_version (version, status, date_created) 
13
  VALUES ('2.7.1', 1, CURRENT_DATE);
18
  VALUES ('2.7.1', 1, CURRENT_DATE);
14 19

  

Also available in: Unified diff