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

260 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-07-06 20:05 +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 By default, functional values from the current entity get overwritten by values 

42 from the second entity. When ``prefer_self`` is True, existing functional values 

43 from the current entity are kept. Non-functional values from the second entity 

44 are appended to those of the current entity. In this context, 

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

46 

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

48 be merged into the current entity. 

49 :type other: BibliographicResource 

50 :param prefer_self: If True, keep existing functional values from the current entity 

51 :type prefer_self: bool 

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

53 :return: None 

54 """ 

55 super()._merge_properties(other, prefer_self) 

56 assert isinstance(other, BibliographicResource) 

57 

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

59 if title is not None and self._should_merge_functional_property(self.get_title(), prefer_self): 

60 self.has_title(title) 

61 

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

63 if subtitle is not None and self._should_merge_functional_property(self.get_subtitle(), prefer_self): 

64 self.has_subtitle(subtitle) 

65 

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

67 if container is not None and self._should_merge_functional_property(self.get_is_part_of(), prefer_self): 

68 self.is_part_of(container) 

69 

70 citations_list: List[BibliographicResource] = other.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 and self._should_merge_functional_property(self.get_pub_date(), prefer_self): 

76 self.has_pub_date(pub_date) 

77 

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

79 for cur_format in re_list: 

80 self.has_format(cur_format) 

81 

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

83 if number is not None and self._should_merge_functional_property(self.get_number(), prefer_self): 

84 self.has_number(number) 

85 

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

87 if edition is not None and self._should_merge_functional_property(self.get_edition(), prefer_self): 

88 self.has_edition(edition) 

89 

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

91 for reference in be_list: 

92 self.contains_in_reference_list(reference) 

93 

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

95 for discourse_element in de_list: 

96 self.contains_discourse_element(discourse_element) 

97 

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

99 for agent_role in ar_list: 

100 self.has_contributor(agent_role) 

101 

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

103 for doc in related_doc_list: 

104 self.has_related_document(doc) 

105 

106 # HAS TITLE 

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

108 """ 

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

110 

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

112 """ 

113 return self._get_literal(GraphEntity.iri_title) 

114 

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

116 """ 

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

118 

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

120 

121 `The title of the bibliographic resource.` 

122 

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

124 :type string: str 

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

126 :return: None 

127 """ 

128 self.remove_title() 

129 self._create_literal(GraphEntity.iri_title, string) 

130 

131 def remove_title(self) -> None: 

132 """ 

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

134 

135 :return: None 

136 """ 

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

138 

139 # HAS SUBTITLE 

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

141 """ 

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

143 

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

145 """ 

146 return self._get_literal(GraphEntity.iri_has_subtitle) 

147 

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

149 """ 

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

151 

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

153 

154 `The subtitle of the bibliographic resource.` 

155 

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

157 :type string: str 

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

159 :return: None 

160 """ 

161 self.remove_subtitle() 

162 self._create_literal(GraphEntity.iri_has_subtitle, string) 

163 

164 def remove_subtitle(self) -> None: 

165 """ 

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

167 

168 :return: None 

169 """ 

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

171 

172 # IS PART OF (BibliographicResource) 

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

174 """ 

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

176 

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

178 """ 

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

180 if uri is not None: 

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

182 

183 @accepts_only("br") 

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

185 """ 

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

187 

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

189 

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

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

192 

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

194 :type br_res: BibliographicResource 

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

196 :return: None 

197 """ 

198 self.remove_is_part_of() 

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

200 

201 def remove_is_part_of(self) -> None: 

202 """ 

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

204 

205 :return: None 

206 """ 

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

208 

209 # CITES (BibliographicResource) 

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

211 """ 

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

213 

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

215 """ 

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

217 result: List[BibliographicResource] = [] 

218 for uri in uri_list: 

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

220 return result 

221 

222 @accepts_only("br") 

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

224 """ 

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

226 

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

