Coverage for oc_ocdm / graph / entities / bibliographic / bibliographic_resource.py: 82%

267 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-05-08 20:23 +0000

1#!/usr/bin/python 

2 

3# SPDX-FileCopyrightText: 2020-2022 Simone Persiani <iosonopersia@gmail.com> 

4# SPDX-FileCopyrightText: 2022-2024 Arcangelo Massari <arcangelo.massari@unibo.it> 

5# 

6# SPDX-License-Identifier: ISC 

7 

8# -*- coding: utf-8 -*- 

9from __future__ import annotations 

10 

11from typing import TYPE_CHECKING 

12 

13from triplelite import RDFTerm 

14 

15from oc_ocdm.decorators import accepts_only 

16from oc_ocdm.support.support import get_datatype_from_iso_8601 

17 

18if TYPE_CHECKING: 

19 from typing import List, Optional 

20 

21 from oc_ocdm.graph.entities.bibliographic.agent_role import AgentRole 

22 from oc_ocdm.graph.entities.bibliographic.bibliographic_reference import BibliographicReference 

23 from oc_ocdm.graph.entities.bibliographic.discourse_element import DiscourseElement 

24 from oc_ocdm.graph.entities.bibliographic.resource_embodiment import ResourceEmbodiment 

25from oc_ocdm.graph.entities.bibliographic_entity import BibliographicEntity 

26from oc_ocdm.graph.graph_entity import GraphEntity 

27 

28 

29class BibliographicResource(BibliographicEntity): 

30 """Bibliographic resource (short: br): a published bibliographic resource that cites/is 

31 cited by another published bibliographic resource.""" 

32 

33 def _merge_properties(self, other: GraphEntity, prefer_self: bool) -> None: 

34 """ 

35 The merge operation allows combining two `BibliographicResource` entities into a single one, 

36 by marking the second entity as to be deleted while also copying its data into the current 

37 `BibliographicResource`. Moreover, every triple from the containing `GraphSet` referring to the second 

38 entity gets "redirected" to the current entity: **every other reference contained inside a 

39 different source (e.g. a triplestore) must be manually handled by the user!** 

40 

41 In case of functional properties, values from the current entity get overwritten 

42 by those coming from the second entity while, in all other cases, values from the 

43 second entity are simply appended to those of the current entity. In this context, 

44 `rdfs:label` is considered as a functional property, while `rdf:type` is not. 

45 

46 :param other: The entity which will be marked as to be deleted and whose properties will 

47 be merged into the current entity. 

48 :type other: BibliographicResource 

49 :param prefer_self: If True, prefer values from the current entity for non-functional properties 

50 :type prefer_self: bool 

51 :raises TypeError: if the parameter is of the wrong type 

52 :return: None 

53 """ 

54 super()._merge_properties(other, prefer_self) 

55 assert isinstance(other, BibliographicResource) 

56 

57 title: Optional[str] = other.get_title() 

58 if title is not None: 

59 self.has_title(title) 

60 

61 subtitle: Optional[str] = other.get_subtitle() 

62 if subtitle is not None: 

63 self.has_subtitle(subtitle) 

64 

65 container: Optional[BibliographicResource] = other.get_is_part_of() 

66 if container is not None: 

67 self.is_part_of(container) 

68 

69 citations_list: List[BibliographicResource] = other.get_citations() 

70 if not (prefer_self and self.get_citations()): 

71 for cur_citation in citations_list: 

72 self.has_citation(cur_citation) 

73 

74 pub_date: Optional[str] = other.get_pub_date() 

75 if pub_date is not None: 

76 self.has_pub_date(pub_date) 

77 

78 re_list: List[ResourceEmbodiment] = other.get_formats() 

79 if not (prefer_self and self.get_formats()): 

80 for cur_format in re_list: 

81 self.has_format(cur_format) 

82 

83 number: Optional[str] = other.get_number() 

84 if number is not None: 

85 self.has_number(number) 

86 

87 edition: Optional[str] = other.get_edition() 

88 if edition is not None: 

89 self.has_edition(edition) 

90 

91 be_list: List[BibliographicReference] = other.get_contained_in_reference_lists() 

92 if not (prefer_self and self.get_contained_in_reference_lists()): 

93 for reference in be_list: 

94 self.contains_in_reference_list(reference) 

95 

96 de_list: List[DiscourseElement] = other.get_contained_discourse_elements() 

97 if not (prefer_self and self.get_contained_discourse_elements()): 

98 for discourse_element in de_list: 

99 self.contains_discourse_element(discourse_element) 

100 

101 ar_list: List[AgentRole] = other.get_contributors() 

102 if not (prefer_self and self.get_contributors()): 

103 for agent_role in ar_list: 

104 self.has_contributor(agent_role) 

105 

106 related_doc_list: List[str] = other.get_related_documents() 

107 if not (prefer_self and self.get_related_documents()): 

108 for doc in related_doc_list: 

109 self.has_related_document(doc) 

110 

111 # HAS TITLE 

112 def get_title(self) -> Optional[str]: 

113 """ 

114 Getter method corresponding to the ``dcterms:title`` RDF predicate. 

115 

116 :return: The requested value if found, None otherwise 

117 """ 

118 return self._get_literal(GraphEntity.iri_title) 

119 

120 def has_title(self, string: str) -> None: 

121 """ 

122 Setter method corresponding to the ``dcterms:title`` RDF predicate. 

123 

124 **WARNING: this is a functional property, hence any existing value will be overwritten!** 

125 

126 `The title of the bibliographic resource.` 

127 

128 :param string: The value that will be set as the object of the property related to this method 

129 :type string: str 

130 :raises TypeError: if the parameter is of the wrong type 

131 :return: None 

132 """ 

133 self.remove_title() 

134 self._create_literal(GraphEntity.iri_title, string) 

135 

136 def remove_title(self) -> None: 

137 """ 

138 Remover method corresponding to the ``dcterms:title`` RDF predicate. 

139 

140 :return: None 

141 """ 

142 self.g.remove((self.res, GraphEntity.iri_title, None)) 

