1 |
46734
|
sandro.lab
|
import connexion
|
2 |
|
|
from swagger_server.models.ds_type import DSType
|
3 |
|
|
from swagger_server.models.error import Error
|
4 |
|
|
from swagger_server.models.scholix import Scholix
|
5 |
|
|
from datetime import date, datetime
|
6 |
|
|
from typing import List, Dict
|
7 |
|
|
from six import iteritems
|
8 |
|
|
from ..util import deserialize_date, deserialize_datetime
|
9 |
|
|
from swagger_server.eu.dnetlib.DLIESConnector import DLIESConnector
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
def realtion_from_datasource_get(datasource, page=None):
|
13 |
|
|
"""
|
14 |
|
|
Get all scholix relation collected from a datasource
|
15 |
|
|
The realtionFromDatasource endpoint returns a list of scholix object collected from a specific datasource
|
16 |
|
|
:param datasource: the name of the datasource
|
17 |
|
|
:type datasource: str
|
18 |
|
|
:param page: The page of results
|
19 |
|
|
:type page: int
|
20 |
|
|
|
21 |
|
|
:rtype: List[Scholix]
|
22 |
|
|
"""
|
23 |
|
|
c = DLIESConnector('ip-90-147-167-27.ct1.garrservices.it')
|
24 |
|
|
p = 0
|
25 |
|
|
if page:
|
26 |
|
|
p = page
|
27 |
|
|
return c.realtionFromDatasource(datasource, p)
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
def realtion_to_pid_get(pid, pidType=None, page=None):
|
31 |
|
|
"""
|
32 |
|
|
Try to resolve a Persistent identifier
|
33 |
|
|
The realtionToPid endpoint returns a list of scholix object related to a specific persistent identifier
|
34 |
|
|
:param pid: persistent Identifier
|
35 |
|
|
:type pid: str
|
36 |
|
|
:param pidType: Persistent Identifier Type
|
37 |
|
|
:type pidType: str
|
38 |
|
|
:param page: The page of results
|
39 |
|
|
:type page: int
|
40 |
|
|
|
41 |
|
|
:rtype: List[Scholix]
|
42 |
|
|
"""
|
43 |
|
|
c = DLIESConnector('ip-90-147-167-27.ct1.garrservices.it')
|
44 |
|
|
p = 0
|
45 |
|
|
if page:
|
46 |
|
|
p = page
|
47 |
|
|
return c.realtionToPid(pid, pidType, p)
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
def realtion_to_typology_get(typology, page=None):
|
51 |
|
|
"""
|
52 |
|
|
list of all scholix related to a particular typology
|
53 |
|
|
The realtionToTypology endpoint returns a list of scholix object related to a specific typology (dataset, publication, unknown)
|
54 |
|
|
:param typology: type of target object
|
55 |
|
|
:type typology: str
|
56 |
|
|
:param page: The page of results
|
57 |
|
|
:type page: int
|
58 |
|
|
|
59 |
|
|
:rtype: List[Scholix]
|
60 |
|
|
"""
|
61 |
|
|
c = DLIESConnector('ip-90-147-167-27.ct1.garrservices.it')
|
62 |
|
|
p = 0
|
63 |
|
|
if page:
|
64 |
|
|
p = page
|
65 |
|
|
return c.realtionToTypology(typology, p)
|