228 resource.` 

229 

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

231 :type br_res: BibliographicResource 

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

233 :return: None 

234 """ 

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

236 

237 @accepts_only("br") 

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

239 """ 

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

241 

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

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

244 

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

246 related to this method (defaults to None) 

247 :type br_res: BibliographicResource 

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

249 :return: None 

250 """ 

251 if br_res is not None: 

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

253 else: 

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

255 

256 # HAS PUBLICATION DATE 

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

258 """ 

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

260 

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

262 """ 

263 return self._get_literal(GraphEntity.iri_has_publication_date) 

264 

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

266 """ 

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

268 

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

270 

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

272 

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

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

275 :type string: str 

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

277 :return: None 

278 """ 

279 cur_type, string = get_datatype_from_iso_8601(string) 

280 self.remove_pub_date() 

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

282 

283 def remove_pub_date(self) -> None: 

284 """ 

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

286 

287 :return: None 

288 """ 

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

290 

291 # IS EMBODIED AS (ResourceEmbodiment) 

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

293 """ 

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

295 

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

297 """ 

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

299 result: List[ResourceEmbodiment] = [] 

300 for uri in uri_list: 

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

302 return result 

303 

304 @accepts_only("re") 

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

306 """ 

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

308 

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

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

311 

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

313 :type re_res: ResourceEmbodiment 

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

315 :return: None 

316 """ 

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

318 

319 @accepts_only("re") 

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

321 """ 

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

323 

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

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

326 

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

328 related to this method (defaults to None) 

329 :type re_res: ResourceEmbodiment 

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

331 :return: None 

332 """ 

333 if re_res is not None: 

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

335 else: 

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

337 

338 # HAS NUMBER 

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

340 """ 

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

342 

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

344 """ 

345 return self._get_literal(GraphEntity.iri_has_sequence_identifier) 

346 

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

348 """ 

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

350 

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

352 

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

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

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

356 a book).` 

357 

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

359 :type string: str 

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

361 :return: None 

362 """ 

363 self.remove_number() 

364 self._create_literal(GraphEntity.iri_has_sequence_identifier, string) 

365 

366 def remove_number(self) -> None: 

367 """ 

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

369 

370 :return: None 

371 """ 

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

373 

374 # HAS EDITION 

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

376 """ 

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

378 

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

380 """ 

381 return self._get_literal(GraphEntity.iri_has_edition) 

382 

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

384 """ 

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

386 

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

388 

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

390 resource.` 

391 

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

393 :type string: str 

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

395 :return: None 

396 """ 

397 self.remove_edition() 

398 self._create_literal(GraphEntity.iri_has_edition, string) 

399 

400 def remove_edition(self) -> None: 

401 """ 

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

403 

404 :return: None 

405 """ 

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

407 

408 # HAS PART (BibliographicReference) 

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

410 """ 

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

412 

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

414 """ 

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

416 result: List[BibliographicReference] = [] 

417 for uri in uri_list: 

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

419 return result 

420 

421 @accepts_only("be") 

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

423 """ 

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

425 

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

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

428 

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

430 :type be_res: BibliographicReference 

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

432 :return: None 

433 """ 

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

435 

436 @accepts_only("be") 

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

438 """ 

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

440 

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

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

443 

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

445 related to this method (defaults to None) 

446 :type be_res: BibliographicReference 

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

448 :return: None 

449 """ 

450 if be_res is not None: 

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

452 else: 

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

454 

455 # HAS PART (DiscourseElement) 

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

457 """ 

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

459 

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

461 """ 

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

463 result: List[DiscourseElement] = [] 

464 for uri in uri_list: 

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

466 return result 

467 

468 @accepts_only("de") 

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

470 """ 

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

472 

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

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

475 

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

477 :type de_res: DiscourseElement 

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

479 :return: None 

480 """ 

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

482 

483 @accepts_only("de") 

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

485 """ 

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

487 

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

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

490 

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

492 related to this method (defaults to None) 

493 :type de_res: DiscourseElement 

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

495 :return: None 

496 """ 

497 if de_res is not None: 

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

499 else: 

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

501 

502 # HAS CONTRIBUTOR (AgentRole) 

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

504 """ 

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

506 

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

508 """ 

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

510 result: List[AgentRole] = [] 

511 for uri in uri_list: 

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

513 return result 

514 

515 @accepts_only("ar") 

516 def has_contributor(self, ar_res: AgentRole): 

517 """ 

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

519 

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

521 :type ar_res: AgentRole 

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

523 :return: None 

524 """ 

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

526 

527 @accepts_only("ar") 

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

529 """ 

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

531 

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

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

534 

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

536 related to this method (defaults to None) 

537 :type ar_res: AgentRole 

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

539 :return: None 

540 """ 

541 if ar_res is not None: 

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

543 else: 

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

545 

546 # HAS RELATED DOCUMENT 

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

548 """ 

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

550 

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

552 """ 

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

554 return uri_list 

555 

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

557 """ 

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

559 

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

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

562 external database).` 