143 

144 # HAS SUBTITLE 

145 def get_subtitle(self) -> Optional[str]: 

146 """ 

147 Getter method corresponding to the ``fabio:hasSubtitle`` RDF predicate. 

148 

149 :return: The requested value if found, None otherwise 

150 """ 

151 return self._get_literal(GraphEntity.iri_has_subtitle) 

152 

153 def has_subtitle(self, string: str) -> None: 

154 """ 

155 Setter method corresponding to the ``fabio:hasSubtitle`` RDF predicate. 

156 

157 **WARNING: this is a functional property, hence any existing value will be overwritten!** 

158 

159 `The subtitle of the bibliographic resource.` 

160 

161 :param string: The value that will be set as the object of the property related to this method 

162 :type string: str 

163 :raises TypeError: if the parameter is of the wrong type 

164 :return: None 

165 """ 

166 self.remove_subtitle() 

167 self._create_literal(GraphEntity.iri_has_subtitle, string) 

168 

169 def remove_subtitle(self) -> None: 

170 """ 

171 Remover method corresponding to the ``fabio:hasSubtitle`` RDF predicate. 

172 

173 :return: None 

174 """ 

175 self.g.remove((self.res, GraphEntity.iri_has_subtitle, None)) 

176 

177 # IS PART OF (BibliographicResource) 

178 def get_is_part_of(self) -> Optional[BibliographicResource]: 

179 """ 

180 Getter method corresponding to the ``frbr:partOf`` RDF predicate. 

181 

182 :return: The requested value if found, None otherwise 

183 """ 

184 uri: Optional[str] = self._get_uri_reference(GraphEntity.iri_part_of, 'br') 

185 if uri is not None: 

186 return self.g_set.add_br(self.resp_agent, self.source, uri) 

187 

188 @accepts_only('br') 

189 def is_part_of(self, br_res: BibliographicResource) -> None: 

190 """ 

191 Setter method corresponding to the ``frbr:partOf`` RDF predicate. 

192 

193 **WARNING: this is a functional property, hence any existing value will be overwritten!** 

194 

195 `The corpus identifier of the bibliographic resource (e.g. issue, volume, journal, 

196 conference proceedings) that contains the subject bibliographic resource.` 

197 

198 :param br_res: The value that will be set as the object of the property related to this method 

199 :type br_res: BibliographicResource 

200 :raises TypeError: if the parameter is of the wrong type 

201 :return: None 

202 """ 

203 self.remove_is_part_of() 

204 self.g.add((self.res, GraphEntity.iri_part_of, RDFTerm("uri", str(br_res.res)))) 

205 

206 def remove_is_part_of(self) -> None: 

207 """ 

208 Remover method corresponding to the ``frbr:partOf`` RDF predicate. 

209 

210 :return: None 

211 """ 

212 self.g.remove((self.res, GraphEntity.iri_part_of, None)) 

213 

214 # CITES (BibliographicResource) 

215 def get_citations(self) -> List[BibliographicResource]: 

216 """ 

217 Getter method corresponding to the ``cito:cites`` RDF predicate. 

218 

219 :return: A list containing the requested values if found, None otherwise 

220 """ 

221 uri_list: List[str] = self._get_multiple_uri_references(GraphEntity.iri_cites, 'br') 

222 result: List[BibliographicResource] = [] 

223 for uri in uri_list: 

224 result.append(self.g_set.add_br(self.resp_agent, self.source, uri)) 

225 return result 

226 

227 @accepts_only('br') 

228 def has_citation(self, br_res: BibliographicResource) -> None: 

229 """ 

230 Setter method corresponding to the ``cito:cites`` RDF predicate. 

231 

232 `The corpus identifier of the bibliographic resource cited by the subject bibliographic 

233 resource.` 

234 

235 :param br_res: The value that will be set as the object of the property related to this method 

236 :type br_res: BibliographicResource 

237 :raises TypeError: if the parameter is of the wrong type 

238 :return: None 

239 """ 

240 self.g.add((self.res, GraphEntity.iri_cites, RDFTerm("uri", str(br_res.res)))) 

241 

242 @accepts_only('br') 

243 def remove_citation(self, br_res: BibliographicResource | None = None) -> None: 

244 """ 

245 Remover method corresponding to the ``cito:cites`` RDF predicate. 

246 

247 **WARNING: this is a non-functional property, hence, if the parameter 

248 is None, any existing value will be removed!** 

249 

250 :param br_res: If not None, the specific object value that will be removed from the property 

251 related to this method (defaults to None) 

252 :type br_res: BibliographicResource 

253 :raises TypeError: if the parameter is of the wrong type 

254 :return: None 

255 """ 

256 if br_res is not None: 

257 self.g.remove((self.res, GraphEntity.iri_cites, RDFTerm("uri", str(br_res.res)))) 

258 else: 

259 self.g.remove((self.res, GraphEntity.iri_cites, None)) 

260 

261 # HAS PUBLICATION DATE 

262 def get_pub_date(self) -> Optional[str]: 

263 """ 

264 Getter method corresponding to the ``prism:publicationDate`` RDF predicate. 

265 

266 :return: The requested value if found, None otherwise 

267 """ 

268 return self._get_literal(GraphEntity.iri_has_publication_date) 

269 

270 def has_pub_date(self, string: str) -> None: 

271 """ 

272 Setter method corresponding to the ``prism:publicationDate`` RDF predicate. 

273 

274 **WARNING: this is a functional property, hence any existing value will be overwritten!** 

275 

276 `The date of publication of the bibliographic resource.` 

277 

278 :param string: The value that will be set as the object of the property related to this method. **It must 

279 be a string compliant with the** ``ISO 8601`` **standard.** 

280 :type string: str 

281 :raises TypeError: if the parameter is of the wrong type 

282 :return: None 

283 """ 

284 cur_type, string = get_datatype_from_iso_8601(string) 

285 if cur_type is not None and string is not None: 

286 self.remove_pub_date() 

287 self._create_literal(GraphEntity.iri_has_publication_date, string, cur_type, False) 

288 

