Ejemplo n.º 1
0
    def resolve_pid(self, pid, handle_url='hdl.handle.net'):
        """
        Resolve PIDs information accessing the handle resolution system provider
        using HTTP REST API.

        :param pid: PID that has to be resolved
        :param handle_url: Handle system provider address
        (default is hdl.handle.net).
        :return: list of dictionary containing PID information.
        """
        results = pidinfo.get_pid_info(pid, handle_url)
        return results
Ejemplo n.º 2
0
    def get_url_by_pid(self, pid, handle_url='hdl.handle.net'):
        """
        Resolve pid information accessing the handle resolution system provider
        using HTTP REST API.

        :param pid: PID that has to be resolved
        :param handle_url: Handle system provider address
        (default is hdl.handle.net).
        :return: physical URL of the data.
        """
        results = pidinfo.get_pid_info(pid, handle_url)

        pid_list = []
        for ds in results:
            if ds['type'] == 'URL':
                url = ds['data']['value']
                pid_list.append(url)

        return pid_list