563 

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

565 :type thing_res: URIRef 

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

567 :return: None 

568 """ 

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

570 

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

572 """ 

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

574 

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

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

577 

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

579 related to this method (defaults to None) 

580 :type thing_res: URIRef 

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

582 :return: None 

583 """ 

584 if thing_res is not None: 

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

586 else: 

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

588 

589 def create_abstract(self) -> None: 

590 """ 

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

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

593 

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

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

596 will be overwritten!** 

597 

598 `The type of the bibliographic resource` 

599 

600 :return: None 

601 """ 

602 self._create_type(GraphEntity.iri_abstract) 

603 

604 # HAS TYPE 

605 def create_archival_document(self) -> None: 

606 """ 

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

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

609 

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

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

612 will be overwritten!** 

613 

614 `The type of the bibliographic resource` 

615 

616 :return: None 

617 """ 

618 self._create_type(GraphEntity.iri_archival_document) 

619 

620 def create_audio_document(self) -> None: 

621 """ 

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

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

624 

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

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

627 will be overwritten!** 

628 

629 `The type of the bibliographic resource` 

630 

631 :return: None 

632 """ 

633 self._create_type(GraphEntity.iri_audio_document) 

634 

635 def create_book(self) -> None: 

636 """ 

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

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

639 

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

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

642 will be overwritten!** 

643 

644 `The type of the bibliographic resource` 

645 

646 :return: None 

647 """ 

648 self._create_type(GraphEntity.iri_book) 

649 

650 def create_book_chapter(self) -> None: 

651 """ 

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

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

654 

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

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

657 will be overwritten!** 

658 

659 `The type of the bibliographic resource` 

660 

661 :return: None 

662 """ 

663 self._create_type(GraphEntity.iri_book_chapter) 

664 

665 def create_book_part(self) -> None: 

666 """ 

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

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

669 

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

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

672 will be overwritten!** 

673 

674 `The type of the bibliographic resource` 

675 

676 :return: None 

677 """ 

678 self._create_type(GraphEntity.iri_part) 

679 

680 def create_book_section(self) -> None: 

681 """ 

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

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

684 

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

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

687 will be overwritten!** 

688 

689 `The type of the bibliographic resource` 

690 

691 :return: None 

692 """ 

693 self._create_type(GraphEntity.iri_expression_collection) 

694 

695 def create_book_series(self) -> None: 

696 """ 

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

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

699 

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

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

702 will be overwritten!** 

703 

704 `The type of the bibliographic resource` 

705 

706 :return: None 

707 """ 

708 self._create_type(GraphEntity.iri_book_series) 

709 

710 def create_book_set(self) -> None: 

711 """ 

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

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

714 

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

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

717 will be overwritten!** 

718 

719 `The type of the bibliographic resource` 

720 

721 :return: None 

722 """ 

723 self._create_type(GraphEntity.iri_book_set) 

724 

725 def create_book_track(self) -> None: 

726 """ 

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

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

729 

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

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

732 will be overwritten!** 

733 

734 `The type of the bibliographic resource` 

735 

736 :return: None 

737 """ 

738 self._create_type(GraphEntity.iri_expression) 

739 

740 def create_component(self) -> None: 

741 """ 

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

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

744 

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

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

747 will be overwritten!** 

748 

749 `The type of the bibliographic resource` 

750 

751 :return: None 

752 """ 

753 self._create_type(GraphEntity.iri_expression) 

754 

755 def create_computer_program(self) -> None: 

756 """ 

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

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

759 

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

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

762 will be overwritten!** 

763 

764 `The type of the bibliographic resource` 

765 

766 :return: None 

767 """ 

768 self._create_type(GraphEntity.iri_computer_program) 

769 

770 def create_data_management_plan(self) -> None: 

771 """ 

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

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

774 

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

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

777 will be overwritten!** 

778 

779 `The type of the bibliographic resource` 

780 

781 :return: None 

782 """ 

783 self._create_type(GraphEntity.iri_data_management_plan) 

784 

785 def create_dataset(self) -> None: 

786 """ 

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

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

789 

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

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

792 will be overwritten!** 

793 

794 `The type of the bibliographic resource` 

795 

796 :return: None 

797 """ 

798 self._create_type(GraphEntity.iri_data_file) 

799 

800 def create_dissertation(self) -> None: 

801 """ 

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

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

