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

280 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2025-05-30 22:05 +0000

1#!/usr/bin/python 

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

3# Copyright (c) 2016, Silvio Peroni <essepuntato@gmail.com> 

4# 

5# Permission to use, copy, modify, and/or distribute this software for any purpose 

6# with or without fee is hereby granted, provided that the above copyright notice 

7# and this permission notice appear in all copies. 

8# 

9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 

10# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 

11# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, 

12# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 

13# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

14# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 

15# SOFTWARE. 

16from __future__ import annotations 

17 

18from typing import TYPE_CHECKING 

19 

20from oc_ocdm.decorators import accepts_only 

21from oc_ocdm.support.support import get_datatype_from_iso_8601 

22 

23if TYPE_CHECKING: 

24 from typing import Optional, List 

25 from rdflib import URIRef 

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

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

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

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

30from oc_ocdm.graph.graph_entity import GraphEntity 

31from oc_ocdm.graph.entities.bibliographic_entity import BibliographicEntity 

32 

33 

34class BibliographicResource(BibliographicEntity): 

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

36 cited by another published bibliographic resource.""" 

37 

38 @accepts_only('br') 

39 def merge(self, other: BibliographicResource, prefer_self: bool = False) -> None: 

40 """ 

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

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

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

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

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

46 

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

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

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

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

51 

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

53 be merged into the current entity. 

54 :type other: BibliographicResource 

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

56 :type prefer_self: bool 

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

58 :return: None 

59 """ 

60 super(BibliographicResource, self).merge(other, prefer_self=prefer_self) 

61 

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

63 if title is not None: 

64 self.has_title(title) 

65 

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

67 if subtitle is not None: 

68 self.has_subtitle(subtitle) 

69 

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

71 if container is not None: 

72 self.is_part_of(container) 

73 

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

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

76 for cur_citation in citations_list: 

77 self.has_citation(cur_citation) 

78 

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

80 if pub_date is not None: 

81 self.has_pub_date(pub_date) 

82 

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

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

85 for cur_format in re_list: 

86 self.has_format(cur_format) 

87 

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

89 if number is not None: 

90 self.has_number(number) 

91 

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

93 if edition is not None: 

94 self.has_edition(edition) 

95 

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

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

98 for reference in be_list: 

99 self.contains_in_reference_list(reference) 

100 

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

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

103 for discourse_element in de_list: 

104 self.contains_discourse_element(discourse_element) 

105 

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

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

108 for agent_role in ar_list: 

109 self.has_contributor(agent_role) 

110 

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

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

113 for doc in related_doc_list: 

114 self.has_related_document(doc) 

115 

116 # HAS TITLE 

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

118 """ 

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

120 

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

122 """ 

123 return self._get_literal(GraphEntity.iri_title) 

124 

125 @accepts_only('literal') 

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

127 """ 

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

129 

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

131 

132 `The title of the bibliographic resource.` 

133 

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

135 :type string: str 

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

137 :return: None 

138 """ 

139 self.remove_title() 

140 self._create_literal(GraphEntity.iri_title, string) 

141 

142 def remove_title(self) -> None: 

143 """ 

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

145 

146 :return: None 

147 """ 

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

149 

150 # HAS SUBTITLE 

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

152 """ 

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

154 

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

156 """ 

157 return self._get_literal(GraphEntity.iri_has_subtitle) 

158 

159 @accepts_only('literal') 

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

161 """ 

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

163 

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

165 

166 `The subtitle of the bibliographic resource.` 

167 

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

169 :type string: str 

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

171 :return: None 

172 """ 

173 self.remove_subtitle() 

174 self._create_literal(GraphEntity.iri_has_subtitle, string) 

175 

176 def remove_subtitle(self) -> None: 

177 """ 

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

179 

180 :return: None 

181 """ 

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

183 

184 # IS PART OF (BibliographicResource) 

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

186 """ 

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

188 

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

