Project

General

Profile

« Previous | Next » 

Revision 49016

getting rid of person entities

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/oaf2hbaseAuthors.xml
1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="8b1e581c-8e02-4661-8210-4f70b4f73d97_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<SOURCE_METADATA_FORMAT name="oaf" layout="store" interpretation="cleaned"/>
12
			<SINK_METADATA_FORMAT name="oaf_hbase"/>
13
			<IMPORTED/>
14
			<SCRIPT>
15
				<TITLE>xslt_mapping_oaf2hbase_coAuthors</TITLE>
16
				<CODE>
17
					<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18
					                xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dc="http://purl.org/dc/elements/1.1/"
19
					                xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
20
					                xmlns:dnet="eu.dnetlib.data.transform.xml.DNetMdStoreToHbaseXsltFunctions"
21
					                xmlns:exslt="http://exslt.org/common"
22
					                version="1.0" extension-element-prefixes="exslt"
23
					                exclude-result-prefixes="xsl oaf dr dri dnet exslt">
24

  
25
						<xsl:output omit-xml-declaration="yes" indent="yes"/>
26

  
27
						<xsl:param name="mergeIdForHomonyms" select="true()"/>
28
						<xsl:param name="writeCoAuthors" select="false()"/>
29

  
30
						<xsl:template match="/*">
31
							<xsl:variable name="about" select="/*[local-name() = 'record']/*[local-name() = 'about']"/>
32
							<xsl:variable name="dateofcollection" select="//dr:dateOfCollection"/>
33

  
34
							<xsl:variable name="metadata" select="exslt:node-set(//*[local-name()='metadata']/*)"/>
35
							<xsl:variable name="namespaceprefix">
36
								<xsl:choose>
37

  
38
									<!-- TODO check namespaceprefix length is 12 -->
39
									<xsl:when test="string-length(//oaf:datasourceprefix) &gt; 0">
40
										<xsl:value-of select="//oaf:datasourceprefix"/>
41
									</xsl:when>
42
									<xsl:otherwise>
43
										<xsl:value-of select="unknown_"/>
44
									</xsl:otherwise>
45
								</xsl:choose>
46
							</xsl:variable>
47

  
48
							<xsl:choose>
49
								<!-- 			<xsl:when test="count($metadata) = 0 or string-length($namespaceprefix) = 0"> -->
50
								<xsl:when test="count($metadata) = 0">
51
									<ROWS/>
52
								</xsl:when>
53
								<xsl:otherwise>
54

  
55
									<xsl:variable name="objIdentifier" select="//dri:objIdentifier"/>
56
									<xsl:variable name="resultId" select="dnet:oafSimpleId('result', //dri:objIdentifier)"/>
57

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

  
60
										<xsl:variable name="collectedfromid" select="dnet:oafSplitId('datasource', //oaf:collectedFrom/@id)"/>
61
										<xsl:variable name="collectedfromname" select="//oaf:collectedFrom/@name"/>
62

  
63
										<xsl:variable name="hostedbyid" select="dnet:oafSplitId('datasource', //oaf:hostedBy/@id)"/>
64
										<xsl:variable name="hostedbyname" select="//oaf:hostedBy/@name"/>
65

  
66
										<xsl:variable name="originalidTest" select="/record/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/>
67
										<xsl:variable name="originalid">
68
											<xsl:choose>
69
												<xsl:when test="contains($originalidTest, '::')">
70
													<xsl:value-of select="substring-after($originalidTest, '::')"/>
71
												</xsl:when>
72
												<xsl:otherwise>
73
													<xsl:value-of select="$originalidTest"/>
74
												</xsl:otherwise>
75
											</xsl:choose>
76
										</xsl:variable>
77

  
78
										<xsl:variable name="result"
79
										              select="dnet:oafResultFromMDStore($resultId, $about, $hostedbyid, $hostedbyname, $collectedfromid, $collectedfromname, $originalid, $dateofcollection, $metadata)"/>
80

  
81
										<ROWS>
82
											<ROW key="{$resultId}" columnFamily="result">
83
												<QUALIFIER name="body" type="base64">
84
													<xsl:value-of select="$result"/>
85
												</QUALIFIER>
86
											</ROW>
87

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

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

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

  
94
													<xsl:variable name="resultproject"
95
													              select="dnet:oafResultProject_Outcome_FromMDStore($resultId, $projectId, 'isProducedBy', $about)"/>
96
													<xsl:variable name="projectresult"
97
													              select="dnet:oafResultProject_Outcome_FromMDStore($projectId, $resultId, 'produces', $about)"/>