804 

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

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

807 will be overwritten!** 

808 

809 `The type of the bibliographic resource` 

810 

811 :return: None 

812 """ 

813 self._create_type(GraphEntity.iri_thesis) 

814 

815 def create_edited_book(self) -> None: 

816 """ 

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

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

819 

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

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

822 will be overwritten!** 

823 

824 `The type of the bibliographic resource` 

825 

826 :return: None 

827 """ 

828 self._create_type(GraphEntity.iri_book) 

829 

830 def create_editorial(self) -> None: 

831 """ 

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

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

834 

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

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

837 will be overwritten!** 

838 

839 `The type of the bibliographic resource` 

840 

841 :return: None 

842 """ 

843 self._create_type(GraphEntity.iri_editorial) 

844 

845 def create_journal_article(self) -> None: 

846 """ 

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

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

849 

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

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

852 will be overwritten!** 

853 

854 `The type of the bibliographic resource` 

855 

856 :return: None 

857 """ 

858 self._create_type(GraphEntity.iri_journal_article) 

859 

860 def create_journal_editorial(self) -> None: 

861 """ 

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

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

864 

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

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

867 will be overwritten!** 

868 

869 `The type of the bibliographic resource` 

870 

871 :return: None 

872 """ 

873 self._create_type(GraphEntity.iri_journal_editorial) 

874 

875 def create_issue(self) -> None: 

876 """ 

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

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

879 

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

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

882 will be overwritten!** 

883 

884 `The type of the bibliographic resource` 

885 

886 :return: None 

887 """ 

888 self._create_type(GraphEntity.iri_journal_issue) 

889 

890 def create_volume(self) -> None: 

891 """ 

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

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

894 

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

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

897 will be overwritten!** 

898 

899 `The type of the bibliographic resource` 

900 

901 :return: None 

902 """ 

903 self._create_type(GraphEntity.iri_journal_volume) 

904 

905 def create_journal(self) -> None: 

906 """ 

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

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

909 

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

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

912 will be overwritten!** 

913 

914 `The type of the bibliographic resource` 

915 

916 :return: None 

917 """ 

918 self._create_type(GraphEntity.iri_journal) 

919 

920 def create_monograph(self) -> None: 

921 """ 

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

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

924 

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

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

927 will be overwritten!** 

928 

929 `The type of the bibliographic resource` 

930 

931 :return: None 

932 """ 

933 self._create_type(GraphEntity.iri_book) 

934 

935 def create_newspaper(self) -> None: 

936 """ 

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

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

939 

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

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

942 will be overwritten!** 

943 

944 `The type of the bibliographic resource` 

945 

946 :return: None 

947 """ 

948 self._create_type(GraphEntity.iri_newspaper) 

949 

950 def create_newspaper_article(self) -> None: 

951 """ 

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

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

954 

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

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

957 will be overwritten!** 

958 

959 `The type of the bibliographic resource` 

960 

961 :return: None 

962 """ 

963 self._create_type(GraphEntity.iri_newspaper_article) 

964 

965 def create_newspaper_editorial(self) -> None: 

966 """ 

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

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

969 

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

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

972 will be overwritten!** 

973 

974 `The type of the bibliographic resource` 

975 

976 :return: None 

977 """ 

978 self._create_type(GraphEntity.iri_newspaper_editorial) 

979 

980 def create_newspaper_issue(self) -> None: 

981 """ 

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

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

984 

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

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

987 will be overwritten!** 

988 

989 `The type of the bibliographic resource` 

990 

991 :return: None 

992 """ 

993 self._create_type(GraphEntity.iri_newspaper_issue) 

994 

995 def create_peer_review(self) -> None: 

996 """ 

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

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

999 

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

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

1002 will be overwritten!** 

1003 

1004 `The type of the bibliographic resource` 

1005 

1006 :return: None 

1007 """ 

1008 self._create_type(GraphEntity.iri_peer_review) 

1009 

1010 def create_preprint(self) -> None: 

1011 """ 

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

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

1014 

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

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

1017 will be overwritten!** 

1018 

1019 `The type of the bibliographic resource` 

1020 

1021 :return: None 

1022 """ 

1023 self._create_type(GraphEntity.iri_preprint) 

1024 

1025 def create_presentation(self) -> None: 

1026 """ 

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

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

1029 

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

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

1032 will be overwritten!** 

1033 

1034 `The type of the bibliographic resource` 

1035 

