Coverage for portality/models/v2/shared_structs.py: 100%

2 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-07-22 15:59 +0100

1JOURNAL_BIBJSON = { 

2 "objects" : [ 

3 "bibjson" 

4 ], 

5 "structs" : { 

6 "bibjson" : { 

7 "fields" : { 

8 "alternative_title" : {"coerce" : "unicode"}, 

9 "boai" : {"coerce" : "bool"}, 

10 "eissn" : {"coerce" : "issn", "set__allow_coerce_failure" : True}, 

11 "pissn" : {"coerce" : "issn", "set__allow_coerce_failure" : True}, 

12 "discontinued_date" : {"coerce" : "bigenddate"}, 

13 "publication_time_weeks" : {"coerce" : "integer"}, 

14 "title" : {"coerce" : "unicode"}, 

15 "oa_start" : {"coerce" : "integer"} 

16 }, 

17 "lists" : { 

18 "is_replaced_by" : {"coerce" : "issn", "contains" : "field", "set__allow_coerce_failure" : True}, 

19 "keywords" : {"contains" : "field", "coerce" : "unicode_lower"}, 

20 "language" : {"contains" : "field", "coerce" : "isolang_2letter"}, 

21 "license" : {"contains" : "object"}, 

22 "replaces" : {"contains" : "field", "coerce" : "issn", "set__allow_coerce_failure" : True}, 

23 "subject" : {"contains" : "object"} 

24 }, 

25 "objects" : [ 

26 "apc", 

27 "article", 

28 "copyright", 

29 "deposit_policy", 

30 "editorial", 

31 "institution", 

32 "other_charges", 

33 "pid_scheme", 

34 "plagiarism", 

35 "preservation", 

36 "publisher", 

37 "ref", 

38 "waiver" 

39 ], 

40 "structs" : { 

41 "apc" : { 

42 "fields" : { 

43 "has_apc" : {"coerce" : "bool"}, 

44 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

45 }, 

46 "lists" : { 

47 "max" : {"contains" : "object"} 

48 }, 

49 "structs" : { 

50 "max" : { 

51 "fields" : { 

52 "currency" : {"coerce" : "currency_code"}, 

53 "price" : {"coerce" : "integer"} 

54 } 

55 } 

56 } 

57 }, 

58 "article" : { 

59 "fields" : { 

60 "license_display_example_url" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

61 "orcid" : {"coerce" : "bool"}, 

62 "i4oc_open_citations" : {"coerce" : "bool"} 

63 }, 

64 "lists" : { 

65 "license_display" : {"contains" : "field", "coerce" : "unicode", "allowed_values" : ["Embed", "Display", "No"]}, 

66 } 

67 }, 

68 "copyright" : { 

69 "fields" : { 

70 "author_retains" : {"coerce" : "bool"}, 

71 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

72 } 

73 }, 

74 "deposit_policy" : { 

75 "fields" : { 

76 "has_policy" : {"coerce" : "bool"}, 

77 "is_registered" : {"coerce" : "bool"}, # FIXME: this is no longer used, but remains to aid development where databases already contain this field 

78 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

79 }, 

80 "lists" : { 

81 "service" : {"contains" : "field", "coerce" : "unicode"} 

82 } 

83 }, 

84 "editorial" : { 

85 "fields" : { 

86 "review_url" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

87 "board_url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

88 }, 

89 "lists" : { 

90 "review_process" : {"contains" : "field", "coerce" : "unicode"} 

91 } 

92 }, 

93 "institution" : { 

94 "fields" : { 

95 "name" : {"coerce" : "unicode"}, 

96 "country" : {"coerce" : "country_code", "set__allow_coerce_failure" : True} 

97 } 

98 }, 

99 "license" : { 

100 "fields" : { 

101 "type" : {"coerce" : "unicode"}, 

102 "BY" : {"coerce" : "bool"}, 

103 "NC" : {"coerce" : "bool"}, 

104 "ND" : {"coerce" : "bool"}, 

105 "SA" : {"coerce" : "bool"}, 

106 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

107 } 

108 }, 

109 "other_charges" : { 

110 "fields" :{ 

111 "has_other_charges" : {"coerce" : "bool"}, 

112 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

113 } 

114 }, 

115 "pid_scheme" : { 

116 "fields" : { 

117 "has_pid_scheme" : {"coerce" : "bool"}, 

118 }, 

119 "lists" : { 

120 "scheme" : {"coerce" : "unicode", "contains" : "field"} 

121 } 

122 }, 

123 "plagiarism" : { 

124 "fields" : { 

125 "detection" : {"coerce" : "bool"}, 

126 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

127 } 

128 }, 

129 "preservation": { 

130 "fields": { 

131 "has_preservation": {"coerce": "bool"}, 

132 "url": {"coerce" : "url", "set__allow_coerce_failure" : True} 

133 }, 

134 "lists": { 

135 "national_library": {"contains" : "field", "coerce": "unicode"}, 

136 "service": {"coerce": "unicode", "contains": "field"}, 

137 } 

138 }, 

139 "publisher" : { 

140 "fields" : { 

141 "name" : {"coerce" : "unicode"}, 

142 "country" : {"coerce" : "country_code", "set__allow_coerce_failure" : True} 

143 } 

144 }, 

145 "ref" : { 

146 "fields" : { 

147 "oa_statement" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

148 "journal" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

149 "aims_scope" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

150 "author_instructions" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

151 "license_terms" : {"coerce" : "url", "set__allow_coerce_failure" : True}, 

152 } 

153 }, 

154 "subject" : { 

155 "fields" : { 

156 "code" : {"coerce" : "unicode"}, 

157 "scheme" : {"coerce" : "unicode"}, 

158 "term" : {"coerce" : "unicode"} 

159 } 

160 }, 

161 "waiver" : { 

162 "fields" : { 

163 "has_waiver" : {"coerce" : "bool"}, 

164 "url" : {"coerce" : "url", "set__allow_coerce_failure" : True} 

165 } 

166 } 

167 } 

168 } 

169 } 

170} 

