[ckan-dev] Question: APIs to get the URL of a dataset's web page, when we know the resource id of the dataset

Adrià Mercader adria.mercader at okfn.org
Thu Nov 12 15:57:29 UTC 2015


Hi Vittorio,

On CKAN >= 2.3 (which you are using) calling resource_show with your
resource id will return an object that contains "package_id". This is
the dataset id that you need to build the dataset page URL.

For instance:

http://ckan.routetopa.eu/api/action/resource_show?id=07843fc3-07e1-4c66-9be4-fed43ca4a26f

gives you:

http://ckan.routetopa.eu/dataset/58e0c611-8d26-4efe-ad77-af2c7a16234d

Hope this helps,

Adrià



On 12 November 2015 at 15:50, Vittorio Scarano <vitsca at dia.unisa.it> wrote:
> Dear all.
> We are developing (in a EU project called ROUTE-TO-PA) a social
> interface to datasets via CKAN. We are facing this problem and we
> couldn't solve it efficiently (actually the only solution we can
> imagine is to navigate through ALL the datasets, which is too
> expensive). Here are the details.. thanks for the help
>
> Vittorio Scarano
>
>
> Our problem:
>
> Known the “resource_id” of a dataset, is it possible to know, by using
> CKAN API, the URL of the dataset’ s web page.
>
> Example:
>
> Our known dataset API data url is:
>
> “07843fc3-07e1-4c66-9be4-fed43ca4a26f”
>
> So, the resource_id  is known and we would like to know how to use the
> CKAN APIs to build the dataset's page URL, as for example:
>
> http://ckan.routetopa.eu/dataset/openbilancio-provincia-di-prato/resource/07843fc3-07e1-4c66-9be4-fed43ca4a26f
>
> or
>
> http://ckan.routetopa.eu/dataset/58e0c611-8d26-4efe-ad77-af2c7a16234d/resource/07843fc3-07e1-4c66-9be4-fed43ca4a26f
>
>
> The missing part is the "dataset identifier" (i.e.
> openbilancio-provincia-di-prato or
> 58e0c611-8d26-4efe-ad77-af2c7a16234d)
>
>
> --
> ________________________________________________________________________
> Vittorio Scarano
> Dipartimento di Informatica, Università di Salerno (Italy)
>
> Coordinator of ROUTE-TO-PA, EU Horizon 2020 Project
> http://www.routetopa.eu
>
> E-mail:          vitsca at dia.unisa.it
> Homepage:    http://www.dia.unisa.it/professori/vitsca
> ISISLab:        http://www.isislab.it
> Phone :        +39 089 96 9733 (office), 9308 (ISISLab 1), 9307 (ISISLab 2)
> Fax:              +39 089 96 9600
> Address:
> Vittorio Scarano
> Dipartimento di Informatica,
> Via Giovanni Paolo II, 132
> Università di Salerno, Fisciano (SA) -- 84084 ITALY
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev



More information about the ckan-dev mailing list