Skip to content

Commit cbc4e14

Browse files
author
andrei
committed
Merge branch 'master' into webpack-optimization
2 parents 46a8a4b + 54a69da commit cbc4e14

15 files changed

Lines changed: 1258 additions & 715 deletions

conf/config.php

Lines changed: 152 additions & 104 deletions
Large diffs are not rendered by default.

css/search_box.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ body.iframed {
249249
cursor: pointer;
250250
}
251251

252+
.submit-btn:disabled {
253+
background-color: #cacfd3;
254+
color: white;
255+
border-color: #cacfd3;
256+
}
257+
252258
.options {
253259
margin-bottom: 20px;
254260
display: flex;

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
version: '3.7'
1+
version: "3.7"
22

33
services:
4-
54
searchflow:
65
build: searchflow-container
76
volumes:

docs/swagger-searchbox.yml.template

Lines changed: 138 additions & 30 deletions
Large diffs are not rendered by default.

docs/swagger.yml.template

Lines changed: 88 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.0
22
info:
33
title: OKMaps Parameterized Search and Visualisation Service
44
description: |
5-
This is an entry point into the automatic pipeline that leads users directly to a visualisation based on either BASE, PubMed or OpenAIRE data. The entry point is a parameterized search/waiting page that accepts URL-encoded parameters. In this sense, it is functionally similar to a HTTP-GET interface.
5+
This is an entry point into the automatic pipeline that leads users directly to a visualisation based on either BASE, PubMed, OpenAIRE, or ORCID data. The entry point is a parameterized search/waiting page that accepts URL-encoded parameters. In this sense, it is functionally similar to a HTTP-GET interface.
66

77
However, the service is not returning a raw data representation of a visualisation, but rather a web page that triggers the creation of the visualisation. Therefore, the service entry point does not conform to the strict definition of a HTTP-GET interface.
88

@@ -74,11 +74,11 @@ paths:
7474

7575
It is possible to search directly in individual fields as described in the [BASE Interface Guide](https://www.base-search.net/about/download/base_interface.pdf), Appendix 1.2 Fields. For example:
7676

77-
* `dcorcid:0000-0002-1894-5040` This will create a knowledge map of documents created by the author with the specified ORCiD. Please be aware however that we are dependent on the metadata coverage in BASE. Currently, only a subset of the outputs linked to an ORCiD profile can be retrieved. BASE is actively working on improving the coverage.
77+
* `dcorcid:0000-0002-1894-5040` This will create a knowledge map of documents created by the author with the specified ORCID. Please be aware however that we are dependent on the metadata coverage in BASE. Currently, only a subset of the outputs linked to an ORCID profile can be retrieved. BASE is actively working on improving the coverage.
7878

7979
* `dcrelation:"https://zenodo.org/communities/biosyslit"` This will create a knowledge map of documents with a specific Zenodo community mentioned in the relations field.
8080

81-
* `dccreator:"Lastname Firstname"` This will create a knowledge map of documents by a specified author. Please note that in contrast to an ORCiD, author names may not be unique.
81+
* `dccreator:"Lastname Firstname"` This will create a knowledge map of documents by a specified author. Please note that in contrast to an ORCID, author names may not be unique.
8282

8383
* `dccoverage:"Rocky Mountains"` This will create a knowledge map of documents containing research about the Rocky Mountains.
8484

@@ -225,8 +225,8 @@ paths:
225225

226226
Annotations **must** be added to the metadata in the `dcsubject` field, with the following
227227
format `prefix:annotation text`, and the custom_clustering parameter must match the `prefix`.
228-
If you add more than one annotation to a single document,
229-
e.g. `theme:invasion impact` and `theme:invasion success`. Only the first entry will be considered
228+
You can add more than one annotation to a single document,
229+
e.g. `theme:invasion impact` and `theme:invasion success` however only the first entry will be considered
230230
during data processing and is used to assign the document to a cluster on the map.
231231

232232
**Please note** the custom clustering only works if the annotations have been successfully
@@ -275,7 +275,7 @@ paths:
275275

276276
For PubMed, the query is relayed as-is, which means advanced PubMed syntax can be applied.
277277

278-
If the parameter is empty the link can’t be generated.
278+
**Warning:** If the parameter is empty the link can’t be generated.
279279
schema:
280280
type : string
281281
example: climate change
@@ -392,3 +392,85 @@ paths:
392392
responses:
393393
'200': # status code
394394
description: Redirecting to the waiting page
395+
396+
/search?type=get&service=orcid:
397+
get:
398+
summary: |
399+
Configure searches and create visualisations for researchers (Data source: ORCID).
400+
description: |
401+
This is an entry point into the automatic pipeline that leads users directly to a visualisation based on ORCID data.<br>
402+
**This endpoint is a prototype! Some features may still be rough around the edges.**
403+
404+
parameters:
405+
- in: query
406+
name: orcid
407+
required: true
408+
description: |
409+
Enter a valid ORCID, e.g. `0000-0002-5238-4195`.
410+
411+
**Please note** that ORCID also lists researchers which may not have any resources (publications,
412+
datasets or other types of works) associated with their profile. In this case the search will
413+
fail and display an error message. If a profile is set to private, a search for this ORCID
414+
will also fail and display an error message.
415+
416+
schema:
417+
type: string
418+
- in: query
419+
name: limit
420+
required: false
421+
description: |
422+
This parameter sets an upper limit for the number of documents included in a knowledge map.
423+
424+
**Please note** that if an author has more works in their ORCID profile than the provided limit _N_,
425+
only the most recent _N_ works will be displayed as a knowledge map. We recommend keeping _N_
426+
below 200 because higher values will have a significant impact on the User Experience. You may
427+
notice a significant delay, for example zooming into a bubble might take
428+
several seconds until the interaction is completed.
429+
430+
If the parameter is not provided, it defaults to `200`.
431+
schema:
432+
type: integer
433+
default: 200
434+
- in: query
435+
name: academic_age_offset
436+
required: false
437+
description: |
438+
Define a value that will be added to the _academic age_ metric. For example: The academic age
439+
of the researcher is 17 and the `academic_age_offset` you defined is 3, in this case
440+
the academic age of the researcher will be 20.
441+
442+
**Please note** we are using the following definition for academic age: _number of years since PhD_.
443+
444+
If the parameter is not provided, it defaults to `0`.
445+
schema:
446+
type: integer
447+
default: 0
448+
- in: query
449+
name: enable_h_index
450+
required: false
451+
description: |
452+
Display or hide the _h-index_ in the _Metrics_ pop-up.
453+
454+
`false` means the _h-index_ will not be included in the _Metrics_ pop-up.
455+
`true` means the _h-index_ will be displayed in the _Metrics_ pop-up.
456+
457+
If the parameter is not provided, it defaults to `false`.
458+
schema:
459+
type: boolean
460+
- in: query
461+
name: enable_teaching_mentorship
462+
required: false
463+
description: |
464+
Display or hide the _teaching and mentorship metrics_ in the _Metrics_ pop-up.
465+
466+
**Please note** these metrics do not work out of the box. If you are interested in these metrics please consult our handbook for more information.
467+
468+
`false` means the _teaching and mentorship metrics_ will not be included in the _Metrics_ pop-up.
469+
`true` means the _teaching and mentorship metrics_ will be displayed in the _Metrics_ pop-up.
470+
471+
If the parameter is not provided, it defaults to `false`.
472+
schema:
473+
type: boolean
474+
responses:
475+
'200': # status code
476+
description: Redirecting to the waiting page

inc/visualization/visualization-header.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,19 @@
2626
$is_embed = getParam("embed", INPUT_GET, FILTER_VALIDATE_BOOLEAN, true) || $search_flow_config["force_embed"];
2727

2828
if($search_flow_config["vis_load_context"]) {
29+
// the following request should respond with the proper error code, e.g. a 503 for db connection errors
2930
if ($docker_internal) {
3031
$context_json = curl_get_contents($protocol . $headstart_path_docker_internal . "server/services/getContext.php?vis_id=$id");
3132
} else {
3233
$context_json = curl_get_contents($protocol . $headstart_path . "server/services/getContext.php?vis_id=$id");
3334
}
35+
// This is the earliest we can possibly know that the context could not be loaded
36+
// We probably already want to throw a 404 here
37+
// error_log("visalization-header.php Context JSON: " . $context_json);
38+
// Check if context is not available yet
39+
// if it does reply with an error code we should bail before anything else happens
40+
// instead of rendering vis page we should render an error page with the error code
41+
// either by a redirect to a dedicated error page or by rendering the error page directly
3442
$context = json_decode($context_json);
3543

3644
$service = setVariableFromContext($context

0 commit comments

Comments
 (0)