98

  
99
													<ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
100
														<QUALIFIER name="{$projectId}" type="base64">
101
															<xsl:value-of select="$resultproject"/>
102
														</QUALIFIER>
103
													</ROW>
104
													<ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
105
														<QUALIFIER name="{$resultId}" type="base64">
106
															<xsl:value-of select="$projectresult"/>
107
														</QUALIFIER>
108
													</ROW>
109
												</xsl:if>
110
											</xsl:for-each>
111

  
112
											<xsl:for-each select="//*[local-name()='relatedDataset']">
113

  
114
												<!-- relatedDataset ids must be in the openaire format  -->
115
												<xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(./@id))"/>
116

  
117
												<xsl:if test="string-length($datasetId) &gt; 0">
118

  
119
													<xsl:variable name="resultDataset"
120
													              select="dnet:oafResultResult_PublicationDataset_FromMDStore($resultId, $datasetId, 'isRelatedTo', $about)"/>
121
													<xsl:variable name="datasetResult"
122
													              select="dnet:oafResultResult_PublicationDataset_FromMDStore($datasetId, $resultId, 'isRelatedTo', $about)"/>
123

  
124
													<ROW key="{$resultId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
125
														<QUALIFIER name="{$datasetId}" type="base64">
126
															<xsl:value-of select="$resultDataset"/>
127
														</QUALIFIER>
128
													</ROW>
129
													<ROW key="{$datasetId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
130
														<QUALIFIER name="{$resultId}" type="base64">
131
															<xsl:value-of select="$datasetResult"/>
132
														</QUALIFIER>
133
													</ROW>
134
												</xsl:if>
135
											</xsl:for-each>
136

  
137
											<xsl:for-each select="//*[local-name()='creator']">
138

  
139
												<xsl:if test="string-length(normalize-space(.)) &gt; 0">
140

  
141
													<xsl:variable name="personIdPart">
142
														<xsl:call-template name="personIdTmpl">
143
															<xsl:with-param name="objIdentifier" select="$objIdentifier"/>
144
														</xsl:call-template>
145
													</xsl:variable>
146
													<xsl:variable name="position" select="position()"/>
147

  
148
													<xsl:variable name="personId"
149
													              select="dnet:oafId('person', $namespaceprefix, normalize-space($personIdPart))"/>
150
													<xsl:variable name="person"
151
													              select="dnet:oafPersonFromMDStore($personId, $about, $collectedfromid, $collectedfromname, $originalid, $dateofcollection, .)"/>
152
													<xsl:variable name="personresult"
153
													              select="dnet:oafPersonResult_Authorship_FromMDStore($personId, $resultId, $position, 'isAuthorOf', $about)"/>
154
													<xsl:variable name="resultperson"
155
													              select="dnet:oafPersonResult_Authorship_FromMDStore($resultId, $personId, $position, 'hasAuthor', $about)"/>
156

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

  
180
													<!-- COAUTHORS -->
181
													<xsl:if test="$writeCoAuthors = true()">
182
														<xsl:for-each select="../dc:creator">
183
															<xsl:if test="$position != position()">
184
																<xsl:variable name="coauthorIdPart">
185
																	<xsl:call-template name="personIdTmpl">
186
																		<xsl:with-param name="objIdentifier" select="$objIdentifier"/>
187
																	</xsl:call-template>
188
																</xsl:variable>
189
																<xsl:variable name="coauthorId"
190
																              select="dnet:oafId('person', $namespaceprefix, normalize-space($coauthorIdPart))"/>
191
																<xsl:variable name="personperson"
192
																              select="dnet:oafPersonPerson_CoAuthorship_FromDMF($personId, $coauthorId, 'isCoAuthorOf', $about)"/>
193
																<ROW key="{$personId}" columnFamily="personPerson_coAuthorship_isCoAuthorOf">
194
																	<QUALIFIER name="{$coauthorId}" type="base64">
195
																		<xsl:value-of select="$personperson"/>
196
																	</QUALIFIER>
197
																</ROW>
198
															</xsl:if>
199
														</xsl:for-each>
200
													</xsl:if>
201
													<!-- / COAUTHORS -->
202
												</xsl:if>
203
											</xsl:for-each>
204
										</ROWS>
205
									</xsl:if>
206
								</xsl:otherwise>
207
							</xsl:choose>
208
						</xsl:template>
209

  
210
						<xsl:template name="personIdTmpl">
211
							<xsl:param name="objIdentifier"/>
212
							<xsl:choose>
