Coverage for oc_meta / constants.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-07-25 10:39 +0000

1#!/usr/bin/python 

2 

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

4# 

5# SPDX-License-Identifier: ISC 

6 

7from oc_ocdm.graph.graph_entity import GraphEntity 

8 

9 

10FORBIDDEN_IDS = {"issn:0000-0000"} 

11 

12BR_ID_SCHEMAS = frozenset( 

13 { 

14 "arxiv", 

15 "doi", 

16 "issn", 

17 "isbn", 

18 "jid", 

19 "openalex", 

20 "pmid", 

21 "pmcid", 

22 "url", 

23 "wikidata", 

24 "wikipedia", 

25 } 

26) 

27RA_ID_SCHEMAS = frozenset( 

28 { 

29 "crossref", 

30 "orcid", 

31 "viaf", 

32 "wikidata", 

33 "ror", 

34 } 

35) 

36 

37# QLever-optimized SPARQL query constants 

38QLEVER_BATCH_SIZE = 30 

39QLEVER_MAX_WORKERS = 24 

40QLEVER_QUERIES_PER_GROUP = 100 

41 

42VENUES = { 

43 "archival-document", 

44 "book", 

45 "book-part", 

46 "book-section", 

47 "book-series", 

48 "book-set", 

49 "edited-book", 

50 "journal", 

51 "journal-volume", 

52 "journal-issue", 

53 "monograph", 

54 "proceedings-series", 

55 "proceedings", 

56 "reference-book", 

57 "report-series", 

58 "standard-series", 

59} 

60CONTAINER_EDITOR_TYPES = { 

61 "book chapter", 

62 "book part", 

63 "book section", 

64 "book track", 

65 "component", 

66 "proceedings article", 

67 "reference entry", 

68} 

69VALID_ENTITY_TYPES = frozenset( 

70 { 

71 "abstract", 

72 "archival document", 

73 "audio document", 

74 "book", 

75 "book chapter", 

76 "book part", 

77 "book section", 

78 "book series", 

79 "book set", 

80 "computer program", 

81 "data file", 

82 "data management plan", 

83 "dataset", 

84 "dissertation", 

85 "editorial", 

86 "journal", 

87 "journal article", 

88 "journal editorial", 

89 "journal issue", 

90 "journal volume", 

91 "newspaper", 

92 "newspaper article", 

93 "newspaper editorial", 

94 "newspaper issue", 

95 "peer review", 

96 "preprint", 

97 "presentation", 

98 "proceedings", 

99 "proceedings article", 

100 "proceedings series", 

101 "reference book", 

102 "reference entry", 

103 "retraction notice", 

104 "series", 

105 "report", 

106 "standard", 

107 "web content", 

108 } 

109) 

110 

111# Constants for bibliographic resources that cannot contain other resources 

112ROOT_CONTAINER_TYPES = { 

113 GraphEntity.iri_journal_article, # fabio:JournalArticle 

114 GraphEntity.iri_book_chapter, # fabio:BookChapter 

115 GraphEntity.iri_proceedings_paper, # fabio:ProceedingsPaper 

116 GraphEntity.iri_journal_editorial, # fabio:JournalEditorial 

117 GraphEntity.iri_newspaper_article, # fabio:NewspaperArticle 

118 GraphEntity.iri_newspaper_editorial, # fabio:NewspaperEditorial 

119 GraphEntity.iri_reference_entry, # fabio:ReferenceEntry 

120 GraphEntity.iri_retraction_notice, # fabio:RetractionNotice 

121 GraphEntity.iri_peer_review, # fabio:PeerReview 

122 GraphEntity.iri_data_file, # fabio:DataFile 

123 GraphEntity.iri_computer_program, # fabio:ComputerProgram 

124 GraphEntity.iri_presentation, # fabio:Presentation 

125 GraphEntity.iri_web_content, # fabio:WebContent 

126 GraphEntity.iri_data_management_plan, # fabio:DataManagementPlan 

127 GraphEntity.iri_abstract, # fabio:Abstract 

128 GraphEntity.iri_editorial, # fabio:Editorial 

129 GraphEntity.iri_preprint, # fabio:Preprint 

130}