190 """ 

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

192 if uri is not None: 

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

194 

195 @accepts_only('br') 

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

197 """ 

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

199 

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

201 

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

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

204 

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

206 :type br_res: BibliographicResource 

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

208 :return: None 

209 """ 

210 self.remove_is_part_of() 

211 self.g.add((self.res, GraphEntity.iri_part_of, br_res.res)) 

212 

213 def remove_is_part_of(self) -> None: 

214 """ 

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

216 

217 :return: None 

218 """ 

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

220 

221 # CITES (BibliographicResource) 

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

223 """ 

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

225 

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

227 """ 

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

229 result: List[BibliographicResource] = [] 

230 for uri in uri_list: 

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

232 return result 

233 

234 @accepts_only('br') 

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

236 """ 

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

238 

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

240 resource.` 

241 

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

243 :type br_res: BibliographicResource 

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

245 :return: None 

246 """ 

247 self.g.add((self.res, GraphEntity.iri_cites, br_res.res)) 

248 

249 @accepts_only('br') 

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

251 """ 

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

253 

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

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

256 

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

258 related to this method (defaults to None) 

259 :type br_res: BibliographicResource 

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

261 :return: None 

262 """ 

263 if br_res is not None: 

264 self.g.remove((self.res, GraphEntity.iri_cites, br_res.res)) 

265 else: 

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

267 

268 # HAS PUBLICATION DATE 

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

270 """ 

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

272 

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

274 """ 

275 return self._get_literal(GraphEntity.iri_has_publication_date) 

276 

277 @accepts_only('literal') 

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

279 """ 

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

281 

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

283 

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

285 

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

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

288 :type string: str 

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

290 :return: None 

291 """ 

292 cur_type, string = get_datatype_from_iso_8601(string) 

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

294 self.remove_pub_date() 

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

296 

297 def remove_pub_date(self) -> None: 

298 """ 

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

300 

301 :return: None 

302 """ 

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

304 

305 # IS EMBODIED AS (ResourceEmbodiment) 

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

307 """ 

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

309 

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

311 """ 

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

313 result: List[ResourceEmbodiment] = [] 

314 for uri in uri_list: 

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

316 return result 

317 

318 @accepts_only('re') 

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

320 """ 

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

322 

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

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

325 

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

327 :type re_res: ResourceEmbodiment 

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

329 :return: None 

330 """ 

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

332 

333 @accepts_only('re') 

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

335 """ 

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

337 

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

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

340 

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

342 related to this method (defaults to None) 

343 :type re_res: ResourceEmbodiment 

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

345 :return: None 

346 """ 

347 if re_res is not None: 

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

349 else: 

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

351 

352 # HAS NUMBER 

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

354 """ 

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

356 

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

358 """ 

359 return self._get_literal(GraphEntity.iri_has_sequence_identifier) 

360 

361 @accepts_only('literal') 

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

363 """ 

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

365 

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

367 

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

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

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

371 a book).` 

372 

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

374 :type string: str 

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

376 :return: None 

377 """ 

378 self.remove_number() 

379 self._create_literal(GraphEntity.iri_has_sequence_identifier, string) 

380 

381 def remove_number(self) -> None: 

382 """ 

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

384 

385 :return: None 

386 """ 

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

388 

389 # HAS EDITION 

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

391 """ 

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

393 

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

395 """ 

396 return self._get_literal(GraphEntity.iri_has_edition) 

397 

398 @accepts_only('literal') 

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

400 """ 

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

402 

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

404 

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

