Project

General

Profile

« Previous | Next » 

Revision 49148

getting rid of person entities

View differences:

dmf2insertActions.xslt
44 44

  
45 45
				<xsl:if test="string-length($resultId) &gt; 0">
46 46

  
47
					<xsl:variable name="collectedfromid" select="dnet:oafSplitId('datasource', //oaf:collectedFrom/@id)"/>
48
					<xsl:variable name="collectedfromname" select="//oaf:collectedFrom/@name"/>
47
					<xsl:variable name="cobjcategory" select="//dr:CobjCategory"/>
48
					<xsl:choose>
49
						<!-- check if we need to exclude datasets from an OAF MDStore-->
50
						<xsl:when test="$cobjcategory = '0021'">
51
							<ROWS/>
52
						</xsl:when>
53
						<xsl:otherwise>
54
							<xsl:variable name="collectedfromid" select="dnet:oafSplitId('datasource', //oaf:collectedFrom/@id)"/>
55
							<xsl:variable name="collectedfromname" select="//oaf:collectedFrom/@name"/>
49 56

  
50
					<xsl:variable name="hostedbyid" select="dnet:oafSplitId('datasource', //oaf:hostedBy/@id)"/>
51
					<xsl:variable name="hostedbyname" select="//oaf:hostedBy/@name"/>
57
							<xsl:variable name="hostedbyid" select="dnet:oafSplitId('datasource', //oaf:hostedBy/@id)"/>
58
							<xsl:variable name="hostedbyname" select="//oaf:hostedBy/@name"/>
52 59

  
53
					<xsl:variable name="originalidTest" select="/*[local-name()='record']/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/>
54
					<xsl:variable name="originalid">
55
						<xsl:choose>
56
							<xsl:when test="contains($originalidTest, '::')">
57
								<xsl:value-of select="substring-after($originalidTest, '::')"/>
58
							</xsl:when>
59
							<xsl:otherwise>
60
								<xsl:value-of select="$originalidTest"/>
61
							</xsl:otherwise>
62
						</xsl:choose>
63
					</xsl:variable>
60
							<xsl:variable name="originalidTest" select="/*[local-name()='record']/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/>
61
							<xsl:variable name="originalid">
62
								<xsl:choose>
63
									<xsl:when test="contains($originalidTest, '::')">
64
										<xsl:value-of select="substring-after($originalidTest, '::')"/>
65
									</xsl:when>
66
									<xsl:otherwise>
67
										<xsl:value-of select="$originalidTest"/>
68
									</xsl:otherwise>
69
								</xsl:choose>
70
							</xsl:variable>
64 71

  
65
					<xsl:variable name="result"
66
					              select="dnet:oafResult($resultId, $provenance, $trust, $about, $hostedbyid, $hostedbyname, $collectedfromid,
72
							<xsl:variable name="result"
73
							              select="dnet:oafResult($resultId, $provenance, $trust, $about, $hostedbyid, $hostedbyname, $collectedfromid,
67 74
					              $collectedfromname, $originalid, $dateofcollection, $dateoftransformation, $metadata)"/>
68 75

  
69
					<ROWS>
70
						<ROW key="{$resultId}" columnFamily="result">
71
							<QUALIFIER name="body" type="base64">
72
								<xsl:value-of select="$result"/>
73
							</QUALIFIER>
74
						</ROW>
75

  
76
						<xsl:for-each select="//*[local-name()='projectid']">
77

  
78
							<xsl:variable name="projectId" select="dnet:oafSplitId('project', normalize-space(.))"/>
79

  
80
							<xsl:if test="string-length($projectId) &gt; 0">
81

  
82
								<xsl:variable name="resultproject"
83
								              select="dnet:rel($resultId, $projectId, 'resultProject', 'outcome', 'isProducedBy',
84
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
85
								<xsl:variable name="projectresult"
86
								              select="dnet:rel($projectId, $resultId, 'resultProject', 'outcome', 'produces',
87
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
88

  
89
								<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
90
									<QUALIFIER name="{$projectId}" type="base64">
