Project

General

Profile

« Previous | Next » 

Revision 48821

Highlight minimal metadata for main entities in the light UI

View differences:

cidoc_2_document.xslt
6 6
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
7 7
                xmlns:dc="http://purl.org/dc/elements/1.1/"
8 8
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
9
                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
10
                xmlns:foaf="http://xmlns.com/foaf/0.1/">
9
                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
11 10

  
12 11
	<xsl:output method="html" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
13 12

  
......
17 16
				<img src="../resources/img/record.png" width="80" height="80"/>
18 17
			</div>
19 18
			<div class="col-xs-10">
20
				<xsl:if test="//*[local-name()='title']">
19
				<xsl:if test="//*[local-name() = 'title']">
21 20
					<h1 id="overview">
22 21
						<!-- this is visualized big next to the picture. Since we cannot identify 1 main title, for Parthenos it wil be empty -->
23 22
						<!--<xsl:value-of select="/crm:P102_has_title"/>-->
......
28 27

  
29 28
		<div class="row">
30 29
			<div class="col-xs-12">
31
				<h6>
32
					<span class="glyphicon glyphicon-align-left"/>
33
					GENERAL INFORMATION
34
				</h6>
30
				<h6><span class="glyphicon glyphicon-align-left"/> GENERAL INFORMATION </h6>
35 31
				<table class="table">
36 32
					<tbody>
37 33
						<tr>
......
39 35
								<strong>Original identifier</strong>
40 36
							</td>
41 37
							<td>
42
								<xsl:value-of select="//dri:recordIdentifier"/>
38
								<xsl:choose>
39
									<xsl:when test="starts-with(//dri:objIdentifier, 'http')">
40
										<a href="{//dri:recordIdentifier}" target="_blank"><xsl:value-of select="//dri:recordIdentifier"/></a>
41
									</xsl:when>
42
									<xsl:otherwise><xsl:value-of select="//dri:recordIdentifier"/></xsl:otherwise>
43
								</xsl:choose>
44

  
43 45
							</td>
44 46
						</tr>
45 47
						<tr>
......
47 49
								<strong>Provenance</strong>
48 50
							</td>
49 51
							<td>
50
								<i>Data source: </i><xsl:value-of select="//dri:datasourcename"/><br/>
51
								<i>D-Net API: </i><xsl:value-of select="//dri:datasourceapi"/>
52
								<i>Data source: </i>
53
								<xsl:value-of select="//dri:datasourcename"/>
54
								<br/>
55
								<i>D-Net API: </i>
56
								<xsl:value-of select="//dri:datasourceapi"/>
52 57
							</td>
53 58
						</tr>
54 59
						<tr>
......
69 74
						</tr>
70 75
						<tr>
71 76
							<td class="col-xs-3">
72
								<strong>Resource types and labels</strong>
77
								<strong>Resource types</strong>
73 78
							</td>
74 79
							<td>
75
								<xsl:for-each-group select="//rdf:Description" group-by="./rdf:type/@rdf:resource">
76
									<i><xsl:value-of select="tokenize(current-grouping-key(),'/')[last()]"/></i> (<xsl:value-of select="count(current-group())"/>)<br/>
77
										<xsl:for-each select="current-group()">
78
											<xsl:if test="string-length(./rdfs:label) &gt; 0">
79
												- <xsl:value-of select="./rdfs:label"/>
80
												<br/>
81
											</xsl:if>
82
										</xsl:for-each>
83
									<br/>
80
								<xsl:for-each-group select="//rdf:Description"
81
								                    group-by="./rdf:type/@rdf:resource">
82
									<i><xsl:value-of
83
											select="tokenize(current-grouping-key(), '/')[last()]"
84
									/></i> (<xsl:value-of select="count(current-group())"/>) --
84 85
								</xsl:for-each-group>
85 86
							</td>
86 87
						</tr>
87
						<tr>
88
							<td class="col-xs-3">
89
								<strong>Notes</strong>
90
							</td>
91
							<td>
92
								<xsl:for-each select="//crm:P3_has_note">
93
									<xsl:value-of select="./text()"/>
94
									<br/>
95
								</xsl:for-each>
96
							</td>
97
						</tr>
98 88
					</tbody>
99 89
				</table>
90
				<h6><span class="glyphicon glyphicon-align-left"/> MINIMAL METADATA </h6>
91
					<table class="table">
92
						<tbody>
93
							<xsl:for-each-group select="//rdf:Description"
94
							                    group-by="./rdf:type/@rdf:resource">
95
								<xsl:for-each select="current-group()">
96
									<xsl:apply-templates select="." mode="minimalMetadata"/>
97
								</xsl:for-each>
