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

273 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-28 18:52 +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 oc_ocdm.decorators import accepts_only 

14from oc_ocdm.support.support import get_datatype_from_iso_8601 

15 

16if TYPE_CHECKING: 

17 from typing import Optional, List 

18 from rdflib import URIRef 

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

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

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

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

23from oc_ocdm.graph.graph_entity import GraphEntity 

24from oc_ocdm.graph.entities.bibliographic_entity import BibliographicEntity 

25 

26 

27class BibliographicResource(BibliographicEntity): 

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

29 cited by another published bibliographic resource.""" 

30 

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

32 """ 

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

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

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

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

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

38 

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

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

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

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

43 

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

45 be merged into the current entity. 

46 :type other: BibliographicResource 

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

48 :type prefer_self: bool 

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

50 :return: None 

51 """ 

52 super()._merge_properties(other, prefer_self) 

53 assert isinstance(other, BibliographicResource) 

54 

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

56 if title is not None: 

57 self.has_title(title) 

58 

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

60 if subtitle is not None: 

61 self.has_subtitle(subtitle) 

62 

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

64 if container is not None: 

65 self.is_part_of(container) 

66 

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

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

69 for cur_citation in citations_list: 

70 self.has_citation(cur_citation) 

71 

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

73 if pub_date is not None: 

74 self.has_pub_date(pub_date) 

75 

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

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

78 for cur_format in re_list: 

79 self.has_format(cur_format) 

80 

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

82 if number is not None: 

83 self.has_number(number) 

84 

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

86 if edition is not None: 

87 self.has_edition(edition) 

88 

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

90 if not (prefer_self and self.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 if not (prefer_self and self.get_contained_discourse_elements()): 

96 for discourse_element in de_list: 

97 self.contains_discourse_element(discourse_element) 

98 

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

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

101 for agent_role in ar_list: 

102 self.has_contributor(agent_role) 

103 

104 related_doc_list: List[URIRef] = other.get_related_documents() 

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

106 for doc in related_doc_list: 

107 self.has_related_document(doc) 

108 

109 # HAS TITLE 

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

111 """ 

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

113 

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

115 """ 

116 return self._get_literal(GraphEntity.iri_title) 

117 

118 @accepts_only('literal') 

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

120 """ 

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

122 

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

124 

125 `The title of the bibliographic resource.` 

126 

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

128 :type string: str 

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

130 :return: None 

131 """ 

132 self.remove_title() 

133 self._create_literal(GraphEntity.iri_title, string) 

134 

135 def remove_title(self) -> None: 

136 """ 

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

138 

139 :return: None 

140 """ 

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

142 

143 # HAS SUBTITLE 

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

145 """ 

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

147 

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

149 """ 

150 return self._get_literal(GraphEntity.iri_has_subtitle) 

151 

152 @accepts_only('literal') 

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[URIRef] = 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, 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[URIRef] = 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, 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, 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 @accepts_only('literal') 

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

272 """ 

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

274 

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

276 

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

278 

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

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

281 :type string: str 

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

283 :return: None 

284 """ 

285 cur_type, string = get_datatype_from_iso_8601(string) 

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

287 self.remove_pub_date() 

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

289 

290 def remove_pub_date(self) -> None: 

291 """ 

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

293 

294 :return: None 

295 """ 

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

297 

298 # IS EMBODIED AS (ResourceEmbodiment) 

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

300 """ 

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

302 

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

304 """ 

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

306 result: List[ResourceEmbodiment] = [] 

307 for uri in uri_list: 

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

309 return result 

310 

311 @accepts_only('re') 

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

313 """ 

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

315 

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

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

318 

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

320 :type re_res: ResourceEmbodiment 

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

322 :return: None 

323 """ 

324 self.g.add((self.res, GraphEntity.iri_embodiment, re_res.res)) 

325 

326 @accepts_only('re') 

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

328 """ 

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

330 

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

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

333 

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

335 related to this method (defaults to None) 

336 :type re_res: ResourceEmbodiment 

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

338 :return: None 

339 """ 

340 if re_res is not None: 

341 self.g.remove((self.res, GraphEntity.iri_embodiment, re_res.res)) 

342 else: 

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

344 

345 # HAS NUMBER 

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

347 """ 

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

349 

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

351 """ 

352 return self._get_literal(GraphEntity.iri_has_sequence_identifier) 

353 

354 @accepts_only('literal') 

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

356 """ 

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

