|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * @Author: Ramy-Badr-Ahmed |
| 5 | + * @Desc: Codemeta conversions |
| 6 | + * @Repo: https://github.com/dagstuhl-publishing/beta-codemeta-crosswalk |
| 7 | + */ |
| 8 | + |
| 9 | +return [ |
| 10 | + "rules" => [ |
| 11 | + "bibTex" => [ |
| 12 | + 'name' => 'required', |
| 13 | + 'identifier' => 'required', |
| 14 | + 'author.*.givenName' => 'required_with:author.*.familyName', |
| 15 | + 'author.*.familyName' => 'required_with:author.*.givenName', |
| 16 | + ], |
| 17 | + "bibLaTex" => [ |
| 18 | + 'name' => 'required', |
| 19 | + 'dateCreated' => 'required', |
| 20 | + 'dateModified' => 'required_with:version', |
| 21 | + 'publisher.url' => 'required', |
| 22 | + 'identifier' => 'required', |
| 23 | + 'author.*.givenName' => 'required', |
| 24 | + 'author.*.familyName' => 'required', |
| 25 | + ], |
| 26 | + "dataCite" => [ |
| 27 | + 'name' => 'required', |
| 28 | + 'datePublished' => 'required', |
| 29 | + 'publisher.name' => 'required', |
| 30 | + 'identifier' => 'required', |
| 31 | + 'funder.name' => 'required_with:funder.@id', |
| 32 | + 'funder.*.name' => 'required_with:funder.*.@id', |
| 33 | + 'funder.@id' => 'required_with:funder.name', |
| 34 | + 'funder.*.@id' => 'required_with:funder.*.name', |
| 35 | + 'author.*.givenName' => 'required', |
| 36 | + 'author.*.familyName' => 'required', |
| 37 | + 'contributor.*.givenName' => 'required_with:contributor.*.familyName', |
| 38 | + 'contributor.*.familyName' => 'required_with:contributor.*.givenName', |
| 39 | + 'contributor.givenName' => 'required_with:contributor.familyName', |
| 40 | + 'contributor.familyName' => 'required_with:contributor.givenName', |
| 41 | + ], |
| 42 | + "codeMeta" => [ |
| 43 | + 'publisher' => 'string|required_with:url', |
| 44 | + 'url' => 'url|nullable', |
| 45 | + 'downloadUrl' => 'url|nullable', |
| 46 | + 'installUrl' => 'url|nullable', |
| 47 | + 'buildInstructions' => 'url|nullable', |
| 48 | + 'isPartOf' => 'url|nullable', |
| 49 | + 'hasPart' => 'url|nullable', |
| 50 | + 'readme' => 'url|nullable', |
| 51 | + 'codeRepository' => 'url|nullable', |
| 52 | + 'contIntegration' => 'url|nullable', |
| 53 | + 'issueTracker' => 'url|nullable', |
| 54 | + 'referencePublication' => 'url|nullable', |
| 55 | + 'funder.name' => 'string|required_with:funder.@id,funder.funding', |
| 56 | + 'funder.*.name' => 'string|required_with:funder.*.@id,funder.*.funding', |
| 57 | + 'funder.@id' => 'url|nullable', |
| 58 | + 'funder.*.@id' => 'url|nullable', |
| 59 | + 'author.*.givenName' => 'string|required', |
| 60 | + 'author.*.email' => 'email|nullable', |
| 61 | + 'author.*.@id' => 'url|nullable', |
| 62 | + 'contributor.*.email' => 'email|nullable', |
| 63 | + 'contributor.email' => 'email|nullable', |
| 64 | + 'contributor.*.@id' => 'url|nullable', |
| 65 | + 'contributor.@id' => 'url|nullable', |
| 66 | + 'maintainer.*.email' => 'email|nullable', |
| 67 | + 'maintainer.email' => 'email|nullable', |
| 68 | + 'maintainer.*.@id' => 'url|nullable', |
| 69 | + 'maintainer.@id' => 'url|nullable', |
| 70 | + ] |
| 71 | + ], |
| 72 | + "messages" => [ |
| 73 | + "bibTex" => [ |
| 74 | + 'name.required' => 'bibTex: The :attribute cannot be empty', |
| 75 | + 'identifier.required' => 'bibTex: The :attribute cannot be empty', |
| 76 | + 'author.*.givenName.required_with' => 'bibTex: @:position firstName is required with lastName', |
| 77 | + 'author.*.familyName.required_with' => 'bibTex: @:position lastName is required with firstName' |
| 78 | + ], |
| 79 | + "bibLaTex" => [ |
| 80 | + 'name.required' => 'bibLaTex: The :attribute cannot be empty', |
| 81 | + 'dateCreated.required' => 'bibLaTex: Creation date cannot be empty', |
| 82 | + 'dateModified.required_with' => 'bibLaTex: :attribute cannot be empty with non-empty version', |
| 83 | + 'publisher.url.required' => 'bibLaTex: Publication URL cannot be empty', |
| 84 | + 'identifier.required' => 'bibLaTex: The :attribute cannot be empty', |
| 85 | + 'author.*.givenName.required' => 'bibLaTex: Author :position firstName cannot be empty', |
| 86 | + 'author.*.familyName.required' => 'bibLaTex: Author :position lastName cannot be empty' |
| 87 | + ], |
| 88 | + "dataCite" => [ |
| 89 | + 'name.required' => 'dataCite: The :attribute cannot be empty', |
| 90 | + 'datePublished.required' => 'dataCite: Publication date cannot be empty', |
| 91 | + 'publisher.name.required' => 'dataCite: Publisher cannot be empty', |
| 92 | + 'identifier.required' => 'dataCite: The :attribute cannot be empty', |
| 93 | + 'funder.*.name.required_with' => "dataCite :attribute cannot be empty with non-empty URI", |
| 94 | + 'funder.name.required_with' => "dataCite :attribute cannot be empty with non-empty URI", |
| 95 | + 'funder.*.@id.required_with' => "dataCite: :attribute cannot be empty with non-empty Funder", |
| 96 | + 'funder.@id.required_with' => "dataCite: :attribute cannot be empty with non-empty Funder", |
| 97 | + 'author.*.givenName.required' => 'dataCite: Author :position firstName cannot be empty', |
| 98 | + 'author.*.familyName.required' => 'dataCite: Author :position lastName cannot be empty', |
| 99 | + 'contributor.*.givenName.required_with' => 'dataCite: Contributor :position firstName cannot be empty with non-empty lastName', |
| 100 | + 'contributor.*.familyName.required_with' => 'dataCite: Contributor :position lastName cannot be empty with non-empty firstName', |
| 101 | + 'contributor.givenName.required_with' => 'dataCite: Contributor firstName cannot be empty with non-empty lastName', |
| 102 | + 'contributor.familyName.required_with' => 'dataCite: Contributor lastName cannot be empty with non-empty firstName', |
| 103 | + ], |
| 104 | + "codeMeta" => [ |
| 105 | + 'publisher.required_with' => 'codeMeta: :attribute must be provided if its URL is', |
| 106 | + 'url.url' => 'codeMeta: Please provide a valid URL', |
| 107 | + 'installUrl.url' => 'codeMeta: Please provide a valid URL', |
| 108 | + 'downloadUrl.url' => 'codeMeta: Please provide a valid URL', |
| 109 | + 'buildInstructions.url' => 'codeMeta: Please provide a valid URL', |
| 110 | + 'isPartOf.url' => 'codeMeta: Please provide a valid URL', |
| 111 | + 'hasPart.url' => 'codeMeta: Please provide a valid URL', |
| 112 | + 'readme.url' => 'codeMeta: Please provide a valid URL', |
| 113 | + 'codeRepository.url' => 'codeMeta: Please provide a valid URL', |
| 114 | + 'contIntegration.url' => 'codeMeta: Please provide a valid URL', |
| 115 | + 'issueTracker.url' => 'codeMeta: Please provide a valid URL', |
| 116 | + 'referencePublication.url' => 'codeMeta: Please provide a valid URL', |
| 117 | + 'funder.name.required_with' => "codeMeta: :attribute cannot be empty with non-empty URI/Funding", |
| 118 | + 'funder.*.name.required_with' => "codeMeta: :attribute cannot be empty with non-empty URI/Funding", |
| 119 | + 'funder.*.@id.url' => "codeMeta: Funder :position URL is invalid", |
| 120 | + 'funder.@id.url' => "codeMeta: Funder URL is invalid", |
| 121 | + 'author.*.givenName.required' => "codeMeta: Author :position name cannot be empty", |
| 122 | + 'author.*.email.email' => "codeMeta: Author :position email is invalid", |
| 123 | + 'author.*.@id.url' => "codeMeta: Author :position URL is invalid", |
| 124 | + 'contributor.*.email.email' => "codeMeta: Contributor :position email is invalid", |
| 125 | + 'contributor.email.email' => "codeMeta: Contributor :position email is invalid", |
| 126 | + 'contributor.*.@id.url' => "codeMeta: Contributor :position URL is invalid", |
| 127 | + 'contributor.@id.url' => "codeMeta: Contributor :position URL is invalid", |
| 128 | + 'maintainer.*.email.email' => "codeMeta: Maintainer :position email is invalid", |
| 129 | + 'maintainer.email.email' => "codeMeta: Maintainer :position email is invalid", |
| 130 | + 'maintainer.*.@id.url' => "codeMeta: Maintainer :position URL is invalid", |
| 131 | + 'maintainer.@id.url' => "codeMeta: Maintainer :position URL is invalid", |
| 132 | + ] |
| 133 | + ], |
| 134 | + "attributes" => [ |
| 135 | + "bibTex" => [ |
| 136 | + 'name' => 'SW Name used for bibTex key', |
| 137 | + 'identifier' => 'identifier used for bibTex key' |
| 138 | + ], |
| 139 | + "bibLaTex" => [ |
| 140 | + 'name' => 'SW Name used for bibLaTex key', |
| 141 | + 'identifier' => 'identifier used for bibLaTex key', |
| 142 | + 'dateModified' => 'Release Date' |
| 143 | + ], |
| 144 | + "dataCite" => [ |
| 145 | + 'name' => 'SW Name used for dataCite titles', |
| 146 | + 'identifier' => 'identifier used for dataCite identifiers', |
| 147 | + 'funder.*.name' => 'Funder :position', |
| 148 | + 'funder.name' => 'Funder Name', |
| 149 | + 'funder.*.@id' => 'Funder :position URI', |
| 150 | + 'funder.@id' => 'Funder URI', |
| 151 | + ], |
| 152 | + "codeMeta" => [ |
| 153 | + 'publisher' => 'Publisher name', |
| 154 | + 'funder.*.name' => 'Funder :position', |
| 155 | + 'funder.name' => 'Funder Name', |
| 156 | + ] |
| 157 | + ] |
| 158 | +]; |
| 159 | + |
0 commit comments