289 def remove_pub_date(self) -> None: 

290 """ 

291 Remover method corresponding to the ``prism:publicationDate`` RDF predicate. 

292 

293 :return: None 

294 """ 

295 self.g.remove((self.res, GraphEntity.iri_has_publication_date, None)) 

296 

297 # IS EMBODIED AS (ResourceEmbodiment) 

298 def get_formats(self) -> List[ResourceEmbodiment]: 

299 """ 

300 Getter method corresponding to the ``frbr:embodiment`` RDF predicate. 

301 

302 :return: A list containing the requested values if found, None otherwise 

303 """ 

304 uri_list: List[str] = self._get_multiple_uri_references(GraphEntity.iri_embodiment, 're') 

305 result: List[ResourceEmbodiment] = [] 

306 for uri in uri_list: 

307 result.append(self.g_set.add_re(self.resp_agent, self.source, uri)) 

308 return result 

309 

310 @accepts_only('re') 

311 def has_format(self, re_res: ResourceEmbodiment) -> None: 

312 """ 

313 Setter method corresponding to the ``frbr:embodiment`` RDF predicate. 

314 

315 `The corpus identifier of the resource embodiment defining the format in which the 

316 bibliographic resource has been embodied, which can be either print or digital.` 

317 

318 :param re_res: The value that will be set as the object of the property related to this method 

319 :type re_res: ResourceEmbodiment 

320 :raises TypeError: if the parameter is of the wrong type 

321 :return: None 

322 """ 

323 self.g.add((self.res, GraphEntity.iri_embodiment, RDFTerm("uri", str(re_res.res)))) 

324 

325 @accepts_only('re') 

326 def remove_format(self, re_res: ResourceEmbodiment | None = None) -> None: 

327 """ 

328 Remover method corresponding to the ``frbr:embodiment`` RDF predicate. 

329 

330 **WARNING: this is a non-functional property, hence, if the parameter 

331 is None, any existing value will be removed!** 

332 

333 :param re_res: If not None, the specific object value that will be removed from the property 

334 related to this method (defaults to None) 

335 :type re_res: ResourceEmbodiment 

336 :raises TypeError: if the parameter is of the wrong type 

337 :return: None 

338 """ 

339 if re_res is not None: 

340 self.g.remove((self.res, GraphEntity.iri_embodiment, RDFTerm("uri", str(re_res.res)))) 

341 else: 

342 self.g.remove((self.res, GraphEntity.iri_embodiment, None)) 

343 

344 # HAS NUMBER 

345 def get_number(self) -> Optional[str]: 

346 """ 

347 Getter method corresponding to the ``fabio:hasSequenceIdentifier`` RDF predicate. 

348 

349 :return: The requested value if found, None otherwise 

350 """ 

351 return self._get_literal(GraphEntity.iri_has_sequence_identifier) 

352 

353 def has_number(self, string: str) -> None: 

354 """ 

355 Setter method corresponding to the ``fabio:hasSequenceIdentifier`` RDF predicate. 

356 

357 **WARNING: this is a functional property, hence any existing value will be overwritten!** 

358 

359 `A literal (for example a number or a letter) that identifies the sequence position of the 

360 bibliographic resource as a particular item within a larger collection (e.g. an article 

361 number within a journal issue, a volume number of a journal, a chapter number within 

362 a book).` 

363 

364 :param string: The value that will be set as the object of the property related to this method 

365 :type string: str 

366 :raises TypeError: if the parameter is of the wrong type 

367 :return: None 

368 """ 

369 self.remove_number() 

370 self._create_literal(GraphEntity.iri_has_sequence_identifier, string) 

371 

372 def remove_number(self) -> None: 

373 """ 

374 Remover method corresponding to the ``fabio:hasSequenceIdentifier`` RDF predicate. 

375 

376 :return: None 

377 """ 

378 self.g.remove((self.res, GraphEntity.iri_has_sequence_identifier, None)) 

379 

380 # HAS EDITION 

381 def get_edition(self) -> Optional[str]: 

382 """ 

383 Getter method corresponding to the ``prism:edition`` RDF predicate. 

384 

385 :return: The requested value if found, None otherwise 

386 """ 

387 return self._get_literal(GraphEntity.iri_has_edition) 

388 

389 def has_edition(self, string: str) -> None: 

390 """ 

391 Setter method corresponding to the ``prism:edition`` RDF predicate. 

392 

393 **WARNING: this is a functional property, hence any existing value will be overwritten!** 

394 

395 `An identifier for one of several alternative editions of a particular bibliographic 

396 resource.` 

397 

398 :param string: The value that will be set as the object of the property related to this method 

399 :type string: str 

400 :raises TypeError: if the parameter is of the wrong type 

401 :return: None 

402 """ 

403 self.remove_edition() 

404 self._create_literal(GraphEntity.iri_has_edition, string) 

405 

406 def remove_edition(self) -> None: 

407 """ 

408 Remover method corresponding to the ``prism:edition`` RDF predicate. 

409 

410 :return: None 

411 """ 

412 self.g.remove((self.res, GraphEntity.iri_has_edition, None)) 

413 

414 # HAS PART (BibliographicReference) 

415 def get_contained_in_reference_lists(self) -> List[BibliographicReference]: 

416 """ 

417 Getter method corresponding to the ``frbr:part`` RDF predicate. 

418 

419 :return: A list containing the requested values if found, None otherwise 

420 """ 

421 uri_list: List[str] = self._get_multiple_uri_references(GraphEntity.iri_contains_reference, 'be') 

422 result: List[BibliographicReference] = [] 

423 for uri in uri_list: 

424 result.append(self.g_set.add_be(self.resp_agent, self.source, uri)) 

425 return result 

426 

427 @accepts_only('be') 

428 def contains_in_reference_list(self, be_res: BibliographicReference) -> None: 

429 """ 

430 Setter method corresponding to the ``frbr:part`` RDF predicate. 

431 

432 `A bibliographic reference within the bibliographic resource, or a discourse element 

433 wherein the text of the bibliographic resources can be organized.` 

434 

435 :param be_res: The value that will be set as the object of the property related to this method 

436 :type be_res: BibliographicReference 

437 :raises TypeError: if the parameter is of the wrong type 

438 :return: None 

439 """ 

