@@ -38,14 +38,30 @@ async function pnaEndpoint() {
38
38
name : process . env . PNA_DIRECTORY_NAME ? process . env . PNA_DIRECTORY_NAME : "" ,
39
39
dateCreated : formattedNow
40
40
} ;
41
+ let attribution = "" ;
42
+ if ( framework [ "ceterms:ownedBy" ] ) {
43
+ if ( Array . isArray ( framework [ "ceterms:ownedBy" ] ) && framework [ "ceterms:ownedBy" ] . length > 0 ) {
44
+ attribution = framework [ "ceterms:ownedBy" ] [ 0 ] ;
45
+ } else {
46
+ attribution = framework [ "ceterms:ownedBy" ] ;
47
+ }
48
+ }
49
+ if ( attribution == "" && framework [ "schema:author" ] ) {
50
+ if ( Array . isArray ( framework [ "schema:author" ] ) && framework [ "schema:author" ] . length > 0 ) {
51
+ attribution = framework [ "schema:author" ] [ 0 ] ;
52
+ } else {
53
+ attribution = framework [ "schema:author" ] ;
54
+ }
55
+ }
41
56
pnaData [ "container" ] = {
42
57
id : ceasnEndpointFramework + query [ "id" ] ,
43
58
type : "Collection" ,
44
59
fromDirectory : process . env . PNA_DIRECTORY ? process . env . PNA_DIRECTORY : "" ,
45
60
name : framework [ "name" ] ,
46
61
description : framework [ "description" ] ,
47
- attributionURL : framework [ "author" ] ? framework [ "author" ] : ( framework [ "ceterms:ownedBy" ] ? framework [ "ceterms:ownedBy" ] : "" ) ,
48
- beneficiaryRights : framework [ "rights" ] ? framework [ "rights" ] : ( framework [ "license" ] ? framework [ "license" ] : "" ) ,
62
+ attributionName : attribution . startsWith ( 'http' ) ? "" : attribution ,
63
+ attributionURL : attribution . startsWith ( 'http' ) ? attribution : "" ,
64
+ beneficiaryRights : framework [ "ceasn:license" ] ? framework [ "ceasn:license" ] : ( framework [ "schema:license" ] ? framework [ "schema:license" ] : "" ) ,
49
65
dataURL : ceasnEndpointFramework + query [ "id" ] ,
50
66
providerMetaModel : process . env . PNA_PROVIDER_META_MODEL ?process . env . PNA_PROVIDER_META_MODEL : "" ,
51
67
registryRights : process . env . PNA_REGISTRY_RIGHTS ? process . env . PNA_REGISTRY_RIGHTS : "" ,
0 commit comments