91
										<xsl:value-of select="$resultproject"/>
76
							<ROWS>
77
								<ROW key="{$resultId}" columnFamily="result">
78
									<QUALIFIER name="body" type="base64">
79
										<xsl:value-of select="$result"/>
92 80
									</QUALIFIER>
93 81
								</ROW>
94
								<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
95
									<QUALIFIER name="{$resultId}" type="base64">
96
										<xsl:value-of select="$projectresult"/>
97
									</QUALIFIER>
98
								</ROW>
99
							</xsl:if>
100
						</xsl:for-each>
101 82

  
102
						<xsl:for-each select="//*[local-name()='relatedDataset']">
83
								<xsl:for-each select="//*[local-name()='projectid']">
103 84

  
104
							<!-- relatedDataset ids must be in the openaire format  -->
105
							<xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(./@id))"/>
85
									<xsl:variable name="projectId" select="dnet:oafSplitId('project', normalize-space(.))"/>
106 86

  
107
							<xsl:if test="string-length($datasetId) &gt; 0">
87
									<xsl:if test="string-length($projectId) &gt; 0">
108 88

  
109
								<xsl:variable name="resultDataset"
110
								              select="dnet:rel($resultId, $datasetId, 'resultResult', 'publicationDataset', 'isRelatedTo',
89
										<xsl:variable name="resultproject"
90
										              select="dnet:rel($resultId, $projectId, 'resultProject', 'outcome', 'isProducedBy',
111 91
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
112
								<xsl:variable name="datasetResult"
113
								              select="dnet:rel($datasetId, $resultId, 'resultResult', 'publicationDataset', 'isRelatedTo',
92
										<xsl:variable name="projectresult"
93
										              select="dnet:rel($projectId, $resultId, 'resultProject', 'outcome', 'produces',
114 94
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
115 95

  
116
								<ROW key="{$resultId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
117
									<QUALIFIER name="{$datasetId}" type="base64">
118
										<xsl:value-of select="$resultDataset"/>
119
									</QUALIFIER>
120
								</ROW>
121
								<ROW key="{$datasetId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
122
									<QUALIFIER name="{$resultId}" type="base64">
123
										<xsl:value-of select="$datasetResult"/>
124
									</QUALIFIER>
125
								</ROW>
126
							</xsl:if>
127
						</xsl:for-each>
96
										<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
97
											<QUALIFIER name="{$projectId}" type="base64">
98
												<xsl:value-of select="$resultproject"/>
99
											</QUALIFIER>
100
										</ROW>
101
										<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
102
											<QUALIFIER name="{$resultId}" type="base64">
103
												<xsl:value-of select="$projectresult"/>
104
											</QUALIFIER>
105
										</ROW>
106
									</xsl:if>
107
								</xsl:for-each>
128 108

  
129
						<xsl:for-each select="//*[local-name()='creator']">
109
								<xsl:for-each select="//*[local-name()='relatedDataset']">
130 110

  
131
							<xsl:if test="string-length(normalize-space(.)) &gt; 0">
132
								<xsl:variable name="originalPersonId">
133
									<xsl:choose>
134
										<xsl:when test="string-length(@nameIdentifier) &gt; 0">
135
											<xsl:value-of select="normalize-space(@nameIdentifier)"/>
136
										</xsl:when>
137
										<xsl:otherwise>
138
											<xsl:value-of select="concat($originalid, '::', normalize-space(.))"/>
139
										</xsl:otherwise>
140
									</xsl:choose>
141
								</xsl:variable>
111
									<!-- relatedDataset ids must be in the openaire format  -->
112
									<xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(./@id))"/>
142 113

  
143
								<xsl:variable name="personId" select="dnet:oafId('person', $namespaceprefix, $originalPersonId)"/>
144
								<xsl:variable name="position" select="position()"/>
114
									<xsl:if test="string-length($datasetId) &gt; 0">
145 115

  
146
								<xsl:variable name="person"
147
								              select="dnet:person($personId, $about, $provenance, $trust, $collectedfromid, $collectedfromname,