358 

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

360 

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

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

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

364 a book).` 

365 

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

367 :type string: str 

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

369 :return: None 

370 """ 

371 self.remove_number() 

372 self._create_literal(GraphEntity.iri_has_sequence_identifier, string) 

373 

374 def remove_number(self) -> None: 

375 """ 

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

377 

378 :return: None 

379 """ 

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

381 

382 # HAS EDITION 

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

384 """ 

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

386 

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

388 """ 

389 return self._get_literal(GraphEntity.iri_has_edition) 

390 

391 @accepts_only('literal') 

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

393 """ 

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

395 

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

397 

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

399 resource.` 

400 

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

402 :type string: str 

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

404 :return: None 

405 """ 

406 self.remove_edition() 

407 self._create_literal(GraphEntity.iri_has_edition, string) 

408 

409 def remove_edition(self) -> None: 

410 """ 

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

412 

413 :return: None 

414 """ 

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

416 

417 # HAS PART (BibliographicReference) 

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

419 """ 

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

421 

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

423 """ 

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

425 result: List[BibliographicReference] = [] 

426 for uri in uri_list: 

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

428 return result 

429 

430 @accepts_only('be') 

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

432 """ 

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

434 

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

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

437 

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

439 :type be_res: BibliographicReference 

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

441 :return: None 

442 """ 

443 self.g.add((self.res, GraphEntity.iri_contains_reference, be_res.res)) 

444 

445 @accepts_only('be') 

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

447 """ 

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

449 

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

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

452 

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

454 related to this method (defaults to None) 

455 :type be_res: BibliographicReference 

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

457 :return: None 

458 """ 

459 if be_res is not None: 

460 self.g.remove((self.res, GraphEntity.iri_contains_reference, be_res.res)) 

461 else: 

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

463 

464 # HAS PART (DiscourseElement) 

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

466 """ 

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

468 

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

470 """ 

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

472 result: List[DiscourseElement] = [] 

473 for uri in uri_list: 

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

475 return result 

476 

477 @accepts_only('de') 

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

479 """ 

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

481 

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

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

484 

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

486 :type de_res: DiscourseElement 

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

488 :return: None 

489 """ 

490 self.g.add((self.res, GraphEntity.iri_contains_de, de_res.res)) 

491 

492 @accepts_only('de') 

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

494 """ 

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

496 

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

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

499 

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

501 related to this method (defaults to None) 

502 :type de_res: DiscourseElement 

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

504 :return: None 

505 """ 

506 if de_res is not None: 

507 self.g.remove((self.res, GraphEntity.iri_contains_de, de_res.res)) 

508 else: 

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

510 

511 # HAS CONTRIBUTOR (AgentRole) 

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

513 """ 

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

515 

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

517 """ 

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

519 result: List[AgentRole] = [] 

520 for uri in uri_list: 

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

522 return result 

523 

524 @accepts_only('ar') 

525 def has_contributor(self, ar_res: AgentRole): 

526 """ 

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

528 

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

530 :type ar_res: AgentRole 

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

532 :return: None 

533 """ 

534 self.g.add((self.res, GraphEntity.iri_is_document_context_for, ar_res.res)) 

535 

536 @accepts_only('ar') 

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

538 """ 

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

540 

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

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

543 

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

545 related to this method (defaults to None) 

546 :type ar_res: AgentRole 

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

548 :return: None 

549 """ 

550 if ar_res is not None: 

551 self.g.remove((self.res, GraphEntity.iri_is_document_context_for, ar_res.res)) 

552 else: 

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

554 

555 # HAS RELATED DOCUMENT 

556 def get_related_documents(self) -> List[URIRef]: 

557 """ 

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

559 

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

561 """ 

562 uri_list: List[URIRef] = self._get_multiple_uri_references(GraphEntity.iri_relation) 

563 return uri_list 

564 

565 @accepts_only('thing') 

566 def has_related_document(self, thing_res: URIRef) -> None: 

567 """ 

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

569 

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

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