213
								<xsl:when test="$mergeIdForHomonyms = false()">
214
									<xsl:value-of select="concat($objIdentifier, '::', normalize-space(.))"/>
215
								</xsl:when>
216
								<xsl:otherwise>
217
									<xsl:value-of select="normalize-space(.)"/>
218
								</xsl:otherwise>
219
							</xsl:choose>
220
						</xsl:template>
221

  
222
					</xsl:stylesheet>
223
				</CODE>
224
			</SCRIPT>
225
		</CONFIGURATION>
226
		<STATUS/>
227
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
228
	</BODY>
229
</RESOURCE_PROFILE>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/oaf2hbaseUnpackAuthors.xml
1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="c460e550-01dc-414d-9eb3-7f5c02e2ab03_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" />
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType" />
5
		<RESOURCE_KIND value="TransformationRuleDSResources" />
6
		<RESOURCE_URI value="" />
7
		<DATE_OF_CREATION value="2015-02-27T17:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
        <CONFIGURATION>
11
			<SOURCE_METADATA_FORMAT name="oaf" layout="store" interpretation="cleaned" />
12
			<SINK_METADATA_FORMAT name="oaf_hbase" />  
13
            <IMPORTED/>
14
            <SCRIPT>          
15
                <TITLE>xslt_mapping_oaf2hbase_unpack_authors</TITLE>
16
                <CODE>
17
	                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18
	                                xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
19
	                                xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:oaa="http://namespace.openaire.eu/oaa"
20
	                                xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:dnet="eu.dnetlib.data.transform.xml.DNetMdStoreToHbaseXsltFunctions"
21
	                                xmlns:exslt="http://exslt.org/common"
22
	                                version="1.0" extension-element-prefixes="exslt"
23
	                                exclude-result-prefixes="xsl dc dr dri oaa oaf dnet exslt">
24

  
25
		                <xsl:output omit-xml-declaration="yes" indent="yes"/>
26

  
27
		                <xsl:param name="mergeIdForHomonyms" select="false()"/>
28
		                <xsl:param name="mergeIdForHomonymsMap"/>
29

  
30
		                <xsl:param name="writeCoAuthors" select="false()"/>
31

  
32
		                <xsl:template match="/*">
33
			                <xsl:variable name="dataInfo" select="/*[local-name() = 'record']/*[local-name() = 'about']/*[local-name() = 'datainfo']"/>
34
			                <xsl:variable name="dateofcollection" select="//dr:dateOfCollection"/>
35

  
36
			                <xsl:variable name="metadata" select="exslt:node-set(//*[local-name()='metadata']/*)"/>
37
			                <xsl:variable name="namespaceprefix">
38
				                <xsl:choose>
39

  
40
					                <!-- TODO check namespaceprefix length is 12 -->
41
					                <xsl:when test="string-length(//oaf:datasourceprefix) &gt; 0">
42
						                <xsl:value-of select="//oaf:datasourceprefix"/>
43
					                </xsl:when>
44
					                <xsl:otherwise>
45
						                <xsl:value-of select="unknown_"/>
46
					                </xsl:otherwise>
47
				                </xsl:choose>
48
			                </xsl:variable>
49

  
50
			                <xsl:choose>
51
				                <!-- 			<xsl:when test="count($metadata) = 0 or string-length($namespaceprefix) = 0"> -->
52
				                <xsl:when test="count($metadata) = 0">
53
					                <ROWS/>
54
				                </xsl:when>
55
				                <xsl:otherwise>
56

  
57
					                <xsl:variable name="objIdentifier" select="//dri:objIdentifier"/>
58
					                <xsl:variable name="resultId" select="dnet:oafSimpleId('result', //dri:objIdentifier)"/>
59

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

  
62
						                <xsl:variable name="collectedfromid" select="dnet:oafSplitId('datasource', //oaf:collectedFrom/@id)"/>
63
						                <xsl:variable name="collectedfromname" select="//oaf:collectedFrom/@name"/>
64

  
65
						                <xsl:variable name="hostedbyid" select="dnet:oafSplitId('datasource', //oaf:hostedBy/@id)"/>
66
						                <xsl:variable name="hostedbyname" select="//oaf:hostedBy/@name"/>
67

  
68
						                <xsl:variable name="originalidTest" select="/record/*[local-name() = 'header']/*[local-name() = 'recordIdentifier']"/>
69
						                <xsl:variable name="originalid">
70
							                <xsl:choose>
71
								                <xsl:when test="contains($originalidTest, '::')">
