-
Notifications
You must be signed in to change notification settings - Fork 49
Rest contracts for qaevents, qatopics and qasources endpoints #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
9f630b7
486e8b5
b7c393f
8760a10
bb703a1
e41adc8
a19a5f5
8e885ef
3713042
aaa2366
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
## Main Endpoint | ||
**GET /api/integration/qaevents** | ||
|
||
_Unsupported._ The suggestions can be retrieved only by source and target or via direct link, see the single entry and search method below. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description should be updated, because these are "quality assurance events" not "suggestions". I think the term "suggestions" would be confusing to use here as it's also used heavily in #192 |
||
|
||
## GET Single suggestion | ||
** GET /api/integration/qaevents/<:qaevent-id> | ||
|
||
Return a single suggestion: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this should be "quality assurance event" not "suggestion" |
||
|
||
```json | ||
{ | ||
"id":"123e4567-e89b-12d3-a456-426614174000", | ||
"originalId": "oai:www.openstarts.units.it:10077/21486", | ||
"title":"Index nominum et rerum", | ||
"trust":"0.375", | ||
"eventDate": "2020/10/09 10:11 UTC", | ||
"status": "PENDING", | ||
"message" : { | ||
"type":"doi", | ||
"value":"10.18848/1447-9494/cgp/v15i09/45934", | ||
"abstracts":"Abstract Complex functionality of the ...", | ||
"acronym":"EPSILON", | ||
"code":"277749", | ||
"funder":"EC", | ||
"fundingProgram":"FP7", | ||
"jurisdiction":"EU", | ||
"title":"Elliptic Pdes and Symmetry of Interfaces and Layers for Odd Nonlinearities" | ||
}, | ||
type: "qaevent" | ||
} | ||
``` | ||
|
||
Attributes | ||
* the *id* attribute is the event primary key | ||
* the *originalId* attribute is the oai identifier of the target publication | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silly question perhaps. But, what is this called "originalId" instead of "oaiId"? What does the term "original" reference here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Original indicates that it is the id used by the event source to reference the publication that is the subject of the event itself. I will make the description of this attribute more general. |
||
* the *title* attribute is the title of the publication as provided by the correction's source | ||
* the *trust* attribute is the level of accuracy of the suggestion | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the value that comes back here is a fraction/percentage? Can we describe the value better? E.g. is it a percentage of trust? Does 1.0 mean 100% certain? I think we should provide more info to people who use this endpoint |
||
* the *status* attribute is one of (ACCEPTED, REJECTED, DISCARDED, PENDING) | ||
* the *eventDate* attribute is the timestamp of the event reception | ||
* the *message* attribute is a json object which structure depends on the source and on the topic of the event. When the "topic" type is | ||
* ENRICH/MISSING/PID and ENRICH/MORE/PID: fills `message.type` with the type of persistent identifier (doi, pmid, etc.) and `message.value` with the corresponding value | ||
* ENRICH/MISSING/ABSTRACT: fills `message.abstract` | ||
* ENRICH/MISSING/SUBJECT/ACM: fills the `message.value` with the actual keywords, the subject classification is defined by the last part of the topic (ACM, JEL, DDC, etc.) | ||
* ENRICH/MISSING/PROJECT: fills `acronym`, `code`, `funder`, `fundingProgram`, `jurisdiction` and `title` | ||
|
||
Exposed links: | ||
* topic: link to the topic to which the event belong to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description should probably reference the "qatopics" endpoint directly, to make it clear what the "topic" is here. Even saying "See qatopics endpoint" (with a link to those docs) is fine. |
||
* target: link to the item that represent the targe to whom the suggestion apply | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, we should not use the term "suggestion" here..probably "quality assurance event" or just "event". |
||
* related: link to a second item that is involved in the qa events (i.e. the project item) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the first time a "project item" is mentioned in these docs. Could we better describe what this second item is? Do all "qaevents" only act on Publications which have related Projects? Or is this Or should this link down to the POST section below about "associating a related item"? If so, maybe we can provide more details on that endpoint about when a related item is used. |
||
|
||
Status codes: | ||
* 200 Ok - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged as an administrator | ||
* 404 Not found - if no qa event exists with such id | ||
|
||
## Search methods | ||
### Get qaevents by a given topic | ||
**/api/integration/qaevents/search/findByTopic?topic=:target-key[&size=10&page=0]** | ||
|
||
It returns the list of qa events from a specific topic | ||
|
||
The supported parameters are: | ||
* page, size [see pagination](README.md#Pagination) | ||
* topic: mandatory, the key associated with the requested topic | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 400 Bad Request - if the topic parameter is missing or invalid | ||
|
||
Provide paginated list of the qa events available. | ||
|
||
## PATCH | ||
### To record a decision | ||
PATCH /api/integration/qaevents/<:qaevent-id> | ||
|
||
This method allow users to Accept, Reject or Discard a qa event. The PATCH body must follow the JSON PATCH specification | ||
|
||
```json | ||
[ | ||
{ | ||
"op": "replace", | ||
"path": "/status", | ||
"value": "ACCEPTED|REJECTED|DISCARDED|PENDING" | ||
} | ||
] | ||
``` | ||
|
||
As response, the modified qa event will be returned. | ||
|
||
## POST | ||
### To associated a related item to the qa event | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As implied above, I think we need more details about "related items". Are they always Project Items? Are they required? When or why would you need to "associate a related item"? |
||
POST /api/integration/qaevents/<:qaevent-id>/related?item=<:item-uri> | ||
|
||
Return codes: | ||
* 201 Created - if the operation succeed | ||
* 400 Bad Request - if the qa event doesn't allow a related item (i.e. it is not related to a */PROJECT topic) | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged as an administrator | ||
* 404 Not found - if no qa event exists with such id | ||
|
||
### To remove a related item to the qa event | ||
DELETE /api/integration/qaevents/<:qaevent-id>/related | ||
|
||
Only the association between the qa event and the related item id deleted. The related item stays untouched | ||
|
||
Return codes: | ||
* 204 No content - if the delete succeeded (including the case of no-op if the qa event didn't contain a related item) | ||
* 400 Bad Request - if the qa event doesn't allow a related item (i.e. it is not related to a */PROJECT topic) | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged as an administrator | ||
* 404 Not found - if no qa event exists with such id | ||
|
||
### To replace a related item | ||
Replacing a related item will require deleting the related association and creating a new association hereafter |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## Main Endpoint | ||
**GET /api/integration/qasources** | ||
|
||
Provide access to the Quality Assurance sources. It returns the list of the Quality Assurance sources. | ||
|
||
```json | ||
[ | ||
|
||
{ | ||
id: "openaire", | ||
type: "qasource", | ||
totalEvents: "33" | ||
}, | ||
{ | ||
id: "another-source", | ||
type: "qasource", | ||
lastEvent: "2020/10/09 10:11 UTC", | ||
totalEvents: "21" | ||
}, | ||
... | ||
] | ||
``` | ||
Attributes: | ||
* lastEvent: the date of the last update from the specific Quality Assurance source | ||
* totalEvents: the total number of suggestions provided by the Quality Assurance source | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please replace "suggestions" with "Quality Assurance Events" or just Events. We may also want to mention here that events can be found using the "qaevents" endpoint, as that'll help people find the related endpoints. |
||
* id: is the identifier to use in GET Single Source | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access | ||
|
||
## GET Single Source | ||
**GET /api/integration/qasources/<:qasource-id>** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @LucaGiamminonni, One thing I recall from our meeting was that we would create a generic mechanism for quality assurance.
in this specific case, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @paulo-graca, currently it is possible to search all topics given a source and all events related to a topic using the endpoints /api/integration/qatopics/search/bySource and /api/integration/qaevents/search/findByTopic. This also reflects the pages that are shown on the angular side: first all the sources, then all the topics of the selected source (or directly the topics of the only source if there is only one) and then all the events of the selected topic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @LucaGiamminonni for your comment. Perhaps we are in different mindset regarding this. I look at this as new generic feature that we will be available in DSpace that handles sources, events, topics for quality assurance, being source agnostic. Apart from the implementation your team already have, I see it to be very similar to external sources and authority and how it should be specified. Perhaps external entities and authority should be differently and could be based also on search/bySource. But for the matter of the scope of this PR, for coherency and consistency, to me, this specification should be very close to what we already have regarding handling different sources. |
||
| ||
Provide detailed information about a specific Quality Assurance source. The JSON response document is as follow | ||
| ||
```json | ||
{ | ||
id: "openaire", | ||
type: "qasource", | ||
totalEvents: "33" | ||
} | ||
``` | ||
| ||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access | ||
* 404 Not found - if the source doesn't exist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
## Main Endpoint | ||
**GET /api/integration/qatopics** | ||
|
||
Provide access to the Quality Assurance Broker topics. It returns the list of the Quality Assurance Broker topics. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we describe where these topics come from? Do these topics get assigned/set by the qasource? If so, we might say "It returns the list of Quality Assurance topics available from existing Quality Assurance Sources (see qasources endpoint)" or something similar. I think it's very important in these docs to link up related endpoints so we describe how they are related. |
||
|
||
```json | ||
[ | ||
|
||
{ | ||
id: "ENRICH!MORE!PID", | ||
type: "qatopic", | ||
name: "ENRICH/MORE/PID", | ||
lastEvent: "2020/10/09 10:11 UTC", | ||
totalSuggestions: "33" | ||
}, | ||
{ | ||
id: "ENRICH!MISSING!ABSTRACT", | ||
type: "qatopic", | ||
name: "ENRICH/MISSING/ABSTRACT", | ||
lastEvent: "2020/10/09 10:11 UTC", | ||
totalSuggestions: "21" | ||
}, | ||
... | ||
] | ||
``` | ||
Attributes: | ||
* name: the name of the topic to display on the frontend user interface | ||
* lastEvent: the date of the last update from Quality Assurance Broker | ||
* totalEvents: the total number of suggestions provided by Quality Assurance Broker for this topic | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, don't use "suggestions", use "events". And again, we may want to note that the list of events can be found via "qaevents" |
||
* id: is the identifier to use in GET Single Topic | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access | ||
|
||
## GET Single Topic | ||
**GET /api/integration/qatopics/<:qatopic-id>** | ||
| ||
Provide detailed information about a specific Quality Assurance Broker topic. The JSON response document is as follow | ||
| ||
```json | ||
{ | ||
id: "ENRICH!MORE!PID", | ||
type: "qatopic", | ||
name: "ENRICH/MORE/PID", | ||
lastEvent: "2020/10/09 10:11 UTC", | ||
totalEvents: 33 | ||
} | ||
``` | ||
| ||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access | ||
* 404 Not found - if the topic doesn't exist | ||
|
||
## Search methods | ||
### Get qatopics by a given source | ||
**/api/core/entitytypes/search/bySource** | ||
|
||
It returns the list of qa topics from a specific source | ||
|
||
The supported parameters are: | ||
* page, size [see pagination](README.md#Pagination) | ||
* source: mandatory, the name associated with a specific source | ||
|
||
Return codes: | ||
* 200 OK - if the operation succeed | ||
* 400 Bad Request - if the topic parameter is missing or invalid | ||
* 401 Unauthorized - if you are not authenticated | ||
* 403 Forbidden - if you are not logged in with sufficient permissions, only system administrators can access | ||
|
||
Provide paginated list of the qa topics available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere we should describe at a high level what a "QA Event" is and where it comes from. So, I'd expect there to be a summary section at the top which describes the concept...similar to how we have a summary section for the ORCID endpoints (see
orcidequeues.md
for example)