Skip to content

Commit 18a4b67

Browse files
Merge pull request #292 from semantic-systems/develop
Enhancements reviewed and approved.
2 parents a32c2d0 + e34e2f1 commit 18a4b67

32 files changed

+736
-1947
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ ENV/
110110
env.bak/
111111
venv.bak/
112112

113+
# vs code
114+
.vscode
115+
113116
# Spyder project settings
114117
.spyderproject
115118
.spyproject

config.py

Lines changed: 143 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,125 +18,207 @@ class Config:
1818

1919
NUMBER_OF_RECORDS_TO_SHOW_ON_PAGE_LOAD = 20
2020
NUMBER_OF_RECORDS_TO_APPEND_ON_LAZY_LOAD = 10
21-
2221
NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT = 100
2322

2423
DATE_FORMAT_FOR_REPORT = "%B %d, %Y"
2524
DATE_FORMAT_FOR_ELASTIC = "%Y-%m-%d"
2625

2726
DATA_SOURCES = {
28-
# "dblp - Publications": {
29-
# "module": "dblp_publications",
30-
# "search-endpoint": f"https://dblp.org/search/publ/api?format=json&h={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
31-
# },
32-
# #######Though DBLP has an endpoint for researchers but their details are minimal hence should not be harvested.
33-
# "dblp-Researchers": {
34-
# "module": "dblp_researchers",
35-
# "search-endpoint": f"https://dblp.org/search/author/api?format=json&h={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
36-
# },
27+
3728
"GESIS KG": {
29+
"logo": {
30+
"src": "gesis.svg",
31+
"width": "w-100",
32+
"height": "h-70",
33+
},
3834
"module": "gesis_kg_publication",
3935
"search-endpoint": f"https://data.gesis.org/gesiskg/sparql?default-graph-uri=&query=",
4036
},
4137
"GESIS KG - Dataset": {
38+
"logo": {
39+
"src": "gesis.svg",
40+
"width": "w-100",
41+
"height": "h-70",
42+
},
4243
"module": "gesis_kg_dataset",
4344
"search-endpoint": f"https://data.gesis.org/gesiskg/sparql?default-graph-uri=&query=",
4445
},
4546
"OPENALEX - Publications": {
47+
"logo": {
48+
"src": "openalex.png",
49+
"width": "w-100",
50+
"height": "h-100",
51+
},
4652
"module": "openalex_publications",
4753
"search-endpoint": f"https://api.openalex.org/works?page=1&per-page={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&search=",
4854
"get-publication-endpoint": "https://api.openalex.org/works/",
4955
"get-researcher-publications-endpoint": "https://api.openalex.org/works?filter=author.id:",
5056
},
5157
"OPENALEX - Researchers": {
58+
"logo": {
59+
"src": "openalex.png",
60+
"width": "w-100",
61+
"height": "h-100",
62+
},
5263
"module": "openalex_researchers",
5364
"search-endpoint": f"https://api.openalex.org/authors?page=1&per-page={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&search=",
5465
"get-researcher-endpoint": "https://api.openalex.org/authors/",
5566
"get-researcher-publications-endpoint": "https://api.openalex.org/works?filter=author.id:",
5667
},
5768
"ZENODO": {
69+
"logo": {
70+
"src": "zenodo.png",
71+
"width": "w-100",
72+
"height": "h-100",
73+
},
5874
"module": "zenodo",
5975
"search-endpoint": f"https://zenodo.org/api/records?size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
6076
"get-publication-endpoint": f"https://zenodo.org/api/records/",
6177
},
6278
"WIKIDATA - Publications": {
79+
"logo": {
80+
"src": "wikidata.png",
81+
"width": "w-100",
82+
"height": "h-100",
83+
},
6384
"module": "wikidata_publications",
6485
"search-endpoint": f"https://query.wikidata.org/sparql?format=json&query=",
6586
},
6687
"WIKIDATA - Researchers": {
88+
"logo": {
89+
"src": "wikidata.png",
90+
"width": "w-100",
91+
"height": "h-100",
92+
},
6793
"module": "wikidata_researchers",
6894
"search-endpoint": f"https://query.wikidata.org/sparql?format=json&query=",
69-
},
70-
# "resodate": {
71-
# "module": "resodate",
72-
# "search-endpoint": f"https://resodate.org/resources/api/search/oer_data/_search?pretty&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
73-
# },
74-
# "OERSI": {
75-
# "module": "oersi",
76-
# "search-endpoint": f"https://oersi.org/resources/api/search/oer_data/_search?pretty&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
77-
# },
78-
"IEEE": {
79-
"module": "ieee",
80-
"search-endpoint": f"http://ieeexploreapi.ieee.org/api/v1/search/articles?apikey={IEEE_API_KEY}&max_records={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&querytext=",
81-
"get-publication-endpoint": f"http://ieeexploreapi.ieee.org/api/v1/search/articles?apikey={IEEE_API_KEY}&doi=",
82-
},
83-
# "EUDAT": {
84-
# "module": "eudat",
85-
# "search-endpoint": f"https://b2share.eudat.eu/api/records/?page=1&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&sort=bestmatch&q=",
86-
# "record-base-url": f"https://b2share.eudat.eu/records/",
87-
# },
95+
},
8896
"OPENAIRE - Products": {
97+
"logo": {
98+
"src": "openaire.webp",
99+
"width": "w-100",
100+
"height": "h-100",
101+
},
89102
"module": "openaire_products",
90103
"search-endpoint": f"https://api.openaire.eu/search/researchProducts?format=json&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&keywords=",
91104
"get-publication-endpoint": f"https://api.openaire.eu/search/researchProducts?format=json&doi=",
92105
},
93106
"OPENAIRE - Projects": {
107+
"logo": {
108+
"src": "openaire.webp",
109+
"width": "w-100",
110+
"height": "h-100",
111+
},
94112
"module": "openaire_projects",
95113
"search-endpoint": f"https://api.openaire.eu/search/projects?format=json&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&keywords=",
96114
},
97115
"ORCID": {
116+
"logo": {
117+
"src": "orcid.svg",
118+
"width": "w-100",
119+
"height": "h-100",
120+
},
98121
"module": "orcid",
99122
"search-endpoint": f"https://pub.orcid.org/v3.0/expanded-search/?start=0&rows={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
100-
},
101-
# "GESIS": {
102-
# "module": "gesis",
103-
# "search-endpoint": f"http://193.175.238.35:8089/dc/_search?size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
104-
# },
105-
# "CORDIS": {
106-
# "module": "cordis",
107-
# "search-endpoint": f"https://cordis.europa.eu/search?p=1&num={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&srt=Relevance:decreasing&format=json&q=contenttype='project'%20AND%20",
108-
# },
109-
# "ORKG": {
110-
# "module": "orkg",
111-
# "search-endpoint": f"https://orkg.org/api/resources/?size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
112-
# },
113-
# "gepris": {
114-
# "module": "gepris",
115-
# "search-endpoint": f"https://gepris.dfg.de/gepris/OCTOPUS?context=projekt&hitsPerPage=1&index=0&language=en&task=doSearchSimple&keywords_criterion=",
116-
# },
123+
},
117124
"CROSSREF - Publications": {
125+
"logo": {
126+
"src": "crossref.svg",
127+
"width": "w-100",
128+
"height": "h-60",
129+
},
118130
"module": "crossref_publications",
119131
"search-endpoint": f"https://api.crossref.org/works?rows={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&query=",
120132
"get-publication-endpoint": "https://api.crossref.org/works/",
121133
"get-publication-references-endpoint": "https://api.crossref.org/works/",
122134
},
123135
"SEMANTIC SCHOLAR - Publications": {
136+
"logo": {
137+
"src": "semanticscholar.png",
138+
"width": "w-100",
139+
"height": "h-100",
140+
},
124141
"module": "semanticscholar_publications",
125142
# "search-endpoint": f"",
126143
# "get-publication-endpoint": "https://api.semanticscholar.org/graph/v1/paper/",
127144
"citations-endpoint": f"https://api.semanticscholar.org/graph/v1/paper/",
128145
"recommendations-endpoint": f"https://api.semanticscholar.org/recommendations/v1/papers/forpaper/",
129146
},
130147
"SEMANTIC SCHOLAR - Researchers": {
148+
"logo": {
149+
"src": "semanticscholar.png",
150+
"width": "w-100",
151+
"height": "h-100",
152+
},
131153
"module": "semanticscholar_researchers",
132154
# "search-endpoint": f"",
133155
# "get-researcher-endpoint": f"https://api.semanticscholar.org/graph/v1/author/",
134156
},
135157
"RE3DATA": {
158+
"logo": {
159+
"src": "re3data.png",
160+
"width": "w-100",
161+
"height": "h-100",
162+
},
136163
"module": "re3data",
137164
"search-endpoint": f"https://www.re3data.org/api/beta/repositories?query=",
138165
"get-resource-endpoint": f"https://www.re3data.org/api/v1/repository/"
139166
},
167+
"DBLP - VENUES": {
168+
"logo": {
169+
"src": "dblp.png",
170+
"width": "w-100",
171+
"height": "h-100",
172+
},
173+
"module": "dblp_venues",
174+
"search-endpoint": f"https://dblp.org/search/venue/api?format=json&h={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
175+
},
176+
177+
178+
# "dblp - Publications": {
179+
# "module": "dblp_publications",
180+
# "search-endpoint": f"https://dblp.org/search/publ/api?format=json&h={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
181+
# },
182+
# #######Though DBLP has an endpoint for researchers but their details are minimal hence should not be harvested.
183+
# "dblp-Researchers": {
184+
# "module": "dblp_researchers",
185+
# "search-endpoint": f"https://dblp.org/search/author/api?format=json&h={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
186+
# },
187+
# "resodate": {
188+
# "module": "resodate",
189+
# "search-endpoint": f"https://resodate.org/resources/api/search/oer_data/_search?pretty&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
190+
# },
191+
# "OERSI": {
192+
# "module": "oersi",
193+
# "search-endpoint": f"https://oersi.org/resources/api/search/oer_data/_search?pretty&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
194+
# },
195+
# "IEEE": { #IEEE API key is not working, therefore this has been disabled for now.
196+
# "logo": {
197+
# "src": "ieee.gif",
198+
# "width": "w-100",
199+
# "height": "h-70",
200+
# },
201+
# "module": "ieee",
202+
# "search-endpoint": f"http://ieeexploreapi.ieee.org/api/v1/search/articles?apikey={IEEE_API_KEY}&max_records={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&querytext=",
203+
# "get-publication-endpoint": f"http://ieeexploreapi.ieee.org/api/v1/search/articles?apikey={IEEE_API_KEY}&doi=",
204+
# },
205+
# "EUDAT": {
206+
# "module": "eudat",
207+
# "search-endpoint": f"https://b2share.eudat.eu/api/records/?page=1&size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&sort=bestmatch&q=",
208+
# "record-base-url": f"https://b2share.eudat.eu/records/",
209+
# },
210+
# "CORDIS": {
211+
# "module": "cordis",
212+
# "search-endpoint": f"https://cordis.europa.eu/search?p=1&num={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&srt=Relevance:decreasing&format=json&q=contenttype='project'%20AND%20",
213+
# },
214+
# "ORKG": {
215+
# "module": "orkg",
216+
# "search-endpoint": f"https://orkg.org/api/resources/?size={NUMBER_OF_RECORDS_FOR_SEARCH_ENDPOINT}&q=",
217+
# },
218+
# "gepris": {
219+
# "module": "gepris",
220+
# "search-endpoint": f"https://gepris.dfg.de/gepris/OCTOPUS?context=projekt&hitsPerPage=1&index=0&language=en&task=doSearchSimple&keywords_criterion=",
221+
# },
140222
}
141223

142224
LLMS = {
@@ -167,6 +249,21 @@ class Config:
167249
"settings_file_publications": "static/weights/publications-settings.json",
168250
}
169251

252+
# MAPPING_PREFERENCE is used to map the fields from the platform responses to the objects in objects.py
253+
# i.e. abstracts from publications are first taken from OPENALEX - Publications, then from CROSSREF - Publications, etc.
254+
MAPPING_PREFERENCE = {
255+
"researchers": {
256+
"__default__": ["OPENALEX - Researchers", "ORCID"],
257+
"identifier": ["ORCID", "OPENALEX - Researchers"],
258+
},
259+
"publications": {
260+
"__default__": ["CROSSREF - Publications", "OPENALEX - Publications", "OPENAIRE - Products"],
261+
"abstract": ["OPENALEX - Publications", "CROSSREF - Publications", "OPENAIRE - Products"],
262+
"reference": ["CROSSREF - Publications"],
263+
"citation": ["CROSSREF - Publications"],
264+
}
265+
}
266+
170267
# ELASTIC = {
171268
# "server": os.environ.get('ELASTIC_SERVER',""),
172269
# "username": os.environ.get('ELASTIC_USERNAME',""),

0 commit comments

Comments
 (0)