72
									                <xsl:value-of select="substring-after($originalidTest, '::')"/>
73
								                </xsl:when>
74
								                <xsl:otherwise>
75
									                <xsl:value-of select="$originalidTest"/>
76
								                </xsl:otherwise>
77
							                </xsl:choose>
78
						                </xsl:variable>
79

  
80
						                <xsl:variable name="result"
81
						                              select="dnet:oafResultFromMDStore($resultId, $dataInfo, $hostedbyid, $hostedbyname, $collectedfromid, $collectedfromname, $originalid, $dateofcollection, $metadata)"/>
82

  
83
						                <ROWS>
84
							                <ROW key="{$resultId}" columnFamily="result">
85
								                <QUALIFIER name="body" type="base64">
86
									                <xsl:value-of select="$result"/>
87
								                </QUALIFIER>
88
											</ROW>
89

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

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

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

  
96
									                <xsl:variable name="resultproject"
97
									                              select="dnet:oafResultProject_Outcome_FromMDStore($resultId, $projectId, 'isProducedBy', $dataInfo)"/>
98
									                <xsl:variable name="projectresult"
99
									                              select="dnet:oafResultProject_Outcome_FromMDStore($projectId, $resultId, 'produces', $dataInfo)"/>
100

  
101
									                <ROW key="{$resultId}" columnFamily="resultProject_outcome_isProducedBy">
102
										                <QUALIFIER name="{$projectId}" type="base64">
103
											                <xsl:value-of select="$resultproject"/>
104
										                </QUALIFIER>
105
									                </ROW>
106
									                <ROW key="{$projectId}" columnFamily="resultProject_outcome_produces">
107
										                <QUALIFIER name="{$resultId}" type="base64">
108
											                <xsl:value-of select="$projectresult"/>
109
										                </QUALIFIER>
110
									                </ROW>
111
								                </xsl:if>
112
							                </xsl:for-each>
113

  
114
							                <xsl:for-each select="//*[local-name()='relatedDataset']">
115

  
116
								                <!-- relatedDataset ids must be in the openaire format  -->
117
								                <xsl:variable name="datasetId" select="dnet:oafSimpleId('result', normalize-space(./@id))"/>
118

  
119
								                <xsl:if test="string-length($datasetId) &gt; 0">
120

  
121
									                <xsl:variable name="resultDataset"
122
									                              select="dnet:oafResultResult_PublicationDataset_FromMDStore($resultId, $datasetId, 'isRelatedTo', $dataInfo)"/>
123
									                <xsl:variable name="datasetResult"
124
									                              select="dnet:oafResultResult_PublicationDataset_FromMDStore($datasetId, $resultId, 'isRelatedTo', $dataInfo)"/>
125

  
126
									                <ROW key="{$resultId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
127
										                <QUALIFIER name="{$datasetId}" type="base64">
128
											                <xsl:value-of select="$resultDataset"/>
129
										                </QUALIFIER>
130
									                </ROW>
131
									                <ROW key="{$datasetId}" columnFamily="resultResult_publicationDataset_isRelatedTo">
132
										                <QUALIFIER name="{$resultId}" type="base64">
133
											                <xsl:value-of select="$datasetResult"/>
134
										                </QUALIFIER>
135
									                </ROW>
136
								                </xsl:if>
137
							                </xsl:for-each>
138

  
139
							                <xsl:for-each select="//*[local-name()='creator']">
140

  
141
								                <xsl:if test="string-length(normalize-space(.)) &gt; 0">
142

  
143
									                <xsl:variable name="personIdPart">
144
										                <xsl:call-template name="personIdTmpl">
145
											                <xsl:with-param name="objIdentifier" select="$objIdentifier"/>
146
											                <xsl:with-param name="namespaceprefix" select="$namespaceprefix"/>
147
											                <xsl:with-param name="mergeIdForHomonymsMap" select="$mergeIdForHomonymsMap"/>
148
										                </xsl:call-template>
149
									                </xsl:variable>
150
									                <xsl:variable name="position" select="position()"/>
151

  
152
									                <xsl:variable name="personId"
153
									                              select="dnet:oafId('person', $namespaceprefix, normalize-space($personIdPart))"/>
154
									                <xsl:variable name="person"
155
									                              select="dnet:oafPersonFromMDStore($personId, $dataInfo, $collectedfromid, $collectedfromname, $originalid, $dateofcollection, .)"/>
156
									                <xsl:variable name="personresult"
157
									                              select="dnet:oafPersonResult_Authorship_FromMDStore($personId, $resultId, $position, 'isAuthorOf', $dataInfo)"/>
