Skip to content

Archival Resource Key (ARK) Identifiers

Requirements

Knora must produce an ARK URL for each resource and each value. The ARK identifiers used by Knora must respect the draft ARK specification. The format of Knora’s ARK URLs must be able to change over time, while ensuring that previously generated ARK URLs still work.

Design

ARK URL Format

The format of a Knora ARK URL is as follows:

http://HOST/ark:/NAAN/VERSION/PROJECT/RESOURCE_UUID[/VALUE_UUID][.TIMESTAMP]
  • HOST: the hostname of the ARK resolver.

  • NAAN: the Name Assigning Authority Number (NAAN) that the ARK resolver uses.

  • VERSION: the version of the Knora ARK URL format being used (always 1 for now).

  • PROJECT: the short code of the project that the resource belongs to.

  • RESOURCE_UUID: the resource's unique ID, which is normally a base64url-encoded UUID, as described in IRIs for Data.

  • VALUE_UUID: optionally, the knora-base:valueHasUUID of one of the resource's values, normally a base64url-encoded UUID, as described in IRIs for Data.

  • TIMESTAMP: an optional timestamp indicating that the ARK URL represents the state of the resource at a specific time in the past. The format of the timestamp is an ISO 8601 date in Coordinated universal time (UTC), including date, time, and an optional nano-of-second field (of at most 9 digits), without the characters -, :, and . (because - and . are reserved characters in ARK, and : would have to be URL-encoded). Example: 20180528T155203897Z.

Following the ARK ID spec, / represents object hierarchy and . represents an object variant. A value is thus contained in a resource, which is contained in its project, which is contained in a repository (represented by the URL version number). A timestamp is a type of variant.

Since sub-objects are optional, there is also implicitly an ARK URL for each project, as well as for the repository as a whole.

The RESOURCE_UUID and VALUE_UUID are processed as follows:

  1. A check digit is calculated, using the algorithm in the Scala class org.knora.webapi.util.Base64UrlCheckDigit, and appended to the UUID.

  2. Any - characters in the resulting string are replaced with =, because base64url encoding uses -, which is a reserved character in ARK URLs.

For example, given a project with ID 0001, and using the DaSCH's ARK resolver hostname and NAAN, the ARK URL for the project itself is:

http://ark.dasch.swiss/ark:/72163/1/0001

Given the Knora resource IRI http://rdfh.ch/0001/0C-0L1kORryKzJAJxxRyRQ, the corresponding ARK URL without a timestamp is:

http://ark.dasch.swiss/ark:/72163/1/0001/0C=0L1kORryKzJAJxxRyRQY

The same ARK URL with an optional timestamp is:

http://ark.dasch.swiss/ark:/72163/1/0001/0C=0L1kORryKzJAJxxRyRQY.20180528T155203897Z

Given a value with knora-api:valueHasUUID "4OOf3qJUTnCDXlPNnygSzQ" in the resource http://rdfh.ch/0001/0C-0L1kORryKzJAJxxRyRQ, and using the DaSCH's ARK resolver hostname and NAAN, the corresponding ARK URL without a timestamp is:

http://ark.dasch.swiss/ark:/72163/1/0001/0C=0L1kORryKzJAJxxRyRQY/4OOf3qJUTnCDXlPNnygSzQX

The same ARK URL with an optional timestamp is:

http://ark.dasch.swiss/ark:/72163/1/0001/0C=0L1kORryKzJAJxxRyRQY/4OOf3qJUTnCDXlPNnygSzQX.20180604T085622513Z

Serving ARK URLs

SmartIri converts Knora resource IRIs to ARK URLs. This conversion is invoked in ReadResourceV2.toJsonLD, when returning a resource's metadata in JSON-LD format.

Resolving Knora ARK URLs

A Knora ARK URL is intended to be resolved by the Knora ARK resolver.
https://docs.knora.org/05-internals/design/api-v2/ark/
docs.knora.org
crawl=CC-MAIN-2020-45
54281
application/http; msgtype=response
sha1:YRIX5S5L25XMI57KA2TV5FEKSS4KKTCE
<urn:uuid:a854b28d-ca87-4b7b-abc3-1a6dabffa3e0>
2020-10-25T13:11:51Z
185.199.108.153
text/html
sha1:KMLM5DSV36ZN5NSVBYNK7BNJKRF6VDBL
<urn:uuid:5332f3e0-9fa5-48f4-b6e8-5f6a68088879>
https://docs.knora.org/05-internals/design/api-v2/ark/
response
<urn:uuid:3506bc6a-a7d2-4cfd-bbed-ce94a39ad483>
isPartOf: CC-MAIN-2020-45
publisher: Common Crawl
description: Wide crawl of the web for October 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-49.ec2.internal
software: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/