440 self.g.add((self.res, GraphEntity.iri_contains_reference, RDFTerm("uri", str(be_res.res)))) 

441 

442 @accepts_only('be') 

443 def remove_contained_in_reference_list(self, be_res: BibliographicReference | None = None) -> None: 

444 """ 

445 Remover method corresponding to the ``frbr:part`` RDF predicate. 

446 

447 **WARNING: this is a non-functional property, hence, if the parameter 

448 is None, any existing value will be removed!** 

449 

450 :param be_res: If not None, the specific object value that will be removed from the property 

451 related to this method (defaults to None) 

452 :type be_res: BibliographicReference 

453 :raises TypeError: if the parameter is of the wrong type 

454 :return: None 

455 """ 

456 if be_res is not None: 

457 self.g.remove((self.res, GraphEntity.iri_contains_reference, RDFTerm("uri", str(be_res.res)))) 

458 else: 

459 self.g.remove((self.res, GraphEntity.iri_contains_reference, None)) 

460 

461 # HAS PART (DiscourseElement) 

462 def get_contained_discourse_elements(self) -> List[DiscourseElement]: 

463 """ 

464 Getter method corresponding to the ``frbr:part`` RDF predicate. 

465 

466 :return: A list containing the requested values if found, None otherwise 

467 """ 

468 uri_list: List[str] = self._get_multiple_uri_references(GraphEntity.iri_contains_de, 'de') 

469 result: List[DiscourseElement] = [] 

470 for uri in uri_list: 

471 result.append(self.g_set.add_de(self.resp_agent, self.source, uri)) 

472 return result 

473 

474 @accepts_only('de') 

475 def contains_discourse_element(self, de_res: DiscourseElement) -> None: 

476 """ 

477 Setter method corresponding to the ``frbr:part`` RDF predicate. 

478 

479 `A bibliographic reference within the bibliographic resource, or a discourse element 

480 wherein the text of the bibliographic resources can be organized.` 

481 

482 :param de_res: The value that will be set as the object of the property related to this method 

483 :type de_res: DiscourseElement 

484 :raises TypeError: if the parameter is of the wrong type 

485 :return: None 

486 """ 

487 self.g.add((self.res, GraphEntity.iri_contains_de, RDFTerm("uri", str(de_res.res)))) 

488 

489 @accepts_only('de') 

490 def remove_contained_discourse_element(self, de_res: DiscourseElement | None = None) -> None: 

491 """ 

492 Remover method corresponding to the ``frbr:part`` RDF predicate. 

493 

494 **WARNING: this is a non-functional property, hence, if the parameter 

495 is None, any existing value will be removed!** 

496 

497 :param de_res: If not None, the specific object value that will be removed from the property 

498 related to this method (defaults to None) 

499 :type de_res: DiscourseElement 

500 :raises TypeError: if the parameter is of the wrong type 

501 :return: None 

502 """ 

503 if de_res is not None: 

504 self.g.remove((self.res, GraphEntity.iri_contains_de, RDFTerm("uri", str(de_res.res)))) 

505 else: 

506 self.g.remove((self.res, GraphEntity.iri_contains_de, None)) 

507 

508 # HAS CONTRIBUTOR (AgentRole) 

509 def get_contributors(self) -> List[AgentRole]: 

510 """ 

511 Getter method corresponding to the ``pro:isDocumentContextFor`` RDF predicate. 

512 

513 :return: A list containing the requested values if found, None otherwise 

514 """ 

515 uri_list: List[str] = self._get_multiple_uri_references(GraphEntity.iri_is_document_context_for, 'ar') 

516 result: List[AgentRole] = [] 

517 for uri in uri_list: 

518 result.append(self.g_set.add_ar(self.resp_agent, self.source, uri)) 

519 return result 

520 

521 @accepts_only('ar') 

522 def has_contributor(self, ar_res: AgentRole): 

523 """ 

524 Setter method corresponding to the ``pro:isDocumentContextFor`` RDF predicate. 

525 

526 :param ar_res: The value that will be set as the object of the property related to this method 

527 :type ar_res: AgentRole 

528 :raises TypeError: if the parameter is of the wrong type 

529 :return: None 

530 """ 

531 self.g.add((self.res, GraphEntity.iri_is_document_context_for, RDFTerm("uri", str(ar_res.res)))) 

532 

533 @accepts_only('ar') 

534 def remove_contributor(self, ar_res: AgentRole | None = None): 

535 """ 

536 Remover method corresponding to the ``frbr:part`` RDF predicate. 

537 

538 **WARNING: this is a non-functional property, hence, if the parameter 

539 is None, any existing value will be removed!** 

540 

541 :param ar_res: If not None, the specific object value that will be removed from the property 

542 related to this method (defaults to None) 

543 :type ar_res: AgentRole 

544 :raises TypeError: if the parameter is of the wrong type 

545 :return: None 

546 """ 

547 if ar_res is not None: 

548 self.g.remove((self.res, GraphEntity.iri_is_document_context_for, RDFTerm("uri", str(ar_res.res)))) 

549 else: 

550 self.g.remove((self.res, GraphEntity.iri_is_document_context_for, None)) 

551 

552 # HAS RELATED DOCUMENT 

553 def get_related_documents(self) -> List[str]: 

554 """ 

555 Getter method corresponding to the ``dcterms:relation`` RDF predicate. 

556 

557 :return: A list containing the requested values if found, None otherwise 

558 """ 

559 uri_list: List[str] = self._get_multiple_uri_references(GraphEntity.iri_relation) 

560 return uri_list 

561 

562 def has_related_document(self, thing_res: str) -> None: 

563 """ 

564 Setter method corresponding to the ``dcterms:relation`` RDF predicate. 

565 

566 `A document external to the Corpus, that is related to the bibliographic resource (such 

567 as a version of the bibliographic resource – for example a preprint – recorded in an 

568 external database).` 

569 

570 :param thing_res: The value that will be set as the object of the property related to this method 

571 :type thing_res: URIRef 

572 :raises TypeError: if the parameter is of the wrong type 

573 :return: None 

574 """ 

