hbz / lobid-resources

Transformation, web frontend, and API for the hbz catalog as LOD
http://lobid.org/resources
Eclipse Public License 2.0
8 stars 7 forks source link

ALMA-Fix: Encode path segment to provide resolvable URLs #1521

Closed TobiasNx closed 1 year ago

TobiasNx commented 1 year ago

At the moment:

"hasItem" : [ {
    "label" : "lobid Bestandsressource",
    "type" : [ "Item", "PhysicalObject" ],
    "callNumber" : "61 TYD 16(3)",
    "currentLocation" : "JUE / JUE_Frei",
    "heldBy" : {
      "id" : "http://lobid.org/organisations/DE-A96#!",
      "isil" : "DE-A96",
      "label" : "lobid Organisation"
    },
    "id" : "http://lobid.org/items/990223521400206441:DE-A96:61 TYD 16(3)#!"
  }, {
    "label" : "lobid Bestandsressource",
    "type" : [ "Item", "PhysicalObject" ],
    "callNumber" : "61 TYD 16(3)",
    "currentLocation" : "JUE / JUE_Frei",
    "heldBy" : {
      "id" : "http://lobid.org/organisations/DE-A96#!",
      "isil" : "DE-A96",
      "label" : "lobid Organisation"
    },
    "id" : "http://lobid.org/items/990223521400206441:DE-A96:61 TYD 16(3)#!"
  },

The concatenated id are not encoded as URLs but need to be to be validated by the schema. For doing this we need a function to encode it as URL [edit @dr0i]: we don't encode whole URLs (see morph - encoding whole URLs wouldn't be resolvabale adhoc (e.g. using curl)) but rather the last path segment, which is than suffixed to http://lobid.org/items/990223521400206441:.

dr0i commented 1 year ago

Should be named and working like https://metacpan.org/pod/Catmandu::Fix::uri_encode.

TobiasNx commented 1 year ago

@dr0i : See MF Fix ticket here: https://github.com/metafacture/metafacture-fix/issues/273

TobiasNx commented 1 year ago

This issue becomes deprecated since #1647. URL Encoding in FIX is still a needed feature but for our use case for the item-id is not needed relevant anymore. Pattern for item-id now will be: http://lobid.org/items/[ALMA-MMS-ID of Record]:[ISILofOwner]:[ALMA-MMS-ID of Holding].