406 resource.` 

407 

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

409 :type string: str 

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

411 :return: None 

412 """ 

413 self.remove_edition() 

414 self._create_literal(GraphEntity.iri_has_edition, string) 

415 

416 def remove_edition(self) -> None: 

417 """ 

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

419 

420 :return: None 

421 """ 

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

423 

424 # HAS PART (BibliographicReference) 

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

426 """ 

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

428 

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

430 """ 

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

432 result: List[BibliographicReference] = [] 

433 for uri in uri_list: 

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

435 return result 

436 

437 @accepts_only('be') 

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

439 """ 

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

441 

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

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

444 

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

446 :type be_res: BibliographicReference 

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

448 :return: None 

449 """ 

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

451 

452 @accepts_only('be') 

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

454 """ 

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

456 

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

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

459 

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

461 related to this method (defaults to None) 

462 :type be_res: BibliographicReference 

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

464 :return: None 

465 """ 

466 if be_res is not None: 

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

468 else: 

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

470 

471 # HAS PART (DiscourseElement) 

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

473 """ 

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

475 

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

477 """ 

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

479 result: List[DiscourseElement] = [] 

480 for uri in uri_list: 

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

482 return result 

483 

484 @accepts_only('de') 

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

486 """ 

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

488 

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

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

491 

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

493 :type de_res: DiscourseElement 

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

495 :return: None 

496 """ 

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

498 

499 @accepts_only('de') 

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

501 """ 

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

503 

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

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

506 

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

508 related to this method (defaults to None) 

509 :type de_res: DiscourseElement 

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

511 :return: None 

512 """ 

513 if de_res is not None: 

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

515 else: 

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

517 

518 # HAS CONTRIBUTOR (AgentRole) 

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

520 """ 

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

522 

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

524 """ 

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

526 result: List[AgentRole] = [] 

527 for uri in uri_list: 

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

529 return result 

530 

531 @accepts_only('ar') 

532 def has_contributor(self, ar_res: AgentRole): 

533 """ 

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

535 

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

537 :type ar_res: AgentRole 

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

539 :return: None 

540 """ 

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

542 

543 @accepts_only('ar') 

544 def remove_contributor(self, ar_res: AgentRole = None): 

545 """ 

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

547 

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

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

550 

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

552 related to this method (defaults to None) 

553 :type ar_res: AgentRole 

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

555 :return: None 

556 """ 

557 if ar_res is not None: 

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

559 else: 

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

561 

562 # HAS RELATED DOCUMENT 

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

564 """ 

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

566 

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

568 """ 

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

570 return uri_list 

571 

572 @accepts_only('thing') 

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

574 """ 

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

576 

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

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

579 external database).` 

580 

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

582 :type thing_res: URIRef 

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

584 :return: None 

585 """ 

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

587 

588 @accepts_only('thing') 

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

590 """ 

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

592 

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

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

595 

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

597 related to this method (defaults to None) 

598 :type thing_res: URIRef 

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

600 :return: None 

601 """ 

602 if thing_res is not None: 

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

604 else: 

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

606 

607 def create_abstract(self) -> None: 

608 """ 

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

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

611 

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

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

614 will be overwritten!** 

615 

616 `The type of the bibliographic resource` 

617 

618 :return: None 

619 """ 

620 self._create_type(GraphEntity.iri_abstract) 

621 

622 # HAS TYPE 

623 def create_archival_document(self) -> None: 

624 """ 

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

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

627 

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

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

630 will be overwritten!** 

631 

632 `The type of the bibliographic resource` 

633 

634 :return: None 

635 """ 

636 self._create_type(GraphEntity.iri_archival_document) 

637 

638 def create_audio_document(self) -> None: 

639 """ 

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

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

642 

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

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

645 will be overwritten!** 

646 

647 `The type of the bibliographic resource` 

648 

649 :return: None 

650 """ 

651 self._create_type(GraphEntity.iri_audio_document) 

652 

653 def create_book(self) -> None: 

654 """ 

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

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

657 

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

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

660 will be overwritten!** 

661 

662 `The type of the bibliographic resource` 

663 

664 :return: None 

665 """ 

666 self._create_type(GraphEntity.iri_book) 

667 

668 def create_book_chapter(self) -> None: 

669 """ 

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

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