575 self.g.add((self.res, GraphEntity.iri_relation, RDFTerm("uri", str(thing_res)))) 

576 

577 def remove_related_document(self, thing_res: str | None = None) -> None: 

578 """ 

579 Remover method corresponding to the ``dcterms:relation`` RDF predicate. 

580 

581 **WARNING: this is a non-functional property, hence, if the parameter 

582 is None, any existing value will be removed!** 

583 

584 :param thing_res: If not None, the specific object value that will be removed from the property 

585 related to this method (defaults to None) 

586 :type thing_res: URIRef 

587 :raises TypeError: if the parameter is of the wrong type 

588 :return: None 

589 """ 

590 if thing_res is not None: 

591 self.g.remove((self.res, GraphEntity.iri_relation, RDFTerm("uri", str(thing_res)))) 

592 else: 

593 self.g.remove((self.res, GraphEntity.iri_relation, None)) 

594 

595 def create_abstract(self) -> None: 

596 """ 

597 Setter method corresponding to the ``rdf:type`` RDF predicate. 

598 It implicitly sets the object value ``doco:Abstract``. 

599 

600 **WARNING: the OCDM specification admits at most two types for an entity. 

601 The main type cannot be edited or removed. Any existing secondary type 

602 will be overwritten!** 

603 

604 `The type of the bibliographic resource` 

605 

606 :return: None 

607 """ 

608 self._create_type(GraphEntity.iri_abstract) 

609 

610 # HAS TYPE 

611 def create_archival_document(self) -> None: 

612 """ 

613 Setter method corresponding to the ``rdf:type`` RDF predicate. 

614 It implicitly sets the object value ``fabio:ArchivalDocument``. 

615 

616 **WARNING: the OCDM specification admits at most two types for an entity. 

617 The main type cannot be edited or removed. Any existing secondary type 

618 will be overwritten!** 

619 

620 `The type of the bibliographic resource` 

621 

622 :return: None 

623 """ 

624 self._create_type(GraphEntity.iri_archival_document) 

625 

626 def create_audio_document(self) -> None: 

627 """ 

628 Setter method corresponding to the ``rdf:type`` RDF predicate. 

629 It implicitly sets the object value ``fabio:AudioDocument``. 

630 

631 **WARNING: the OCDM specification admits at most two types for an entity. 

632 The main type cannot be edited or removed. Any existing secondary type 

633 will be overwritten!** 

634 

635 `The type of the bibliographic resource` 

636 

637 :return: None 

638 """ 

639 self._create_type(GraphEntity.iri_audio_document) 

640 

641 def create_book(self) -> None: 

642 """ 

643 Setter method corresponding to the ``rdf:type`` RDF predicate. 

644 It implicitly sets the object value ``fabio:Book``. 

645 

646 **WARNING: the OCDM specification admits at most two types for an entity. 

647 The main type cannot be edited or removed. Any existing secondary type 

648 will be overwritten!** 

649 

650 `The type of the bibliographic resource` 

651 

652 :return: None 

653 """ 

654 self._create_type(GraphEntity.iri_book) 

655 

656 def create_book_chapter(self) -> None: 

657 """ 

658 Setter method corresponding to the ``rdf:type`` RDF predicate. 

659 It implicitly sets the object value ``fabio:BookChapter``. 

660 

661 **WARNING: the OCDM specification admits at most two types for an entity. 

662 The main type cannot be edited or removed. Any existing secondary type 

663 will be overwritten!** 

664 

665 `The type of the bibliographic resource` 

666 

667 :return: None 

668 """ 

669 self._create_type(GraphEntity.iri_book_chapter) 

670 

671 def create_book_part(self) -> None: 

672 """ 

673 Setter method corresponding to the ``rdf:type`` RDF predicate. 

674 It implicitly sets the object value ``doco:Part``. 

675 

676 **WARNING: the OCDM specification admits at most two types for an entity. 

677 The main type cannot be edited or removed. Any existing secondary type 

678 will be overwritten!** 

679 

680 `The type of the bibliographic resource` 

681 

682 :return: None 

683 """ 

684 self._create_type(GraphEntity.iri_part) 

685 

686 def create_book_section(self) -> None: 

687 """ 

688 Setter method corresponding to the ``rdf:type`` RDF predicate. 

689 It implicitly sets the object value ``fabio:ExpressionCollection``. 

690 

691 **WARNING: the OCDM specification admits at most two types for an entity. 

692 The main type cannot be edited or removed. Any existing secondary type 

693 will be overwritten!** 

694 

695 `The type of the bibliographic resource` 

696 

697 :return: None 

698 """ 

699 self._create_type(GraphEntity.iri_expression_collection) 

700 

701 def create_book_series(self) -> None: 

702 """ 

703 Setter method corresponding to the ``rdf:type`` RDF predicate. 

704 It implicitly sets the object value ``fabio:BookSeries``. 

705 

706 **WARNING: the OCDM specification admits at most two types for an entity. 

707 The main type cannot be edited or removed. Any existing secondary type 

708 will be overwritten!** 

709 

710 `The type of the bibliographic resource` 

711 

712 :return: None 

713 """ 

714 self._create_type(GraphEntity.iri_book_series) 

715 

716 def create_book_set(self) -> None: 

717 """ 

718 Setter method corresponding to the ``rdf:type`` RDF predicate. 

719 It implicitly sets the object value ``fabio:BookSet``. 

720 

721 **WARNING: the OCDM specification admits at most two types for an entity. 

722 The main type cannot be edited or removed. Any existing secondary type 

723 will be overwritten!** 

724 

725 `The type of the bibliographic resource` 

726 

727 :return: None 

728 """ 

729 self._create_type(GraphEntity.iri_book_set) 

730 

731 def create_book_track(self) -> None: 

