Commit d578d11f authored by Matija Obreza's avatar Matija Obreza

Implemented /glis/v1/holders call

parent a0f4a756
# DOIArray
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dois** | **List<String>** | | [optional]
# DOIHolder
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**doi** | **String** | | [optional]
**holderwiews** | **String** | | [optional]
......@@ -4,11 +4,66 @@ All URIs are relative to *https://glistest.planttreaty.org*
Method | HTTP request | Description
------------- | ------------- | -------------
[**listHolders**](QueryApi.md#listHolders) | **POST** /glisapi/v1/holders | Query for holder of PGRFA by DOIs
[**listRelationships**](QueryApi.md#listRelationships) | **GET** /glisapi/v1/rels | Get PGRFA relationships
[**listTerms**](QueryApi.md#listTerms) | **GET** /glisapi/v1/terms | GLIS vocabularies
[**search**](QueryApi.md#search) | **GET** /glisapi/v1/pgrfas | Find passport data on PGRFA in GLIS
<a name="listHolders"></a>
# **listHolders**
> List&lt;DOIHolder&gt; listHolders(dois)
Query for holder of PGRFA by DOIs
Query GLIS for WIEWS code of the holder for each submitted DOI. At this time, the call has a limit of 1,000 DOIs.
### Example
```java
// Import classes:
//import org.genesys.glis.v1.invoker.ApiClient;
//import org.genesys.glis.v1.invoker.ApiException;
//import org.genesys.glis.v1.invoker.Configuration;
//import org.genesys.glis.v1.invoker.auth.*;
//import org.genesys.glis.v1.api.QueryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: easySmta
HttpBasicAuth easySmta = (HttpBasicAuth) defaultClient.getAuthentication("easySmta");
easySmta.setUsername("YOUR USERNAME");
easySmta.setPassword("YOUR PASSWORD");
QueryApi apiInstance = new QueryApi();
DOIArray dois = new DOIArray(); // DOIArray |
try {
List<DOIHolder> result = apiInstance.listHolders(dois);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling QueryApi#listHolders");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**dois** | [**DOIArray**](DOIArray.md)| | [optional]
### Return type
[**List&lt;DOIHolder&gt;**](DOIHolder.md)
### Authorization
[easySmta](../README.md#easySmta)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="listRelationships"></a>
# **listRelationships**
> List&lt;Relationship&gt; listRelationships(doi, role, oper)
......
......@@ -23,6 +23,8 @@ import java.util.Arrays;
import java.util.List;
import org.genesys.glis.v1.invoker.ApiException;
import org.genesys.glis.v1.model.DOIArray;
import org.genesys.glis.v1.model.DOIHolder;
import org.genesys.glis.v1.model.PGRFA;
import org.genesys.glis.v1.model.Relationship;
import org.genesys.glis.v1.model.Term;
......@@ -110,4 +112,21 @@ public class QueryApiTest extends BaseApiTest {
// assertThat(response.size(), greaterThan(0));
}
/**
* Get PGRFA relationships
*
* Multiple status values can be provided with comma separated strings
*
* @throws ApiException if the Api call fails
*/
@Test
public void listDOIHolders() throws ApiException {
DOIArray dois=new DOIArray();
dois.addDoisItem(THE_DOI);
List<DOIHolder> response = api.listHolders(dois);
// GLIS test environment is occasionally cleaned
// assertThat(response.size(), greaterThan(0));
}
}
......@@ -457,6 +457,41 @@ paths:
"term": "bioinformatics"
}]
/glisapi/v1/holders:
post:
tags:
- query
summary: Query for holder of PGRFA by DOIs
description: >-
Query GLIS for WIEWS code of the holder for each submitted DOI. At this time, the call has a limit of 1,000 DOIs.
operationId: listHolders
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: dois
schema:
$ref: '#/definitions/DOIArray'
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/DOIHolder'
examples:
application-json: >-
[{
"doi": "10.0155/WW",
"holdwiews": "PHL001"
}, {
"doi": "10.0155/XX",
"holdwiews": "PHL001"
}]
securityDefinitions:
easySmta:
type: basic
......@@ -802,6 +837,34 @@ definitions:
format: date-time
description: >-
The date of DOI registration to the DataCite registry. If this element is missing or null, the DOI has not been registered yet and should therefore not be used in publications
DOIArray:
title: Wrapper object for array of DOIs
description: >-
Used for DOI holder check.
type: object
properties:
dois:
type: array
items:
type: string
example:
- '10.0155/WW'
- '10.0155/XX'
DOIHolder:
title: WIEWS code of DOI holder
description: ->
type: object
properties:
doi:
type: string
example: '10.0155/WW'
holderwiews:
type: string
example: 'PHL001'
ApiError:
type: object
properties:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment