Page MenuHomeSoftware Heritage

Add possibility to fetch last SWHID for a deposit using an origin on deposit cli
Open, NormalPublic

Description

In IPOL for article #300, this information is added to the entry:

sw_id="swh:1:dir:03d81d9e8d583aa52bfe5a696c875a406571684c"
sw_origin="origin=https://doi.org/10.5201/ipol.2020.300"
sw_visit="visit=swh:1:snp:e3c3904624230050561a3c5a615b3852fda6a22c"
sw_anchor="anchor=swh:1:rev:2bda715d58c19bfc04bac7028a5c67780f177cd3"
sw_title="Implementation of the LLCC method for image enhancement"
sw_authors="Jose-Luis Lisani"
sw_date="2018-01-01"
sw_license="AGPL-3.0-or-later"
sw_version="2.0"

The fields origin, title, authors, date, license and version can be easily retrieved from the IPOL description file.

But the id, anchor and visit fields are more difficult to retrieve.

Use case
An editor is trying to find out the simplest way to create a script that gives me the SWHID information for each deposited article. I kept all the deposits IDs, so there is no problem in using this information and the 'swh deposit status' command. I was just wondering if there was a more direct option using as query the 'slug'.

The slug is a.k.a the origin.

SWH answer in January:

Using the deposit-id is best because it identifies one artifact, when giving a slug(which creates an origin) it has the capacity to accept multiple versions of an artifact for one origin.
A request using the origin, can potentially return a list of SWHIDs or the last deposit, which might be ambiguous.
We will reflect on the possibilities to implement this functionality and get back to you.