732 """ 

733 Setter method corresponding to the ``rdf:type`` RDF predicate. 

734 It implicitly sets the object value ``fabio:Expression``. 

735 

736 **WARNING: the OCDM specification admits at most two types for an entity. 

737 The main type cannot be edited or removed. Any existing secondary type 

738 will be overwritten!** 

739 

740 `The type of the bibliographic resource` 

741 

742 :return: None 

743 """ 

744 self._create_type(GraphEntity.iri_expression) 

745 

746 def create_component(self) -> None: 

747 """ 

748 Setter method corresponding to the ``rdf:type`` RDF predicate. 

749 It implicitly sets the object value ``fabio:Expression``. 

750 

751 **WARNING: the OCDM specification admits at most two types for an entity. 

752 The main type cannot be edited or removed. Any existing secondary type 

753 will be overwritten!** 

754 

755 `The type of the bibliographic resource` 

756 

757 :return: None 

758 """ 

759 self._create_type(GraphEntity.iri_expression) 

760 

761 def create_computer_program(self) -> None: 

762 """ 

763 Setter method corresponding to the ``rdf:type`` RDF predicate. 

764 It implicitly sets the object value ``fabio:ComputerProgram``. 

765 

766 **WARNING: the OCDM specification admits at most two types for an entity. 

767 The main type cannot be edited or removed. Any existing secondary type 

768 will be overwritten!** 

769 

770 `The type of the bibliographic resource` 

771 

772 :return: None 

773 """ 

774 self._create_type(GraphEntity.iri_computer_program) 

775 

776 def create_data_management_plan(self) -> None: 

777 """ 

778 Setter method corresponding to the ``rdf:type`` RDF predicate. 

779 It implicitly sets the object value ``fabio:DataManagementPlan``. 

780 

781 **WARNING: the OCDM specification admits at most two types for an entity. 

782 The main type cannot be edited or removed. Any existing secondary type 

783 will be overwritten!** 

784 

785 `The type of the bibliographic resource` 

786 

787 :return: None 

788 """ 

789 self._create_type(GraphEntity.iri_data_management_plan) 

790 

791 def create_dataset(self) -> None: 

792 """ 

793 Setter method corresponding to the ``rdf:type`` RDF predicate. 

794 It implicitly sets the object value ``fabio:DataFile``. 

795 

796 **WARNING: the OCDM specification admits at most two types for an entity. 

797 The main type cannot be edited or removed. Any existing secondary type 

798 will be overwritten!** 

799 

800 `The type of the bibliographic resource` 

801 

802 :return: None 

803 """ 

804 self._create_type(GraphEntity.iri_data_file) 

805 

806 def create_dissertation(self) -> None: 

807 """ 

808 Setter method corresponding to the ``rdf:type`` RDF predicate. 

809 It implicitly sets the object value ``fabio:Thesis``. 

810 

811 **WARNING: the OCDM specification admits at most two types for an entity. 

812 The main type cannot be edited or removed. Any existing secondary type 

813 will be overwritten!** 

814 

815 `The type of the bibliographic resource` 

816 

817 :return: None 

818 """ 

819 self._create_type(GraphEntity.iri_thesis) 

820 

821 def create_edited_book(self) -> None: 

822 """ 

823 Setter method corresponding to the ``rdf:type`` RDF predicate. 

824 It implicitly sets the object value ``fabio:Book``. 

825 

826 **WARNING: the OCDM specification admits at most two types for an entity. 

827 The main type cannot be edited or removed. Any existing secondary type 

828 will be overwritten!** 

829 

830 `The type of the bibliographic resource` 

831 

832 :return: None 

833 """ 

834 self._create_type(GraphEntity.iri_book) 

835 

836 def create_editorial(self) -> None: 

837 """ 

838 Setter method corresponding to the ``rdf:type`` RDF predicate. 

839 It implicitly sets the object value ``fabio:Editorial``. 

840 

841 **WARNING: the OCDM specification admits at most two types for an entity. 

842 The main type cannot be edited or removed. Any existing secondary type 

843 will be overwritten!** 

844 

845 `The type of the bibliographic resource` 

846 

847 :return: None 

848 """ 

849 self._create_type(GraphEntity.iri_editorial) 

850 

851 def create_journal_article(self) -> None: 

852 """ 

853 Setter method corresponding to the ``rdf:type`` RDF predicate. 

854 It implicitly sets the object value ``fabio:JournalArticle``. 

855 

856 **WARNING: the OCDM specification admits at most two types for an entity. 

857 The main type cannot be edited or removed. Any existing secondary type 

858 will be overwritten!** 

859 

860 `The type of the bibliographic resource` 

861 

862 :return: None 

863 """ 

864 self._create_type(GraphEntity.iri_journal_article) 

865 

866 def create_journal_editorial(self) -> None: 

867 """ 

868 Setter method corresponding to the ``rdf:type`` RDF predicate. 

869 It implicitly sets the object value ``fabio:JournalEditorial``. 

870 

871 **WARNING: the OCDM specification admits at most two types for an entity. 

872 The main type cannot be edited or removed. Any existing secondary type 

873 will be overwritten!** 

874 

875 `The type of the bibliographic resource` 

876 

877 :return: None 

878 """ 

879 self._create_type(GraphEntity.iri_journal_editorial) 

880 

881 def create_issue(self) -> None: 

882 """ 

883 Setter method corresponding to the ``rdf:type`` RDF predicate. 

884 It implicitly sets the object value ``fabio:JournalIssue``. 

885 

886 **WARNING: the OCDM specification admits at most two types for an entity. 

887 The main type cannot be edited or removed. Any existing secondary type 

888 will be overwritten!** 

889 

890 `The type of the bibliographic resource` 

891 

892 :return: None 

893 """ 

894 self._create_type(GraphEntity.iri_journal_issue) 

895 

896 def create_volume(self) -> None: 

897 """ 

898 Setter method corresponding to the ``rdf:type`` RDF predicate. 

899 It implicitly sets the object value ``fabio:JournalVolume``. 

900 

901 **WARNING: the OCDM specification admits at most two types for an entity. 

902 The main type cannot be edited or removed. Any existing secondary type 

903 will be overwritten!** 

904 

905 `The type of the bibliographic resource` 

906 

907 :return: None 

908 """ 