171 

172SHARED_JOURNAL_LIKE = { 

173 "fields" : { 

174 "id" : {"coerce" : "unicode"}, 

175 "created_date" : {"coerce" : "utcdatetime"}, 

176 "last_updated" : {"coerce" : "utcdatetime"}, 

177 "last_manual_update" : {"coerce" : "utcdatetime"}, 

178 "es_type": {"coerce": "unicode"} 

179 }, 

180 "objects" : [ 

181 "admin", 

182 "index" 

183 ], 

184 "structs" : { 

185 "admin" : { 

186 "fields" : { 

187 "seal" : {"coerce" : "bool"}, 

188 "owner" : {"coerce" : "unicode"}, 

189 "editor_group" : {"coerce" : "unicode"}, 

190 "editor" : {"coerce" : "unicode"}, 

191 }, 

192 "lists" : { 

193 "notes" : {"contains" : "object"} 

194 }, 

195 "objects" : [ 

196 "contact" 

197 ], 

198 "structs" : { 

199 "contact" : { 

200 "fields" : { 

201 "email" : {"coerce" : "unicode"}, 

202 "name" : {"coerce" : "unicode"} 

203 } 

204 }, 

205 "notes" : { 

206 "fields" : { 

207 "id" : {"coerce" : "unicode"}, 

208 "note" : {"coerce" : "unicode"}, 

209 "date" : {"coerce" : "utcdatetime"} 

210 } 

211 }, 

212 } 

213 }, 

214 "index" : { 

215 "fields" : { 

216 "country" : {"coerce" : "unicode"}, 

217 "has_apc" : {"coerce" : "unicode"}, 

218 "has_seal" : {"coerce" : "unicode"}, 

219 "unpunctitle" : {"coerce" : "unicode"}, 

220 "asciiunpunctitle" : {"coerce" : "unicode"}, 

221 "continued" : {"coerce" : "unicode"}, 

222 "has_editor_group" : {"coerce" : "unicode"}, 

223 "has_editor" : {"coerce" : "unicode"} 

224 }, 

225 "lists" : { 

226 "issn" : {"contains" : "field", "coerce" : "unicode"}, 

227 "title" : {"contains" : "field", "coerce" : "unicode"}, 

228 "subject" : {"contains" : "field", "coerce" : "unicode"}, 

229 "schema_subject" : {"contains" : "field", "coerce" : "unicode"}, 

230 "classification" : {"contains" : "field", "coerce" : "unicode"}, 

231 "language" : {"contains" : "field", "coerce" : "unicode"}, 

232 "license" : {"contains" : "field", "coerce" : "unicode"}, 

233 "classification_paths" : {"contains" : "field", "coerce" : "unicode"}, 

234 "schema_code" : {"contains" : "field", "coerce" : "unicode"}, 

235 "schema_codes_tree" : {"contains" : "field", "coerce" : "unicode"} 

236 } 

237 } 

238 } 

239}