672 

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

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

675 will be overwritten!** 

676 

677 `The type of the bibliographic resource` 

678 

679 :return: None 

680 """ 

681 self._create_type(GraphEntity.iri_book_chapter) 

682 

683 def create_book_part(self) -> None: 

684 """ 

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

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

687 

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

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

690 will be overwritten!** 

691 

692 `The type of the bibliographic resource` 

693 

694 :return: None 

695 """ 

696 self._create_type(GraphEntity.iri_part) 

697 

698 def create_book_section(self) -> None: 

699 """ 

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

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

702 

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

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

705 will be overwritten!** 

706 

707 `The type of the bibliographic resource` 

708 

709 :return: None 

710 """ 

711 self._create_type(GraphEntity.iri_expression_collection) 

712 

713 def create_book_series(self) -> None: 

714 """ 

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

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

717 

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

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

720 will be overwritten!** 

721 

722 `The type of the bibliographic resource` 

723 

724 :return: None 

725 """ 

726 self._create_type(GraphEntity.iri_book_series) 

727 

728 def create_book_set(self) -> None: 

729 """ 

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

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

732 

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

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

735 will be overwritten!** 

736 

737 `The type of the bibliographic resource` 

738 

739 :return: None 

740 """ 

741 self._create_type(GraphEntity.iri_book_set) 

742 

743 def create_book_track(self) -> None: 

744 """ 

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

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

747 

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

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

750 will be overwritten!** 

751 

752 `The type of the bibliographic resource` 

753 

754 :return: None 

755 """ 

756 self._create_type(GraphEntity.iri_expression) 

757 

758 def create_component(self) -> None: 

759 """ 

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

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

762 

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

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

765 will be overwritten!** 

766 

767 `The type of the bibliographic resource` 

768 

769 :return: None 

770 """ 

771 self._create_type(GraphEntity.iri_expression) 

772 

773 def create_computer_program(self) -> None: 

774 """ 

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

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

777 

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

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

780 will be overwritten!** 

781 

782 `The type of the bibliographic resource` 

783 

784 :return: None 

785 """ 

786 self._create_type(GraphEntity.iri_computer_program) 

787 

788 def create_data_management_plan(self) -> None: 

789 """ 

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

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

792 

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

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

795 will be overwritten!** 

796 

797 `The type of the bibliographic resource` 

798 

799 :return: None 

800 """ 

801 self._create_type(GraphEntity.iri_data_management_plan) 

802 

803 def create_dataset(self) -> None: 

804 """ 

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

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

807 

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

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

810 will be overwritten!** 

811 

812 `The type of the bibliographic resource` 

813 

814 :return: None 

815 """ 

816 self._create_type(GraphEntity.iri_data_file) 

817 

818 def create_dissertation(self) -> None: 

819 """ 

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

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

822 

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

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

825 will be overwritten!** 

826 

827 `The type of the bibliographic resource` 

828 

829 :return: None 

830 """ 

831 self._create_type(GraphEntity.iri_thesis) 

832 

833 def create_edited_book(self) -> None: 

834 """ 

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

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

837 

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

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

840 will be overwritten!** 

841 

842 `The type of the bibliographic resource` 

843 

844 :return: None 

845 """ 

846 self._create_type(GraphEntity.iri_book) 

847 

848 def create_editorial(self) -> None: 

849 """ 

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

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

852 

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

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

855 will be overwritten!** 

856 

857 `The type of the bibliographic resource` 

858 

859 :return: None 

860 """ 

861 self._create_type(GraphEntity.iri_editorial) 

862 

863 def create_journal_article(self) -> None: 

864 """ 

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

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

867 

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

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

870 will be overwritten!** 

871 

872 `The type of the bibliographic resource` 

873 

874 :return: None 

875 """ 

876 self._create_type(GraphEntity.iri_journal_article) 

877 

878 def create_journal_editorial(self) -> None: 

879 """ 

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

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