158
									                <xsl:variable name="resultperson"
159
									                              select="dnet:oafPersonResult_Authorship_FromMDStore($resultId, $personId, $position, 'hasAuthor', $dataInfo)"/>
160

  
161
									                <xsl:if test="string-length($personId) &gt; 0">
162
										                <ROW key="{$personId}" columnFamily="person">
163
											                <QUALIFIER name="body" type="base64">
164
												                <xsl:value-of select="$person"/>
165
											                </QUALIFIER>
166
										                </ROW>
167
										                <ROW key="{$personId}" columnFamily="personResult_authorship_isAuthorOf">
168
											                <QUALIFIER name="{$resultId}" type="base64">
169
												                <xsl:value-of select="$personresult"/>
170
											                </QUALIFIER>
171
										                </ROW>
172
										                <ROW key="{$resultId}" columnFamily="personResult_authorship_hasAuthor">
173
											                <QUALIFIER name="{$personId}" type="base64">
174
												                <xsl:value-of select="$resultperson"/>
175
											                </QUALIFIER>
176
										                </ROW>
177
										                <ROW key="{$personId}" columnFamily="result">
178
											                <QUALIFIER name="{$resultId}" type="base64">
179
												                <xsl:value-of select="$result"/>
180
											                </QUALIFIER>
181
										                </ROW>
182
									                </xsl:if>
183

  
184
									                <!-- COAUTHORS -->
185
									                <xsl:if test="$writeCoAuthors = true()">
186
										                <xsl:for-each select="../dc:creator">
187
											                <xsl:if test="$position != position()">
188
												                <xsl:variable name="coauthorIdPart">
189
													                <xsl:call-template name="personIdTmpl">
190
														                <xsl:with-param name="objIdentifier" select="$objIdentifier"/>
191
													                </xsl:call-template>
192
												                </xsl:variable>
193
												                <xsl:variable name="coauthorId"
194
												                              select="dnet:oafId('person', $namespaceprefix, normalize-space($coauthorIdPart))"/>
195
												                <xsl:variable name="personperson"
196
												                              select="dnet:oafPersonPerson_CoAuthorship_FromDMF($personId, $coauthorId, 'isCoAuthorOf', $dataInfo)"/>
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
						                </ROWS>
209
					                </xsl:if>
210
				                </xsl:otherwise>
211
			                </xsl:choose>
212
		                </xsl:template>
213

  
214
		                <xsl:template name="personIdTmpl">
215

  
216
			                <xsl:param name="objIdentifier"/>
217
			                <xsl:param name="namespaceprefix"/>
218
			                <xsl:param name="mergeIdForHomonymsMap"/>
219
			                <xsl:variable name="mergeIdForHomonyms" select="dnet:lookupValue($mergeIdForHomonymsMap, $namespaceprefix)"/>
220
			                <xsl:choose>
221
				                <xsl:when test="$mergeIdForHomonyms = false()">
222
					                <xsl:value-of select="concat($objIdentifier, '::', normalize-space(.))"/>
223
				                </xsl:when>
224
				                <xsl:otherwise>
225
					                <xsl:value-of select="normalize-space(.)"/>
226
				                </xsl:otherwise>
227
			                </xsl:choose>
228
		                </xsl:template>
229

  
230
	                </xsl:stylesheet>
231
                </CODE>
232
            </SCRIPT>
233
        </CONFIGURATION>
234
		<STATUS />
235
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
236
	</BODY>
237
</RESOURCE_PROFILE>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/oaf2hbase.xml
147 147
										</ROW>
148 148
									</xsl:if>
149 149
								</xsl:for-each>
150

  
151
								<xsl:for-each select="//*[local-name()='creator']">
152

  
153
									<xsl:if test="string-length(normalize-space(.)) &gt; 0">
154
										<xsl:variable name="originalPersonId">
155
											<xsl:choose>
156
												<xsl:when test="string-length(@nameIdentifier) &gt; 0">
157
													<xsl:value-of select="normalize-space(@nameIdentifier)"/>
158
												</xsl:when>
159
												<xsl:otherwise>
160
													<xsl:value-of select="concat($originalid, '::', normalize-space(.))"/>
161
												</xsl:otherwise>
162
											</xsl:choose>
163
										</xsl:variable>
164

  
165
										<xsl:variable name="personId" select="dnet:oafId('person', $namespaceprefix, $originalPersonId)"/>
166
										<xsl:variable name="position" select="position()"/>
167

  
168
										<xsl:variable name="person"
