@@ -35,8 +35,9 @@ function(action, entity, config){
35
35
}
36
36
}
37
37
38
- createResponsibleParty = function (x , role = NULL ){
38
+ createResponsibleParty = function (x , role = NULL , roleId = NULL ){
39
39
if (is.null(role )) role <- x $ role
40
+ if (is.null(roleId )) roleId = role
40
41
rp <- ISOResponsibleParty $ new()
41
42
if (is.null(x $ firstName )) x $ firstName = NA
42
43
if (is.null(x $ lastName )) x $ lastName = NA
@@ -80,7 +81,7 @@ function(action, entity, config){
80
81
}
81
82
82
83
if (include_object_identification_ids ){
83
- rp_id = paste(role , tolower(x $ email ), sep = " _" )
84
+ rp_id = paste(roleId , tolower(x $ email ), sep = " _" )
84
85
rp $ setAttr(" id" , create_object_identification_id(" party" , rp_id ))
85
86
}
86
87
return (rp )
@@ -181,7 +182,7 @@ function(action, entity, config){
181
182
182
183
if (length(entity $ contacts )> 0 )for (entity_contact in entity $ contacts ){
183
184
if (tolower(entity_contact $ role ) == " metadata" ){
184
- rp <- createResponsibleParty(entity_contact ," pointOfContact" )
185
+ rp <- createResponsibleParty(entity_contact ,role = " pointOfContact" , roleId = " metadata " )
185
186
md $ addContact(rp )
186
187
}
187
188
}
@@ -278,7 +279,7 @@ function(action, entity, config){
278
279
# adding contacts
279
280
if (length(entity $ contacts )> 0 )for (entity_contact in entity $ contacts ){
280
281
if (tolower(entity_contact $ role ) != " metadata" && ! startsWith(entity_contact $ role , " processor" )){
281
- rp <- createResponsibleParty(entity_contact )
282
+ rp <- createResponsibleParty(entity_contact , roleId = " pointOfContact " )
282
283
ident $ addPointOfContact(rp )
283
284
}
284
285
}
@@ -335,7 +336,7 @@ function(action, entity, config){
335
336
owners <- entity $ contacts [sapply(entity $ contacts , function (x ){x $ role == " owner" })]
336
337
if (length(owners )== 0 ) owners <- list (entity $ contacts [[1 ]])
337
338
for (owner_entity in owners ){
338
- rp <- createResponsibleParty(owner_entity )
339
+ rp <- createResponsibleParty(owner_entity , roleId = " owner " )
339
340
ct $ citedResponsibleParty <- c(ct $ citedResponsibleParty , rp )
340
341
}
341
342
}
@@ -786,7 +787,7 @@ function(action, entity, config){
786
787
if (length(distributors )== 0 ) distributors <- list (entity $ contacts [[1 ]])
787
788
for (distributor_entity in distributors ){
788
789
dist_ent = ISODistributor $ new()
789
- dist_rp <- createResponsibleParty(distributor_entity )
790
+ dist_rp <- createResponsibleParty(distributor_entity , roleId = " distributor " )
790
791
dist_ent $ setContact(dist_rp )
791
792
distrib $ addDistributor(dist_ent )
792
793
}
@@ -894,7 +895,7 @@ function(action, entity, config){
894
895
895
896
# processor as responsability party
896
897
for (processor in process $ processors ){
897
- rpp <- createResponsibleParty(processor )
898
+ rpp <- createResponsibleParty(processor , roleId = " processor " )
898
899
processStep $ addProcessor(rpp )
899
900
}
900
901
lineage $ addProcessStep(processStep )
0 commit comments