882 

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

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

885 will be overwritten!** 

886 

887 `The type of the bibliographic resource` 

888 

889 :return: None 

890 """ 

891 self._create_type(GraphEntity.iri_journal_editorial) 

892 

893 def create_issue(self) -> None: 

894 """ 

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

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

897 

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

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

900 will be overwritten!** 

901 

902 `The type of the bibliographic resource` 

903 

904 :return: None 

905 """ 

906 self._create_type(GraphEntity.iri_journal_issue) 

907 

908 def create_volume(self) -> None: 

909 """ 

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

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

912 

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

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

915 will be overwritten!** 

916 

917 `The type of the bibliographic resource` 

918 

919 :return: None 

920 """ 

921 self._create_type(GraphEntity.iri_journal_volume) 

922 

923 def create_journal(self) -> None: 

924 """ 

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

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

927 

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

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

930 will be overwritten!** 

931 

932 `The type of the bibliographic resource` 

933 

934 :return: None 

935 """ 

936 self._create_type(GraphEntity.iri_journal) 

937 

938 def create_monograph(self) -> None: 

939 """ 

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

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

942 

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

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

945 will be overwritten!** 

946 

947 `The type of the bibliographic resource` 

948 

949 :return: None 

950 """ 

951 self._create_type(GraphEntity.iri_book) 

952 

953 def create_newspaper(self) -> None: 

954 """ 

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

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

957 

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

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

960 will be overwritten!** 

961 

962 `The type of the bibliographic resource` 

963 

964 :return: None 

965 """ 

966 self._create_type(GraphEntity.iri_newspaper) 

967 

968 def create_newspaper_article(self) -> None: 

969 """ 

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

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

972 

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

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

975 will be overwritten!** 

976 

977 `The type of the bibliographic resource` 

978 

979 :return: None 

980 """ 

981 self._create_type(GraphEntity.iri_newspaper_article) 

982 

983 def create_newspaper_editorial(self) -> None: 

984 """ 

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

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

987 

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

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

990 will be overwritten!** 

991 

992 `The type of the bibliographic resource` 

993 

994 :return: None 

995 """ 

996 self._create_type(GraphEntity.iri_newspaper_editorial) 

997 

998 def create_newspaper_issue(self) -> None: 

999 """ 

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

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

1002 

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

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

1005 will be overwritten!** 

1006 

1007 `The type of the bibliographic resource` 

1008 

1009 :return: None 

1010 """ 

1011 self._create_type(GraphEntity.iri_newspaper_issue) 

1012 

1013 def create_peer_review(self) -> None: 

1014 """ 

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

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

1017 

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

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

1020 will be overwritten!** 

1021 

1022 `The type of the bibliographic resource` 

1023 

1024 :return: None 

1025 """ 

1026 self._create_type(GraphEntity.iri_peer_review) 

1027 

1028 def create_preprint(self) -> None: 

1029 """ 

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

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

1032 

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

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

1035 will be overwritten!** 

1036 

1037 `The type of the bibliographic resource` 

1038 

1039 :return: None 

1040 """ 

1041 self._create_type(GraphEntity.iri_preprint) 

1042 

1043 def create_presentation(self) -> None: 

1044 """ 

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

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

1047 

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

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

1050 will be overwritten!** 

1051 

1052 `The type of the bibliographic resource` 

1053 

1054 :return: None 

1055 """ 

1056 self._create_type(GraphEntity.iri_presentation) 

1057 

1058 def create_proceedings_article(self) -> None: 

1059 """ 

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

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

1062 

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

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

1065 will be overwritten!** 

1066 

1067 `The type of the bibliographic resource` 

1068 

1069 :return: None 

1070 """ 

1071 self._create_type(GraphEntity.iri_proceedings_paper) 

1072 

1073 def create_proceedings(self) -> None: 

1074 """ 

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

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

1077 

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

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