169
										              select="dnet:person($personId, $about, $provenance, $trust, $collectedfromid, $collectedfromname,
170
			                                  $originalPersonId, $dateofcollection, $dateoftransformation, normalize-space(.), @nameIdentifier, @nameIdentifierScheme)"/>
171
										<xsl:variable name="personresult"
172
										              select="dnet:personResult_Authorship($personId, $resultId, $position, 'isAuthorOf',
173
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
174
										<xsl:variable name="resultperson"
175
										              select="dnet:personResult_Authorship($resultId, $personId, $position, 'hasAuthor',
176
								              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
177

  
178
										<xsl:if test="string-length($personId) &gt; 0">
179
											<ROW key="{$personId}" columnFamily="person">
180
												<QUALIFIER name="body" type="base64">
181
													<xsl:value-of select="$person"/>
182
												</QUALIFIER>
183
											</ROW>
184
											<ROW key="{$personId}" columnFamily="personResult_authorship_isAuthorOf">
185
												<QUALIFIER name="{$resultId}" type="base64">
186
													<xsl:value-of select="$personresult"/>
187
												</QUALIFIER>
188
											</ROW>
189
											<ROW key="{$resultId}" columnFamily="personResult_authorship_hasAuthor">
190
												<QUALIFIER name="{$personId}" type="base64">
191
													<xsl:value-of select="$resultperson"/>
192
												</QUALIFIER>
193
											</ROW>
194
										</xsl:if>
195

  
196
										<!-- COAUTHORS -->
197
										<xsl:if test="$writeCoAuthors = true()">
198
											<xsl:for-each select="../dc:creator">
199
												<xsl:if test="$position != position()">
200

  
201
													<xsl:variable name="originalCoauthorId">
202
														<xsl:choose>
203
															<xsl:when test="string-length(@nameIdentifier) &gt; 0">
204
																<xsl:value-of select="normalize-space(@nameIdentifier)"/>
205
															</xsl:when>
206
															<xsl:otherwise>
207
																<xsl:value-of select="concat($originalid, '::', normalize-space(.))"/>
208
															</xsl:otherwise>
209
														</xsl:choose>
210
													</xsl:variable>
211

  
212
													<xsl:variable name="coauthorId"
213
													              select="dnet:oafId('person', $namespaceprefix, $originalCoauthorId)"/>
214

  
215
													<xsl:variable name="personperson"
216
													              select="dnet:rel($personId, $coauthorId, 'personPerson', 'coauthorship', 'isCoAuthorOf',
217
											              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
218

  
219
													<ROW key="{$personId}" columnFamily="personPerson_coAuthorship_isCoAuthorOf">
220
														<QUALIFIER name="{$coauthorId}" type="base64">
221
															<xsl:value-of select="$personperson"/>
222
														</QUALIFIER>
223
													</ROW>
224
												</xsl:if>
225
											</xsl:for-each>
226
										</xsl:if>
227
										<!-- / COAUTHORS -->
228
									</xsl:if>
229
								</xsl:for-each>
230

  
231 150
							</ROWS>
232 151
						</xsl:otherwise>
233 152
					</xsl:choose>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/odf2hbase.xml
56 56
            <xsl:if test="string-length($resultId) &gt; 0">
57 57
                <xsl:variable name="originalids"
58 58
                              select="//*[local-name() = 'resource']/*[local-name()='identifier'] | //*[local-name() = 'resource']//*[local-name()='alternateIdentifier']"/>
59
                <xsl:variable name="creators" select="//*[local-name() = 'creator']"/>
60 59
                <xsl:variable name="titles" select="//*[local-name() = 'title']"/>
61 60
                <xsl:variable name="subjects" select="//*[local-name() = 'subject']"/>
62 61
                <xsl:variable name="publisher" select="//*[local-name() = 'publisher']"/>
......
111 110
			                <xsl:value-of select="$result"/>
112 111
		                </QUALIFIER>
113 112
	                </ROW>
114
	                <xsl:for-each select="//*[local-name() = 'creator']">
115 113

  
116
		                <xsl:variable name="personIdTemp">
117
			                <xsl:choose>
118
				                <xsl:when test="string-length(./*[local-name() = 'nameIdentifier']) &gt; 0">
119
					                <xsl:value-of
120
							                select="translate(normalize-space(./*[local-name() = 'nameIdentifier']),' .,','___')"/>
121
				                </xsl:when>
122
				                <xsl:otherwise>
123
					                <xsl:value-of select="translate(normalize-space(./*[local-name() = 'creatorName']),' .,','___')"/>