1036 :return: None 

1037 """ 

1038 self._create_type(GraphEntity.iri_presentation) 

1039 

1040 def create_proceedings_article(self) -> None: 

1041 """ 

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

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

1044 

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

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

1047 will be overwritten!** 

1048 

1049 `The type of the bibliographic resource` 

1050 

1051 :return: None 

1052 """ 

1053 self._create_type(GraphEntity.iri_proceedings_paper) 

1054 

1055 def create_proceedings(self) -> None: 

1056 """ 

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

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

1059 

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

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

1062 will be overwritten!** 

1063 

1064 `The type of the bibliographic resource` 

1065 

1066 :return: None 

1067 """ 

1068 self._create_type(GraphEntity.iri_academic_proceedings) 

1069 

1070 def create_proceedings_series(self) -> None: 

1071 """ 

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

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

1074 

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

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

1077 will be overwritten!** 

1078 

1079 `The type of the bibliographic resource` 

1080 

1081 :return: None 

1082 """ 

1083 self._create_type(GraphEntity.iri_proceedings_series) 

1084 

1085 def create_reference_book(self) -> None: 

1086 """ 

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

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

1089 

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

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

1092 will be overwritten!** 

1093 

1094 `The type of the bibliographic resource` 

1095 

1096 :return: None 

1097 """ 

1098 self._create_type(GraphEntity.iri_reference_book) 

1099 

1100 def create_reference_entry(self) -> None: 

1101 """ 

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

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

1104 

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

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

1107 will be overwritten!** 

1108 

1109 `The type of the bibliographic resource` 

1110 

1111 :return: None 

1112 """ 

1113 self._create_type(GraphEntity.iri_reference_entry) 

1114 

1115 def create_report_series(self) -> None: 

1116 """ 

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

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

1119 

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

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

1122 will be overwritten!** 

1123 

1124 `The type of the bibliographic resource` 

1125 

1126 :return: None 

1127 """ 

1128 self._create_type(GraphEntity.iri_series) 

1129 

1130 def create_report(self) -> None: 

1131 """ 

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

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

1134 

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

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

1137 will be overwritten!** 

1138 

1139 `The type of the bibliographic resource` 

1140 

1141 :return: None 

1142 """ 

1143 self._create_type(GraphEntity.iri_report_document) 

1144 

1145 def create_retraction_notice(self) -> None: 

1146 """ 

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

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

1149 

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

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

1152 will be overwritten!** 

1153 

1154 `The type of the bibliographic resource` 

1155 

1156 :return: None 

1157 """ 

1158 self._create_type(GraphEntity.iri_retraction_notice) 

1159 

1160 def create_standard_series(self) -> None: 

1161 """ 

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

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

1164 

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

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

1167 will be overwritten!** 

1168 

1169 `The type of the bibliographic resource` 

1170 

1171 :return: None 

1172 """ 

1173 self._create_type(GraphEntity.iri_series) 

1174 

1175 def create_standard(self) -> None: 

1176 """ 

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

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

1179 

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

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

1182 will be overwritten!** 

1183 

1184 `The type of the bibliographic resource` 

1185 

1186 :return: None 

1187 """ 

1188 self._create_type(GraphEntity.iri_specification_document) 

1189 

1190 def create_series(self) -> None: 

1191 """ 

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

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

1194 

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

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

1197 will be overwritten!** 

1198 

1199 `The type of the bibliographic resource` 

1200 

1201 :return: None 

1202 """ 

1203 self._create_type(GraphEntity.iri_series) 

1204 

1205 def create_expression_collection(self) -> None: 

1206 """ 

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

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

1209 

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

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

1212 will be overwritten!** 

1213 

1214 `The type of the bibliographic resource` 

1215 

1216 :return: None 

1217 """ 

1218 self._create_type(GraphEntity.iri_expression_collection) 

1219 

1220 def create_web_content(self) -> None: 

1221 """ 

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

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

1224 

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

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

1227 will be overwritten!** 

1228 

1229 `The type of the bibliographic resource` 

1230 

1231 :return: None 

1232 """ 

1233 self._create_type(GraphEntity.iri_web_content) 

1234 

1235 def create_other(self) -> None: 

1236 """ 

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

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

1239 

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

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

1242 will be overwritten!** 

1243 

1244 `The type of the bibliographic resource` 

1245 

1246 :return: None 

1247 """ 

1248 self._create_type(GraphEntity.iri_expression)