98
							</xsl:for-each-group>
99
						</tbody>
100
					</table>
100 101
			</div>
101 102
		</div>
102 103

  
103
		<xsl:for-each select="//*[local-name()='record']">
104
			<h6>
105
				<span class="glyphicon glyphicon-wrench"/>
106
				INDEXED RECORD
107
			</h6>
104
		<xsl:for-each select="//*[local-name() = 'record']">
105
			<h6><span class="glyphicon glyphicon-wrench"/> INDEXED RECORD </h6>
108 106
			<xsl:call-template name="xmlItem">
109 107
				<xsl:with-param name="indent" select="string('')"/>
110 108
			</xsl:call-template>
111 109
		</xsl:for-each>
112 110
	</xsl:template>
113 111

  
112
<!--
113
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E41_Appellation']" />
114
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E35_Title']" />
115
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E65_Creation']" />
116
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E30_Right']" />
117
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E52_Time-Span']" />
118
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E51_Contact_Point']" />
119
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.cidoc-crm.org/cidoc-crm/E45_Address']" />
120
	<xsl:template mode="minimalMetadata" match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.ics.forth.gr/isl/CRMext/CRMpe.rdfs/PE29_Access_Point']" />
121
	-->
122
	<xsl:template mode="minimalMetadata" match="text()" />
123

  
124
	<!--http://parthenos.d4science.org/CRMext/CRMpe.rdfs/PE22_Persistent_Dataset-->
125
	<xsl:template mode="minimalMetadata"
126
			match="rdf:Description[./rdf:type/@rdf:resource = 'http://www.ics.forth.gr/isl/CRMext/CRMpe.rdfs/PE22_Persistent_Dataset']">
127
		<br/>
128
		<tr>
129
			<td class="col-xs-3">
130
				<strong>PE22_Persistent_Dataset</strong><br/>
131

  
132
				<xsl:call-template name="printProperty">
133
					<xsl:with-param name="propertyName">P1_is_identified_by</xsl:with-param>
134
					<xsl:with-param name="propertyValue">
135
						<xsl:value-of select="./crm:P1_is_identified_by/@rdf:resource"/>
136
					</xsl:with-param>
137
				</xsl:call-template>
138
				<br/>
139
				<xsl:call-template name="printProperty">
140
					<xsl:with-param name="propertyName">P102_has_title</xsl:with-param>
141
					<xsl:with-param name="propertyValue">
142
						<xsl:value-of
143
								select="//rdf:Description[@rdf:about = ./crm:P102_has_title/@rdf:resource]/rdfs:label"
144
						/>
145
					</xsl:with-param>
146
				</xsl:call-template>
147
				<br/>
148
				<xsl:call-template name="printProperty">
149
					<xsl:with-param name="propertyName">P2_has_type</xsl:with-param>
150
					<xsl:with-param name="propertyValue">
151
						<xsl:value-of
152
								select="//rdf:Description[@rdf:about = ./crm:P2_has_type/@rdf:resource]/rdfs:label"
153
						/>
154
					</xsl:with-param>
155
				</xsl:call-template>
156
				<br/>
157
				<xsl:call-template name="printProperty">
158
					<xsl:with-param name="propertyName">P3_has_note</xsl:with-param>
159
					<xsl:with-param name="propertyValue">
160
						<xsl:value-of select="./crm:P3_has_note"/>
161
					</xsl:with-param>
162
				</xsl:call-template>
163
				<br/>
164
				<xsl:call-template name="printProperty">
165
					<xsl:with-param name="propertyName">P129_is_about</xsl:with-param>
166
					<xsl:with-param name="propertyValue">
167
						<xsl:value-of select="./crm:P129_is_about/@rdf:resource"/>
168
					</xsl:with-param>
169
				</xsl:call-template>
170
				<br/>
171
				<xsl:call-template name="printProperty">
172
					<xsl:with-param name="propertyName">P67_refers_to</xsl:with-param>
173
					<xsl:with-param name="propertyValue">
174
						<xsl:value-of select="./crm:P67_refers_to/@rdf:resource"/>
175
					</xsl:with-param>
176
				</xsl:call-template>
177
				<br/>
178
				<xsl:call-template name="printProperty">
179
					<xsl:with-param name="propertyName">PP8i_is_dataset_hosted_by</xsl:with-param>
180
					<xsl:with-param name="propertyValue">
181
						<xsl:value-of select="./crm:PP8i_is_dataset_hosted_by/@rdf:resource"/>
182
					</xsl:with-param>
183
				</xsl:call-template>
184
				<br/>
185
				<xsl:call-template name="printProperty">
186
					<xsl:with-param name="propertyName"