909 self._create_type(GraphEntity.iri_journal_volume) 

910 

911 def create_journal(self) -> None: 

912 """ 

913 Setter method corresponding to the ``rdf:type`` RDF predicate. 

914 It implicitly sets the object value ``fabio:Journal``. 

915 

916 **WARNING: the OCDM specification admits at most two types for an entity. 

917 The main type cannot be edited or removed. Any existing secondary type 

918 will be overwritten!** 

919 

920 `The type of the bibliographic resource` 

921 

922 :return: None 

923 """ 

924 self._create_type(GraphEntity.iri_journal) 

925 

926 def create_monograph(self) -> None: 

927 """ 

928 Setter method corresponding to the ``rdf:type`` RDF predicate. 

929 It implicitly sets the object value ``fabio:Book``. 

930 

931 **WARNING: the OCDM specification admits at most two types for an entity. 

932 The main type cannot be edited or removed. Any existing secondary type 

933 will be overwritten!** 

934 

935 `The type of the bibliographic resource` 

936 

937 :return: None 

938 """ 

939 self._create_type(GraphEntity.iri_book) 

940 

941 def create_newspaper(self) -> None: 

942 """ 

943 Setter method corresponding to the ``rdf:type`` RDF predicate. 

944 It implicitly sets the object value ``fabio:Newspaper``. 

945 

946 **WARNING: the OCDM specification admits at most two types for an entity. 

947 The main type cannot be edited or removed. Any existing secondary type 

948 will be overwritten!** 

949 

950 `The type of the bibliographic resource` 

951 

952 :return: None 

953 """ 

954 self._create_type(GraphEntity.iri_newspaper) 

955 

956 def create_newspaper_article(self) -> None: 

957 """ 

958 Setter method corresponding to the ``rdf:type`` RDF predicate. 

959 It implicitly sets the object value ``fabio:NewspaperArticle``. 

960 

961 **WARNING: the OCDM specification admits at most two types for an entity. 

962 The main type cannot be edited or removed. Any existing secondary type 

963 will be overwritten!** 

964 

965 `The type of the bibliographic resource` 

966 

967 :return: None 

968 """ 

969 self._create_type(GraphEntity.iri_newspaper_article) 

970 

971 def create_newspaper_editorial(self) -> None: 

972 """ 

973 Setter method corresponding to the ``rdf:type`` RDF predicate. 

974 It implicitly sets the object value ``fabio:NewspaperEditorial``. 

975 

976 **WARNING: the OCDM specification admits at most two types for an entity. 

977 The main type cannot be edited or removed. Any existing secondary type 

978 will be overwritten!** 

979 

980 `The type of the bibliographic resource` 

981 

982 :return: None 

983 """ 

984 self._create_type(GraphEntity.iri_newspaper_editorial) 

985 

986 def create_newspaper_issue(self) -> None: 

987 """ 

988 Setter method corresponding to the ``rdf:type`` RDF predicate. 

989 It implicitly sets the object value ``fabio:NewspaperIssue``. 

990 

991 **WARNING: the OCDM specification admits at most two types for an entity. 

992 The main type cannot be edited or removed. Any existing secondary type 

993 will be overwritten!** 

994 

995 `The type of the bibliographic resource` 

996 

997 :return: None 

998 """ 

999 self._create_type(GraphEntity.iri_newspaper_issue) 

1000 

1001 def create_peer_review(self) -> None: 

1002 """ 

1003 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1004 It implicitly sets the object value ``fr:ReviewVersion``. 

1005 

1006 **WARNING: the OCDM specification admits at most two types for an entity. 

1007 The main type cannot be edited or removed. Any existing secondary type 

1008 will be overwritten!** 

1009 

1010 `The type of the bibliographic resource` 

1011 

1012 :return: None 

1013 """ 

1014 self._create_type(GraphEntity.iri_peer_review) 

1015 

1016 def create_preprint(self) -> None: 

1017 """ 

1018 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1019 It implicitly sets the object value ``fabio:Preprint``. 

1020 

1021 **WARNING: the OCDM specification admits at most two types for an entity. 

1022 The main type cannot be edited or removed. Any existing secondary type 

1023 will be overwritten!** 

1024 

1025 `The type of the bibliographic resource` 

1026 

1027 :return: None 

1028 """ 

1029 self._create_type(GraphEntity.iri_preprint) 

1030 

1031 def create_presentation(self) -> None: 

1032 """ 

1033 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1034 It implicitly sets the object value ``fabio:Presentation``. 

1035 

1036 **WARNING: the OCDM specification admits at most two types for an entity. 

1037 The main type cannot be edited or removed. Any existing secondary type 

1038 will be overwritten!** 

1039 

1040 `The type of the bibliographic resource` 

1041 

1042 :return: None 

1043 """ 

1044 self._create_type(GraphEntity.iri_presentation) 

1045 

1046 def create_proceedings_article(self) -> None: 

1047 """ 

1048 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1049 It implicitly sets the object value ``fabio:ProceedingsPaper``. 

1050 

1051 **WARNING: the OCDM specification admits at most two types for an entity. 

1052 The main type cannot be edited or removed. Any existing secondary type 

1053 will be overwritten!** 

1054 

1055 `The type of the bibliographic resource` 

1056 

1057 :return: None 

1058 """ 

1059 self._create_type(GraphEntity.iri_proceedings_paper) 

1060 

1061 def create_proceedings(self) -> None: 

1062 """ 

1063 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1064 It implicitly sets the object value ``fabio:AcademicProceedings``. 

1065 

1066 **WARNING: the OCDM specification admits at most two types for an entity. 

1067 The main type cannot be edited or removed. Any existing secondary type 

1068 will be overwritten!** 

1069 

1070 `The type of the bibliographic resource` 

1071 

1072 :return: None 

1073 """ 

1074 self._create_type(GraphEntity.iri_academic_proceedings) 

1075 