124
				                </xsl:otherwise>
125
			                </xsl:choose>
126
		                </xsl:variable>
127

  
128
		                <xsl:variable name="personId" select="dnet:oafId('person', $namespaceprefix, normalize-space($personIdTemp))"/>
129

  
130
		                <xsl:variable name="originalPersonId" select="./*[local-name() = 'nameIdentifier']"/>
131

  
132
		                <xsl:if test="string-length($personId) &gt; 0">
133
			                <xsl:variable name="position" select="position()"/>
134
			                <xsl:variable name="person"
135
			                              select="dnet:person($personId, $about, $provenance, $trust, $collectedfromid, $collectedfromname,
136
			                              $originalPersonId, $dateOfCollection, $dateoftransformation, normalize-space(./*[local-name() = 'creatorName']),
137
			                              ./*[local-name() = 'nameIdentifier'], ./*[local-name() = 'nameIdentifier']/@nameIdentifierScheme)"/>
138
			                <xsl:variable name="personresult"
139
			                              select="dnet:personResult_Authorship($personId, $resultId, $position, 'isAuthorOf',
140
			                              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
141
			                <xsl:variable name="resultperson"
142
			                              select="dnet:personResult_Authorship($resultId, $personId, $position, 'hasAuthor',
143
			                              $collectedfromid, $collectedfromname, $provenance, $trust, $about)"/>
144

  
145
			                <ROW key="{$personId}" columnFamily="person">
146
				                <QUALIFIER name="body" type="base64">
147
					                <xsl:value-of select="$person"/>
148
				                </QUALIFIER>
149
			                </ROW>
150
			                <ROW key="{$personId}" columnFamily="personResult_authorship_isAuthorOf">
151
				                <QUALIFIER name="{$resultId}" type="base64">
152
					                <xsl:value-of select="$personresult"/>
153
				                </QUALIFIER>
154
			                </ROW>
155
			                <ROW key="{$resultId}" columnFamily="personResult_authorship_hasAuthor">
156
				                <QUALIFIER name="{$personId}" type="base64">
157
					                <xsl:value-of select="$resultperson"/>
158
				                </QUALIFIER>
159
			                </ROW>
160
		                </xsl:if>
161
	                </xsl:for-each>
162

  
163 114
	                <xsl:for-each select="//*[local-name()='projectid']">
164 115

  
165 116
		                <xsl:variable name="projectId"
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/OntologyDSResources/OntologyDSResourceType/person_result_relations.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="12b8832a-0e97-43a9-b5ec-c33ff3c29778_T250b2xvZ3lEU1Jlc291cmNlcy9PbnRvbG9neURTUmVzb3VyY2VUeXBl"/>
4
        <RESOURCE_TYPE value="OntologyDSResourceType"/>
5
        <RESOURCE_KIND value="OntologyDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2013-11-18T10:46:37+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <ONTOLOGY_NAME code="dnet:person_result_relations">dnet:person_result_relations</ONTOLOGY_NAME>
12
            <ONTOLOGY_DESCRIPTION>Vocabulary of the relations between Result and Person entities</ONTOLOGY_DESCRIPTION>
13
            <TERMS>
14
                <TERM code="isAuthorOf" encoding="personResult_authorship_isAuthorOf" english_name="author of" native_name="author of">
15
                    <SYNONYMS/>
16
         			<RELATIONS>
17
						<RELATION type="inverseOf" code="hasAuthor"/>
18
					</RELATIONS>
19
                </TERM>
20
                <TERM code="hasAuthor" encoding="personResult_authorship_hasAuthor" english_name="has author" native_name="has author">
21
                    <SYNONYMS/>
22
         			<RELATIONS>
23
						<RELATION type="inverseOf" code="isAuthorOf"/>
24
					</RELATIONS>
25
                </TERM>
26
                <TERM code="isContributorOf" encoding="personResult_contribution_isContributorOf" english_name="contributor of" native_name="contributor of">
27
                    <SYNONYMS/>
28
                    <RELATIONS>
29
                        <RELATION type="inverseOf" code="hasContributor"/>
30
                    </RELATIONS>
31
                </TERM>
32
                <TERM code="hasContributor" encoding="personResult_contribution_hasContributor" english_name="has contributor" native_name="has contributor">
33
                    <SYNONYMS/>
34
                    <RELATIONS>
35
                        <RELATION type="inverseOf" code="isContributorOf"/>
36
                    </RELATIONS>
37
                </TERM>
38
            </TERMS>
39
        </CONFIGURATION>
40
        <STATUS>
41
            <LAST_UPDATE value="2013-11-18T10:46:36Z"/>
42
        </STATUS>
43
        <SECURITY_PARAMETERS>String</SECURITY_PARAMETERS>
44
    </BODY>
45
</RESOURCE_PROFILE>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/OntologyDSResources/OntologyDSResourceType/person_person_relations.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="b8defa31-9f95-4d11-8472-532146936b48_T250b2xvZ3lEU1Jlc291cmNlcy9PbnRvbG9neURTUmVzb3VyY2VUeXBl"/>
4
        <RESOURCE_TYPE value="OntologyDSResourceType"/>
5
        <RESOURCE_KIND value="OntologyDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2013-11-18T10:46:37+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <ONTOLOGY_NAME code="dnet:person_person_relations">dnet:person_person_relations</ONTOLOGY_NAME>
12
            <ONTOLOGY_DESCRIPTION>Vocabulary of the relations between Person and Person entities</ONTOLOGY_DESCRIPTION>
13
            <TERMS>
14
                <TERM code="isCoAuthorOf" encoding="personPerson_coAuthorship_isCoauthorOf" english_name="is coauthor of" native_name="is coauthor of">
15
                    <SYNONYMS/>
16
         			<RELATIONS>
17
						<RELATION type="inverseOf" code="isCoAuthorOf"/>
18
					</RELATIONS>
19
                </TERM>
20
                <TERM code="merges" encoding="personPerson_dedup_merges" english_name="merges" native_name="merges">
21
                    <SYNONYMS/>
22
                    <RELATIONS>
23
						<RELATION type="inverseOf" code="isMergedIn"/>
24
					</RELATIONS>                    
25
                </TERM>
26
                <TERM code="isMergedIn" encoding="personPerson_dedup_isMergedIn" english_name="is Merged In" native_name="is Merged In">
27
                    <SYNONYMS/>
28
                    <RELATIONS>
29
						<RELATION type="inverseOf" code="merges"/>
30
					</RELATIONS>                    
31
                </TERM>
32
                <TERM code="isSimilarTo" encoding="personPerson_dedupSimilarity_isSimilarTo" english_name="is similar to" native_name="is similar to">
33
                    <SYNONYMS/>
34
                    <RELATIONS>
35
						<RELATION type="inverseOf" code="isSimilarTo"/>
36
					</RELATIONS>
37
                </TERM>
38
            </TERMS>
39
        </CONFIGURATION>
40
        <STATUS>
41
            <LAST_UPDATE value="2013-11-18T10:46:36Z"/>
42
        </STATUS>
43
        <SECURITY_PARAMETERS>String</SECURITY_PARAMETERS>
44
    </BODY>
45
</RESOURCE_PROFILE>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/OntologyDSResources/OntologyDSResourceType/person_project_relations.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="57e16235-b6c1-4a40-b5be-3e84acb2ff48_T250b2xvZ3lEU1Jlc291cmNlcy9PbnRvbG9neURTUmVzb3VyY2VUeXBl"/>
4
        <RESOURCE_TYPE value="OntologyDSResourceType"/>
5
        <RESOURCE_KIND value="OntologyDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2013-11-18T10:46:37+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <ONTOLOGY_NAME code="dnet:project_person_relations">dnet:project_person_relations</ONTOLOGY_NAME>
12
            <ONTOLOGY_DESCRIPTION>Vocabulary of the relations between Person and Project entities</ONTOLOGY_DESCRIPTION>
13
            <TERMS>
14
                <TERM code="isContact" encoding="projectPerson_contactPerson_isContact" english_name="is contact" native_name="is contact">
15
                    <SYNONYMS/>
16
         			<RELATIONS>
17
						<RELATION type="inverseOf" code="hasContact"/>
18
					</RELATIONS>
19
                </TERM>
20
                <TERM code="hasContact" encoding="projectPerson_contactPerson_hasContact" english_name="has contact" native_name="has contact">
21
                    <SYNONYMS/>
22
                    <RELATIONS>
23
						<RELATION type="inverseOf" code="isContact"/>
24
					</RELATIONS>                    
25
                </TERM>
26
            </TERMS>
27
        </CONFIGURATION>
28
        <STATUS>
29
            <LAST_UPDATE value="2013-11-18T10:46:36Z"/>
30
        </STATUS>
31
        <SECURITY_PARAMETERS>String</SECURITY_PARAMETERS>
32
    </BODY>
33
</RESOURCE_PROFILE>

Also available in: Unified diff