148
			                                  $originalPersonId, $dateofcollection, $dateoftransformation, normalize-space(.), @nameIdentifier, @nameIdentifierScheme)"/>
149
								<xsl:variable name="personresult"
150
								              select="dnet:personResult_Authorship($personId, $resultId, $position, 'isAuthorOf',
116
										<xsl:variable name="resultDataset"
117
										              select="dnet:rel($resultId, $datasetId, 'resultResult', 'publicationDataset', 'isRelatedTo',
151 118
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
152
								<xsl:variable name="resultperson"
153
								              select="dnet:personResult_Authorship($resultId, $personId, $position, 'hasAuthor',
119
										<xsl:variable name="datasetResult"
120
										              select="dnet:rel($datasetId, $resultId, 'resultResult', 'publicationDataset', 'isRelatedTo',
154 121
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
155 122

  
156
								<xsl:if test="string-length($personId) &gt; 0">
157
									<ROW key="{$personId}" columnFamily="person">
158
										<QUALIFIER name="body" type="base64">
159
											<xsl:value-of select="$person"/>
160
										</QUALIFIER>
161
									</ROW>
162
									<ROW key="{$personId}" columnFamily="personResult_authorship_isAuthorOf">
163
										<QUALIFIER name="{$resultId}" type="base64">
164
											<xsl:value-of select="$personresult"/>
165
										</QUALIFIER>
166
									</ROW>
167
									<ROW key="{$resultId}" columnFamily="personResult_authorship_hasAuthor">
168
										<QUALIFIER name="{$personId}" type="base64">
169
											<xsl:value-of select="$resultperson"/>
170
										</QUALIFIER>
171
									</ROW>
172
								</xsl:if>
173

  
174
								<!-- COAUTHORS -->
175
								<xsl:if test="$writeCoAuthors = true()">
176
									<xsl:for-each select="../dc:creator">
177
										<xsl:if test="$position != position()">
178

  
179
											<xsl:variable name="originalCoauthorId">
180
												<xsl:choose>
181
													<xsl:when test="string-length(@nameIdentifier) &gt; 0">
182
														<xsl:value-of select="normalize-space(@nameIdentifier)"/>
183
													</xsl:when>
184
													<xsl:otherwise>
185
														<xsl:value-of select="concat($originalid, '::', normalize-space(.))"/>
186
													</xsl:otherwise>
187
												</xsl:choose>
188
											</xsl:variable>
189

  
190
											<xsl:variable name="coauthorId"
191
											              select="dnet:oafId('person', $namespaceprefix, $originalCoauthorId)"/>
192

  
193
											<xsl:variable name="personperson"
194
											              select="dnet:rel($personId, $coauthorId, 'personPerson', 'coauthorship', 'isCoAuthorOf',
195
											              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
196

  
197
											<ROW key="{$personId}" columnFamily="personPerson_coAuthorship_isCoAuthorOf">
198
												<QUALIFIER name="{$coauthorId}" type="base64">
199
													<xsl:value-of select="$personperson"/>
200
												</QUALIFIER>
201
											</ROW>
202
										</xsl:if>
203
									</xsl:for-each>
204
								</xsl:if>
205
								<!-- / COAUTHORS -->
206
							</xsl:if>
207
						</xsl:for-each>
208

  
209
					</ROWS>
123
										<ROW key="{$resultId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
124
											<QUALIFIER name="{$datasetId}" type="base64">
125
												<xsl:value-of select="$resultDataset"/>
126
											</QUALIFIER>
127
										</ROW>
128
										<ROW key="{$datasetId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
129
											<QUALIFIER name="{$resultId}" type="base64">
130
												<xsl:value-of select="$datasetResult"/>
131
											</QUALIFIER>
132
										</ROW>
133
									</xsl:if>
134
								</xsl:for-each>
135
							</ROWS>
136
						</xsl:otherwise>
137
					</xsl:choose>
210 138
				</xsl:if>
211 139
			</xsl:otherwise>
212 140
		</xsl:choose>

Also available in: Unified diff