1080 will be overwritten!** 

1081 

1082 `The type of the bibliographic resource` 

1083 

1084 :return: None 

1085 """ 

1086 self._create_type(GraphEntity.iri_academic_proceedings) 

1087 

1088 def create_proceedings_series(self) -> None: 

1089 """ 

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

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

1092 

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

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

1095 will be overwritten!** 

1096 

1097 `The type of the bibliographic resource` 

1098 

1099 :return: None 

1100 """ 

1101 self._create_type(GraphEntity.iri_proceedings_series) 

1102 

1103 def create_reference_book(self) -> None: 

1104 """ 

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

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

1107 

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

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

1110 will be overwritten!** 

1111 

1112 `The type of the bibliographic resource` 

1113 

1114 :return: None 

1115 """ 

1116 self._create_type(GraphEntity.iri_reference_book) 

1117 

1118 def create_reference_entry(self) -> None: 

1119 """ 

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

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

1122 

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

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

1125 will be overwritten!** 

1126 

1127 `The type of the bibliographic resource` 

1128 

1129 :return: None 

1130 """ 

1131 self._create_type(GraphEntity.iri_reference_entry) 

1132 

1133 def create_report_series(self) -> None: 

1134 """ 

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

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

1137 

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

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

1140 will be overwritten!** 

1141 

1142 `The type of the bibliographic resource` 

1143 

1144 :return: None 

1145 """ 

1146 self._create_type(GraphEntity.iri_series) 

1147 

1148 def create_report(self) -> None: 

1149 """ 

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

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

1152 

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

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

1155 will be overwritten!** 

1156 

1157 `The type of the bibliographic resource` 

1158 

1159 :return: None 

1160 """ 

1161 self._create_type(GraphEntity.iri_report_document) 

1162 

1163 def create_retraction_notice(self) -> None: 

1164 """ 

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

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

1167 

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

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

1170 will be overwritten!** 

1171 

1172 `The type of the bibliographic resource` 

1173 

1174 :return: None 

1175 """ 

1176 self._create_type(GraphEntity.iri_retraction_notice) 

1177 

1178 def create_standard_series(self) -> None: 

1179 """ 

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

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

1182 

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

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

1185 will be overwritten!** 

1186 

1187 `The type of the bibliographic resource` 

1188 

1189 :return: None 

1190 """ 

1191 self._create_type(GraphEntity.iri_series) 

1192 

1193 def create_standard(self) -> None: 

1194 """ 

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

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

1197 

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

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

1200 will be overwritten!** 

1201 

1202 `The type of the bibliographic resource` 

1203 

1204 :return: None 

1205 """ 

1206 self._create_type(GraphEntity.iri_specification_document) 

1207 

1208 def create_series(self) -> None: 

1209 """ 

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

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

1212 

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

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

1215 will be overwritten!** 

1216 

1217 `The type of the bibliographic resource` 

1218 

1219 :return: None 

1220 """ 

1221 self._create_type(GraphEntity.iri_series) 

1222 

1223 def create_expression_collection(self) -> None: 

1224 """ 

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

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

1227 

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

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

1230 will be overwritten!** 

1231 

1232 `The type of the bibliographic resource` 

1233 

1234 :return: None 

1235 """ 

1236 self._create_type(GraphEntity.iri_expression_collection) 

1237 

1238 def create_web_content(self) -> None: 

1239 """ 

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

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

1242 

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

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

1245 will be overwritten!** 

1246 

1247 `The type of the bibliographic resource` 

1248 

1249 :return: None 

1250 """ 

1251 self._create_type(GraphEntity.iri_web_content) 

1252 

1253 def create_other(self) -> None: 

1254 """ 

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

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

1257 

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

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

1260 will be overwritten!** 

1261 

1262 `The type of the bibliographic resource` 

1263 

1264 :return: None 

1265 """ 

1266 self._create_type(GraphEntity.iri_expression)