1076 def create_proceedings_series(self) -> None: 

1077 """ 

1078 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1079 It implicitly sets the object value ``fabio:Series``. 

1080 

1081 **WARNING: the OCDM specification admits at most two types for an entity. 

1082 The main type cannot be edited or removed. Any existing secondary type 

1083 will be overwritten!** 

1084 

1085 `The type of the bibliographic resource` 

1086 

1087 :return: None 

1088 """ 

1089 self._create_type(GraphEntity.iri_proceedings_series) 

1090 

1091 def create_reference_book(self) -> None: 

1092 """ 

1093 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1094 It implicitly sets the object value ``fabio:ReferenceBook``. 

1095 

1096 **WARNING: the OCDM specification admits at most two types for an entity. 

1097 The main type cannot be edited or removed. Any existing secondary type 

1098 will be overwritten!** 

1099 

1100 `The type of the bibliographic resource` 

1101 

1102 :return: None 

1103 """ 

1104 self._create_type(GraphEntity.iri_reference_book) 

1105 

1106 def create_reference_entry(self) -> None: 

1107 """ 

1108 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1109 It implicitly sets the object value ``fabio:ReferenceEntry``. 

1110 

1111 **WARNING: the OCDM specification admits at most two types for an entity. 

1112 The main type cannot be edited or removed. Any existing secondary type 

1113 will be overwritten!** 

1114 

1115 `The type of the bibliographic resource` 

1116 

1117 :return: None 

1118 """ 

1119 self._create_type(GraphEntity.iri_reference_entry) 

1120 

1121 def create_report_series(self) -> None: 

1122 """ 

1123 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1124 It implicitly sets the object value ``fabio:Series``. 

1125 

1126 **WARNING: the OCDM specification admits at most two types for an entity. 

1127 The main type cannot be edited or removed. Any existing secondary type 

1128 will be overwritten!** 

1129 

1130 `The type of the bibliographic resource` 

1131 

1132 :return: None 

1133 """ 

1134 self._create_type(GraphEntity.iri_series) 

1135 

1136 def create_report(self) -> None: 

1137 """ 

1138 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1139 It implicitly sets the object value ``fabio:ReportDocument``. 

1140 

1141 **WARNING: the OCDM specification admits at most two types for an entity. 

1142 The main type cannot be edited or removed. Any existing secondary type 

1143 will be overwritten!** 

1144 

1145 `The type of the bibliographic resource` 

1146 

1147 :return: None 

1148 """ 

1149 self._create_type(GraphEntity.iri_report_document) 

1150 

1151 def create_retraction_notice(self) -> None: 

1152 """ 

1153 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1154 It implicitly sets the object value ``fabio:RetractionNotice``. 

1155 

1156 **WARNING: the OCDM specification admits at most two types for an entity. 

1157 The main type cannot be edited or removed. Any existing secondary type 

1158 will be overwritten!** 

1159 

1160 `The type of the bibliographic resource` 

1161 

1162 :return: None 

1163 """ 

1164 self._create_type(GraphEntity.iri_retraction_notice) 

1165 

1166 def create_standard_series(self) -> None: 

1167 """ 

1168 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1169 It implicitly sets the object value ``fabio:Series``. 

1170 

1171 **WARNING: the OCDM specification admits at most two types for an entity. 

1172 The main type cannot be edited or removed. Any existing secondary type 

1173 will be overwritten!** 

1174 

1175 `The type of the bibliographic resource` 

1176 

1177 :return: None 

1178 """ 

1179 self._create_type(GraphEntity.iri_series) 

1180 

1181 def create_standard(self) -> None: 

1182 """ 

1183 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1184 It implicitly sets the object value ``fabio:SpecificationDocument``. 

1185 

1186 **WARNING: the OCDM specification admits at most two types for an entity. 

1187 The main type cannot be edited or removed. Any existing secondary type 

1188 will be overwritten!** 

1189 

1190 `The type of the bibliographic resource` 

1191 

1192 :return: None 

1193 """ 

1194 self._create_type(GraphEntity.iri_specification_document) 

1195 

1196 def create_series(self) -> None: 

1197 """ 

1198 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1199 It implicitly sets the object value ``fabio:Series``. 

1200 

1201 **WARNING: the OCDM specification admits at most two types for an entity. 

1202 The main type cannot be edited or removed. Any existing secondary type 

1203 will be overwritten!** 

1204 

1205 `The type of the bibliographic resource` 

1206 

1207 :return: None 

1208 """ 

1209 self._create_type(GraphEntity.iri_series) 

1210 

1211 def create_expression_collection(self) -> None: 

1212 """ 

1213 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1214 It implicitly sets the object value ``fabio:ExpressionCollection``. 

1215 

1216 **WARNING: the OCDM specification admits at most two types for an entity. 

1217 The main type cannot be edited or removed. Any existing secondary type 

1218 will be overwritten!** 

1219 

1220 `The type of the bibliographic resource` 

1221 

1222 :return: None 

1223 """ 

1224 self._create_type(GraphEntity.iri_expression_collection) 

1225 

1226 def create_web_content(self) -> None: 

1227 """ 

1228 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1229 It implicitly sets the object value ``fabio:WebContent``. 

1230 

1231 **WARNING: the OCDM specification admits at most two types for an entity. 

1232 The main type cannot be edited or removed. Any existing secondary type 

1233 will be overwritten!** 

1234 

1235 `The type of the bibliographic resource` 

1236 

1237 :return: None 

1238 """ 

1239 self._create_type(GraphEntity.iri_web_content) 

1240 

1241 def create_other(self) -> None: 

1242 """ 

1243 Setter method corresponding to the ``rdf:type`` RDF predicate. 

1244 It implicitly sets the object value ``fabio:Expression``. 

1245 

1246 **WARNING: the OCDM specification admits at most two types for an entity. 

1247 The main type cannot be edited or removed. Any existing secondary type 

1248 will be overwritten!** 

1249 

1250 `The type of the bibliographic resource` 

1251 

1252 :return: None 

1253 """ 

1254 self._create_type(GraphEntity.iri_expression)