187
					>PP6i_is_digital_object_hosted_by</xsl:with-param>
188
					<xsl:with-param name="propertyValue">
189
						<xsl:value-of select="./crm:PP6i_is_digital_object_hosted_by/@rdf:resource"/>
190
					</xsl:with-param>
191
				</xsl:call-template>
192
				<br/>
193
				<xsl:call-template name="printProperty">
194
					<xsl:with-param name="propertyName">PP4i_is_object_hosted_by</xsl:with-param>
195
					<xsl:with-param name="propertyValue">
196
						<xsl:value-of select="./crm:PP4i_is_object_hosted_by/@rdf:resource"/>
197
					</xsl:with-param>
198
				</xsl:call-template>
199
			</td>
200
			<td>
201
				<strong><xsl:value-of select="./@rdf:about"/></strong>
202
			</td>
203
		</tr>
204

  
205
	</xsl:template>
206

  
207
	<xsl:template name="printProperty">
208
		<xsl:param name="propertyName"/>
209
		<xsl:param name="propertyValue"/>
210
		<xsl:value-of select="concat($propertyName, ' : ', $propertyValue)"/>
211
	</xsl:template>
212

  
114 213
	<xsl:template name="xmlAttr">
115
		<span style='color:orange'>
214
		<span style="color:orange">
116 215
			<xsl:value-of select="concat(' ', local-name())"/>
117 216
		</span>
118 217
		<xsl:value-of select="concat('=&quot;', ., '&quot;')"/>
......
122 221
	<xsl:template name="xmlItem">
123 222
		<xsl:param name="indent"/>
124 223
		<xsl:variable name="tag" select="name()"/>
125
		<xsl:variable name="newindent"><xsl:value-of select="$indent"/>&#160;&#160;&#160;&#160;
126
		</xsl:variable>
224
		<xsl:variable name="newindent"><xsl:value-of select="$indent"/>&#160;&#160;&#160;&#160; </xsl:variable>
127 225

  
128 226
		<xsl:if test="string-length($tag)">
129 227
			<br/>
130 228
			<xsl:value-of select="$indent"/>
131
			<span style='color:blue'>
132
				<xsl:value-of select="concat('&lt;',$tag)"/>
229
			<span style="color:blue">
230
				<xsl:value-of select="concat('&lt;', $tag)"/>
133 231
			</span>
134 232
			<xsl:for-each select="@*">
135 233
				<xsl:call-template name="xmlAttr"/>
136 234
			</xsl:for-each>
137 235
			<xsl:choose>
138 236
				<xsl:when test="count(child::*) = 0 and count(child::text()) = 1">
139
					<span style='color:blue'>&gt;</span>
237
					<span style="color:blue">&gt;</span>
140 238
					<xsl:value-of select="normalize-space(.)"/>
141
					<span style='color:blue'>
142
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
239
					<span style="color:blue">
240
						<xsl:value-of select="concat('&lt;/', $tag, '&gt;')"/>
143 241
					</span>
144 242
				</xsl:when>
145 243
				<xsl:when test="count(child::* | child::text()) &gt; 0">
146
					<span style='color:blue'>&gt;</span>
244
					<span style="color:blue">&gt;</span>
147 245
					<xsl:for-each select="child::* | child::text()">
148 246
						<xsl:choose>
149
							<xsl:when test="self::text() and string-length(normalize-space(.)) &gt; 0">
247
							<xsl:when
248
									test="self::text() and string-length(normalize-space(.)) &gt; 0">
150 249
								<xsl:value-of select="normalize-space(.)"/>
151 250
							</xsl:when>
152 251
							<xsl:otherwise>
......
158 257
					</xsl:for-each>
159 258
					<br/>
160 259
					<xsl:value-of select="$indent"/>
161
					<span style='color:blue'>
162
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
260
					<span style="color:blue">
261
						<xsl:value-of select="concat('&lt;/', $tag, '&gt;')"/>
163 262
					</span>
164 263
				</xsl:when>
165 264
				<xsl:otherwise>
166
					<span style='color:blue'>&#160;/&gt;</span>
265
					<span style="color:blue">&#160;/&gt;</span>
167 266
				</xsl:otherwise>
168 267
			</xsl:choose>
169 268
		</xsl:if>
170 269
	</xsl:template>
171 270

  
271
	<!--
272
        Suppress warning messages "The source document is in no namespace, but the template rules
273
        all expect elements in a namespace" (see https://github.com/daisy/pipeline-mod-braille/issues/38)
274
    -->
275
	<xsl:template match="/phony">
276
		<xsl:next-match/>
277
	</xsl:template>
172 278

  
279

  
173 280
</xsl:stylesheet>

Also available in: Unified diff