Data Sources
Models
Pydantic models for representing OpenAIRE Data Source entities and related structures.
This module defines the Pydantic model for an OpenAIRE Data Source, including nested models for controlled vocabulary fields and type literals for restricted string values based on the OpenAIRE data model documentation. Reference: https://graph.openaire.eu/docs/data-model/entities/data-source
DataSourceResponse = ApiResponse[DataSource]
module-attribute
Type alias for an API response containing a list of DataSource
entities.
ControlledField
Bases: BaseModel
Represents a field with a controlled vocabulary, typically including a scheme and a value.
This model is used for structured data elements where the value has a specific meaning defined by an associated scheme (e.g., a PID like DOI, or a subject classification from a specific thesaurus).
Attributes:
Name | Type | Description |
---|---|---|
scheme |
str | None
|
The scheme or system defining the context of the value (e.g., "doi", "orcid", "mesh"). |
value |
str | None
|
The actual value from the controlled vocabulary. |
Source code in src/aireloom/models/data_source.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
DataSource
Bases: BaseEntity
Model representing an OpenAIRE Data Source entity.
A data source in OpenAIRE can be a repository, journal, aggregator, etc. This model captures various metadata fields associated with a data source.
Source code in src/aireloom/models/data_source.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
Filters
Bases: BaseModel
Filter model for Data Sources API endpoint. Represents an author of a research product.
Attributes:
Name | Type | Description |
---|---|---|
search |
str | None
|
Search term for the data source. |
officialName |
str | None
|
Official name of the data source. |
englishName |
str | None
|
English name of the data source. |
legalShortName |
str | None
|
Legal short name of the data source. |
id |
str | None
|
OpenAIRE id for the data source. |
pid |
str | None
|
Persistent identifier for the data source. |
subjects |
list[str] | None
|
List of subjects associated with the data source. |
dataSourceTypeName |
str | None
|
Type name of the data source. |
contentTypes |
list[str] | None
|
List of content types available in the data source. |
openaireCompatibility |
str | None
|
Compatibility status with OpenAIRE standards. |
relOrganizationId |
str | None
|
Related organization ID. |
relCommunityId |
str | None
|
Related community ID. |
relCollectedFromDatasourceId |
str | None
|
ID of the datasource from which this was collected. |
Source code in src/aireloom/endpoints.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
Client
Client for interacting with the OpenAIRE Data Sources API endpoint.
This module provides the DataSourcesClient
for accessing OpenAIRE's
data source information. Like the OrganizationsClient
, it currently uses
custom implementations for get
, search
, and iterate
operations.
DataSourcesClient
Bases: BaseResourceClient
Client for the OpenAIRE Data Sources API endpoint.
This client allows interaction with OpenAIRE's data source entities,
offering methods for retrieval (get
), searching (search
), and iteration
(iterate
). It currently employs custom logic for these operations.
Attributes:
Name | Type | Description |
---|---|---|
_entity_path |
str
|
The API path for data sources. |
_entity_model |
type[DataSource]
|
Pydantic model for a single data source. |
_response_model |
type[DataSourceResponse]
|
Pydantic model for the search response envelope. |
_endpoint_def |
dict
|
Configuration for this endpoint from |
_valid_sort_fields |
set[str]
|
Valid sort fields for this endpoint. |
Source code in src/aireloom/resources/data_sources_client.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
__init__(api_client)
Initializes the DataSourcesClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of AireloomClient. |
required |
Source code in src/aireloom/resources/data_sources_client.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
get(source_id)
async
Retrieves a single Data Source by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id
|
str
|
The ID of the data source. |
required |
Returns:
Type | Description |
---|---|
DataSource
|
A DataSource object. |
Source code in src/aireloom/resources/data_sources_client.py
211 212 213 214 215 216 217 218 219 220 221 |
|
iterate(page_size=100, sort_by=None, filters=None)
async
Iterates through all Data Source results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_size
|
int
|
Number of results per page during iteration. |
100
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
DataSourcesFilters | None
|
An instance of DataSourcesFilters with filter criteria. |
None
|
Yields:
Type | Description |
---|---|
AsyncIterator[DataSource]
|
DataSource objects. |
Source code in src/aireloom/resources/data_sources_client.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
search(page=1, page_size=DEFAULT_PAGE_SIZE, sort_by=None, filters=None)
async
Searches for Data Sources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int
|
Page number (1-indexed). |
1
|
page_size
|
int
|
Number of results per page. |
DEFAULT_PAGE_SIZE
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
DataSourcesFilters | None
|
An instance of DataSourcesFilters with filter criteria. |
None
|
Returns:
Type | Description |
---|---|
DataSourceResponse
|
A DataSourceResponse object. |
Source code in src/aireloom/resources/data_sources_client.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|