Finalise get single entities

This commit is contained in:
Serafeim Chatzopoulos 2024-07-09 16:49:51 +03:00
parent 94e96f64b5
commit 0b092111e2
2 changed files with 15 additions and 65 deletions

View File

@ -13,56 +13,24 @@ Currently, the Graph API supports the following entity types:
- Data sources - endpoint: `GET /dataSources/{id}`
- Projects - endpoint: `GET /projects/{id}`
It is evident that you can retrieve the data of a single entity by providing the entity's unique OpenAIRE identifier (id) in the corresponding endpoint.
You can find more details about OpenAIRE identifiers [here](../../data-model/pids-and-identifiers).
You can retrieve the data of a single entity by providing the entity's OpenAIRE identifier (id) in the corresponding endpoint.
The OpenAIRE id is the primary key of an entity in the OpenAIRE Graph.
:::info
Note that if you want to retrieve multiple entities based on their OpenAIRE ids, you can use the [search endpoints and filter](./search-entities/filter-search-results) by the `id` field using `OR`.
:::
## Response
The response of the Graph API is a [Research Product](../../data-model/entities/research-product), [Organization](../../data-model/entities/organization), [Data Source](../../data-model/entities/data-source), or [Project](../../data-model/entities/project), depending on the endpoint used.
The response of the Graph API is a [Research product](../../data-model/entities/research-product), [Organization](../../data-model/entities/organization), [Data Source](../../data-model/entities/data-source), or [Project](../../data-model/entities/project), depending on the endpoint used.
## Examples
Here are some examples of how to retrieve single entity records using the Graph API. Please, navigate through the tabs to see the examples for each entity type.
## Example
### Research products
Get the research product with the OpenAIRE identifier `doi_dedup___::2b3cb7130c506d1c3a05e9160b2c4108`:
In order to retrieve the research product with OpenAIRE id: `doi_dedup___::2b3cb7130c506d1c3a05e9160b2c4108`,
you have to perform the following API call:
[`https://openaire-api.athenarc.gr/researchProducts/doi_dedup___::2b3cb7130c506d1c3a05e9160b2c4108`](https://openaire-api.athenarc.gr/researchProducts/doi_dedup___::2b3cb7130c506d1c3a05e9160b2c4108)
or using code:
<Tabs>
<TabItem value="research-product-curl" label="Curl">
```bash
curl -X GET "https://openaire-api.athenarc.gr/researchProducts/doi_dedup___::2b3cb7130c506d1c3a05e9160b2c4108" -H "accept: application/json"
```
</TabItem>
<TabItem value="research-product-python" label="Python">
```python
import requests
url = "https://openaire-api.athenarc.gr/researchProducts/doi_dedup___::2b3cb7130c506d1c3a05e9160b2c4108"
headers = {
"accept": "application/json"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f"Request failed with status code {response.status_code}")
```
</TabItem>
</Tabs>
This API call will return all the data of the research product with the given identifier:
This will return all the data of the research product with the provided identifier:
```json
{
@ -71,21 +39,6 @@ This API call will return all the data of the research product with the given id
"description": [
"Analyzing political conservatism as motivated social cognition integrates theories of personality (authoritarianism, dogmatism-intolerance of ambiguity), epistemic and existential needs (for closure, regulatory focus, terror management), and ideological rationalization (social dominance, system justification). A meta-analysis (88 samples, 12 countries, 22,818 cases) confirms that several psychological variables predict political conservatism: death anxiety (weighted mean r = .50); system instability (.47); dogmatism-intolerance of ambiguity (.34); openness to experience (-.32); uncertainty tolerance (-.27); needs for order, structure, and closure (.26); integrative complexity (-.20); fear of threat and loss (.18); and self-esteem (-.09). The core ideology of conservatism stresses resistance to change and justification of inequality and is motivated by needs that vary situationally and dispositionally to manage uncertainty and threat."
],
"author": [
{
"fullName": "John T, Jost",
"name": "John T",
"surname": "Jost",
"rank": 1,
"pid": {
"id": {
"scheme": "orcid",
"value": "0000-0002-2844-4645"
},
"provenance": null
}
}
],
"type": "publication",
"publicationDate": "2003-01-01",
"publisher": "American Psychological Association (APA)",
@ -96,10 +49,6 @@ This API call will return all the data of the research product with the given id
{
"scheme": "Digital Object Identifier",
"value": "10.1037/0033-2909.129.3.339"
},
{
"scheme": "PubMed ID",
"value": "12784935"
}
],
// for brevity, the rest of the fields are omitted

View File

@ -1,16 +1,16 @@
# Graph API
The OpenAIRE Graph API provides a comprehensive way for developers to explore the [OpenAIRE Graph](https://graph.openaire.eu/), a vast interconnected dataset that aggregates metadata from a wide range of scholarly resources.
The Graph API offers endpoints for accessing and querying this interconnected dataset, enabling users to retrieve detailed information on research products, organizations, data sources, and projects.
The Graph API offers endpoints for accessing and querying this interconnected dataset, enabling users to retrieve detailed information on research products, data sources, organizations, and projects.
## Base URL and Swagger documentation
The base URL of the Graph API is:
```
https://openaire-api.athenarc.gr/api
https://openaire-api.athenarc.gr/
```
You can access the API documentation in [api.openaire.eu/graph-api](https://openaire-api.athenarc.gr/swagger-ui/index.html#/).
You can access the API Swagger documentation in [https://openaire-api.athenarc.gr/swagger-ui/index.html#/](https://openaire-api.athenarc.gr/swagger-ui/index.html#/).
## Notes
Please note that the Graph API:
@ -27,3 +27,4 @@ Please use the following links to learn more about the Graph API:
- [Filter search results](./search-entities/filter-search-results) - Filter search results based on specific criteria.
- [Sort search results](./search-entities/sort-search-results) - Sort search results based on specific criteria.
- [Pagination](./search-entities/pagination) - Retrieve a subset of search results.
- [Making requests](./making-requests) - Learn how to make requests with different programming languages.