572 external database).` 

573 

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

575 :type thing_res: URIRef 

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

577 :return: None 

578 """ 

579 self.g.add((self.res, GraphEntity.iri_relation, thing_res)) 

580 

581 @accepts_only('thing') 

582 def remove_related_document(self, thing_res: URIRef | None = None) -> None: 

583 """ 

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

585 

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

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

588 

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

590 related to this method (defaults to None) 

591 :type thing_res: URIRef 

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

593 :return: None 

594 """ 

595 if thing_res is not None: 

596 self.g.remove((self.res, GraphEntity.iri_relation, thing_res)) 

597 else: 

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

599 

600 def create_abstract(self) -> None: 

601 """ 

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

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

604 

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

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

607 will be overwritten!** 

608 

609 `The type of the bibliographic resource` 

610 

611 :return: None 

612 """ 

613 self._create_type(GraphEntity.iri_abstract) 

614 

615 # HAS TYPE 

616 def create_archival_document(self) -> None: 

617 """ 

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

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

620 

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

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

623 will be overwritten!** 

624 

625 `The type of the bibliographic resource` 

626 

627 :return: None 

628 """ 

629 self._create_type(GraphEntity.iri_archival_document) 

630 

631 def create_audio_document(self) -> None: 

632 """ 

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

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

635 

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

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

638 will be overwritten!** 

639 

640 `The type of the bibliographic resource` 

641 

642 :return: None 

643 """ 

644 self._create_type(GraphEntity.iri_audio_document) 

645 

646 def create_book(self) -> None: 

647 """ 

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

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

650 

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

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

653 will be overwritten!** 

654 

655 `The type of the bibliographic resource` 

656 

657 :return: None 

658 """ 

659 self._create_type(GraphEntity.iri_book) 

660 

661 def create_book_chapter(self) -> None: 

662 """ 

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

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

665 

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

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

668 will be overwritten!** 

669 

670 `The type of the bibliographic resource` 

671 

672 :return: None 

673 """ 

674 self._create_type(GraphEntity.iri_book_chapter) 

675 

676 def create_book_part(self) -> None: 

677 """ 

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

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

680 

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

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

683 will be overwritten!** 

684 

685 `The type of the bibliographic resource` 

686 

687 :return: None 

688 """ 

689 self._create_type(GraphEntity.iri_part) 

690 

691 def create_book_section(self) -> None: 

692 """ 

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

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

695 

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

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

698 will be overwritten!** 

699 

700 `The type of the bibliographic resource` 

701 

702 :return: None 

703 """ 

704 self._create_type(GraphEntity.iri_expression_collection) 

705 

706 def create_book_series(self) -> None: 

707 """ 

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

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

710 

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

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

713 will be overwritten!** 

714 

715 `The type of the bibliographic resource` 

716 

717 :return: None 

718 """ 

719 self._create_type(GraphEntity.iri_book_series) 

720 

721 def create_book_set(self) -> None: 

722 """ 

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

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

725 

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

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

728 will be overwritten!** 

729 

730 `The type of the bibliographic resource` 

731 

732 :return: None 

733 """ 

734 self._create_type(GraphEntity.iri_book_set) 

735 

736 def create_book_track(self) -> None: 

737 """ 

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

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

740 

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

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

743 will be overwritten!** 

744 

745 `The type of the bibliographic resource` 

746 

747 :return: None 

748 """ 

749 self._create_type(GraphEntity.iri_expression) 

750 

751 def create_component(self) -> None: 

752 """ 

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

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

755 

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

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

758 will be overwritten!** 

759 

760 `The type of the bibliographic resource` 

761 

762 :return: None 

763 """ 

764 self._create_type(GraphEntity.iri_expression) 

765 

766 def create_computer_program(self) -> None: 

767 """ 

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

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

770 

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

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

773 will be overwritten!** 

774 

775 `The type of the bibliographic resource` 

776 

777 :return: None 

778 """ 

779 self._create_type(GraphEntity.iri_computer_program) 

780 

781 def create_data_management_plan(self) -> None: 

782 """ 

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

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

785 

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

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

788 will be overwritten!** 

789 

790 `The type of the bibliographic resource` 

791 

792 :return: None 

793 """ 

794 self._create_type(GraphEntity.iri_data_management_plan) 

795 

796 def create_dataset(self) -> None: 

797 """ 

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

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

800 

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

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

803 will be overwritten!** 

804 

805 `The type of the bibliographic resource` 

806 

807 :return: None 

808 """ 

809 self._create_type(GraphEntity.iri_data_file) 

810 

811 def create_dissertation(self) -> None: 

812 """ 

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

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

815 

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

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

818 will be overwritten!** 

819 

820 `The type of the bibliographic resource` 

821 

822 :return: None 

823 """ 

824 self._create_type(GraphEntity.iri_thesis) 

825 

826 def create_edited_book(self) -> None: 

827 """ 

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

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

830 

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

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

833 will be overwritten!** 

834 

835 `The type of the bibliographic resource` 

836 

837 :return: None 

838 """ 

839 self._create_type(GraphEntity.iri_book) 

840 

841 def create_editorial(self) -> None: 

842 """ 

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

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

845 

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

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

848 will be overwritten!** 

849 

850 `The type of the bibliographic resource` 

851 

852 :return: None 

853 """ 

854 self._create_type(GraphEntity.iri_editorial) 

855 

856 def create_journal_article(self) -> None: 

857 """ 

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

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

860 

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

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

863 will be overwritten!** 

864 

865 `The type of the bibliographic resource` 

866 

867 :return: None 

868 """ 

869 self._create_type(GraphEntity.iri_journal_article) 

870 

871 def create_journal_editorial(self) -> None: 

872 """ 

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

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

875 

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

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

878 will be overwritten!** 

879 

880 `The type of the bibliographic resource` 

881 

882 :return: None 

883 """ 

884 self._create_type(GraphEntity.iri_journal_editorial) 

885 

886 def create_issue(self) -> None: 

887 """ 

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

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

890 

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

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

893 will be overwritten!** 

894 

895 `The type of the bibliographic resource` 

896 

897 :return: None 

898 """ 

899 self._create_type(GraphEntity.iri_journal_issue) 

900 

901 def create_volume(self) -> None: 

902 """ 

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

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

905 

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

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

908 will be overwritten!** 

909 

910 `The type of the bibliographic resource` 

911 

912 :return: None 

913 """ 

914 self._create_type(GraphEntity.iri_journal_volume) 

915 

916 def create_journal(self) -> None: 

917 """ 

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

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

920 

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

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

923 will be overwritten!** 

924 

925 `The type of the bibliographic resource` 

926 

927 :return: None 

928 """ 

929 self._create_type(GraphEntity.iri_journal) 

930 

931 def create_monograph(self) -> None: 

932 """ 

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

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

935 

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

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

938 will be overwritten!** 

939 

940 `The type of the bibliographic resource` 

941 

942 :return: None 

943 """ 

944 self._create_type(GraphEntity.iri_book) 

945 

946 def create_newspaper(self) -> None: 

947 """ 

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

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

950 

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

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

953 will be overwritten!** 

954 

955 `The type of the bibliographic resource` 

956 

957 :return: None 

958 """ 

959 self._create_type(GraphEntity.iri_newspaper) 

960 

961 def create_newspaper_article(self) -> None: 

962 """ 

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

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

965 

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

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

968 will be overwritten!** 

969 

970 `The type of the bibliographic resource` 

971 

972 :return: None 

973 """ 

974 self._create_type(GraphEntity.iri_newspaper_article) 

975 

976 def create_newspaper_editorial(self) -> None: 

977 """ 

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

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

980 

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

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

983 will be overwritten!** 

984 

985 `The type of the bibliographic resource` 

986 

987 :return: None 

988 """ 

989 self._create_type(GraphEntity.iri_newspaper_editorial) 

990 

991 def create_newspaper_issue(self) -> None: 

992 """ 

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

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

995 

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

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

998 will be overwritten!** 

999 

1000 `The type of the bibliographic resource` 

1001 

1002 :return: None 

1003 """ 

1004 self._create_type(GraphEntity.iri_newspaper_issue) 

1005 

1006 def create_peer_review(self) -> None: 

1007 """ 

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

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

1010 

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

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

1013 will be overwritten!** 

1014 

1015 `The type of the bibliographic resource` 

1016 

1017 :return: None 

1018 """ 

1019 self._create_type(GraphEntity.iri_peer_review) 

1020 

1021 def create_preprint(self) -> None: 

1022 """ 

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

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

1025 

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

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

1028 will be overwritten!** 

1029 

1030 `The type of the bibliographic resource` 

1031 

1032 :return: None 

1033 """ 

1034 self._create_type(GraphEntity.iri_preprint) 

1035 

1036 def create_presentation(self) -> None: 

1037 """ 

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

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

1040 

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

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

1043 will be overwritten!** 

1044 

1045 `The type of the bibliographic resource` 

1046 

1047 :return: None 

1048 """ 

1049 self._create_type(GraphEntity.iri_presentation) 

1050 

1051 def create_proceedings_article(self) -> None: 

1052 """ 

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

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

1055 

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

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

1058 will be overwritten!** 

1059 

1060 `The type of the bibliographic resource` 

1061 

1062 :return: None 

1063 """ 

1064 self._create_type(GraphEntity.iri_proceedings_paper) 

1065 

1066 def create_proceedings(self) -> None: 

1067 """ 

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

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

1070 

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

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

1073 will be overwritten!** 

1074 

1075 `The type of the bibliographic resource` 

1076 

1077 :return: None 

1078 """ 

1079 self._create_type(GraphEntity.iri_academic_proceedings) 

1080 

1081 def create_proceedings_series(self) -> None: 

1082 """ 

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

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

1085 

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

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

1088 will be overwritten!** 

1089 

1090 `The type of the bibliographic resource` 

1091 

1092 :return: None 

1093 """ 

1094 self._create_type(GraphEntity.iri_proceedings_series) 

1095 

1096 def create_reference_book(self) -> None: 

1097 """ 

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

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

1100 

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

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

1103 will be overwritten!** 

1104 

1105 `The type of the bibliographic resource` 

1106 

1107 :return: None 

1108 """ 

1109 self._create_type(GraphEntity.iri_reference_book) 

1110 

1111 def create_reference_entry(self) -> None: 

1112 """ 

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

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

1115 

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

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

1118 will be overwritten!** 

1119 

1120 `The type of the bibliographic resource` 

1121 

1122 :return: None 

1123 """ 

1124 self._create_type(GraphEntity.iri_reference_entry) 

1125 

1126 def create_report_series(self) -> None: 

1127 """ 

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

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

1130 

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

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

1133 will be overwritten!** 

1134 

1135 `The type of the bibliographic resource` 

1136 

1137 :return: None 

1138 """ 

1139 self._create_type(GraphEntity.iri_series) 

1140 

1141 def create_report(self) -> None: 

1142 """ 

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

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

1145 

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

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

1148 will be overwritten!** 

1149 

1150 `The type of the bibliographic resource` 

1151 

1152 :return: None 

1153 """ 

1154 self._create_type(GraphEntity.iri_report_document) 

1155 

1156 def create_retraction_notice(self) -> None: 

1157 """ 

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

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

1160 

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

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

1163 will be overwritten!** 

1164 

1165 `The type of the bibliographic resource` 

1166 

1167 :return: None 

1168 """ 

1169 self._create_type(GraphEntity.iri_retraction_notice) 

1170 

1171 def create_standard_series(self) -> None: 

1172 """ 

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

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

1175 

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

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

1178 will be overwritten!** 

1179 

1180 `The type of the bibliographic resource` 

1181 

1182 :return: None 

1183 """ 

1184 self._create_type(GraphEntity.iri_series) 

1185 

1186 def create_standard(self) -> None: 

1187 """ 

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

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

1190 

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

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

1193 will be overwritten!** 

1194 

1195 `The type of the bibliographic resource` 

1196 

1197 :return: None 

1198 """ 

1199 self._create_type(GraphEntity.iri_specification_document) 

1200 

1201 def create_series(self) -> None: 

1202 """ 

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

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

1205 

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

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

1208 will be overwritten!** 

1209 

1210 `The type of the bibliographic resource` 

1211 

1212 :return: None 

1213 """ 

1214 self._create_type(GraphEntity.iri_series) 

1215 

1216 def create_expression_collection(self) -> None: 

1217 """ 

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

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

1220 

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

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

1223 will be overwritten!** 

1224 

1225 `The type of the bibliographic resource` 

1226 

1227 :return: None 

1228 """ 

1229 self._create_type(GraphEntity.iri_expression_collection) 

1230 

1231 def create_web_content(self) -> None: 

1232 """ 

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

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

1235 

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

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

1238 will be overwritten!** 

1239 

1240 `The type of the bibliographic resource` 

1241 

1242 :return: None 

1243 """ 

1244 self._create_type(GraphEntity.iri_web_content) 

1245 

1246 def create_other(self) -> None: 

1247 """ 

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

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

1250 

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

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

1253 will be overwritten!** 

1254 

1255 `The type of the bibliographic resource` 

1256 

1257 :return: None 

1258 """ 

1259 self._create_type(GraphEntity.iri_expression)