Skip to content

Commit

Permalink
docs(ark): Document ARK URLs for projects (#1408)
Browse files Browse the repository at this point in the history
* docs(ark): Document ARKs for projects.

* docs(ark): Fix typo.

* docs(ark): Clarify some things.
  • Loading branch information
Benjamin Geer authored Aug 30, 2019
1 parent d0117d8 commit 1dcf06f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
35 changes: 35 additions & 0 deletions docs/src/paradox/03-apis/api-v2/permalinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@ A Knora ARK URL is intended to be resolved by the [Knora ARK resolver](https://g

For details, see @ref:[Archival Resource Key (ARK) Identifiers](../../05-internals/design/api-v2/ark.md).

### ARK URLs for Projects

The format of a Knora project ARK URL is as follows:

```
http://HOST/ark:/NAAN/VERSION/PROJECT
```

`NAAN` is a
[Name Assigning Authority Number](https://tools.ietf.org/html/draft-kunze-ark-22#section-2.3),
`VERSION` is the version number of the Knora ARK URL format (currently always 1),
and `PROJECT` is the project's @ref:[short-code](knora-iris.md#project-short-codes).

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
```

This could redirect to a page describing the project.

### ARK URLs for Resources

The format of a Knora resource ARK URL is as follows:
Expand All @@ -118,6 +140,12 @@ The format of a Knora resource ARK URL is as follows:
http://HOST/ark:/NAAN/VERSION/PROJECT/RESOURCE_UUID[.TIMESTAMP]
```

`NAAN` is a
[Name Assigning Authority Number](https://tools.ietf.org/html/draft-kunze-ark-22#section-2.3),
`VERSION` is the version number of the Knora ARK URL format (currently always 1),
`PROJECT` is the project's @ref:[short-code](knora-iris.md#project-short-codes),
and `RESOURCE_UUID` is the resource's @ref:[UUID](knora-iris.md#iris-for-data).

For example, given the Knora resource IRI `http://rdfh.ch/0001/0C-0L1kORryKzJAJxxRyRQ`,
and using the DaSCH's ARK resolver hostname and NAAN, the corresponding
ARK URL without a timestamp is:
Expand All @@ -143,6 +171,13 @@ The format of a Knora value ARK URL is as follows:
http://HOST/ark:/NAAN/VERSION/PROJECT/RESOURCE_UUID/VALUE_UUID[.TIMESTAMP]
```

`NAAN` is a
[Name Assigning Authority Number](https://tools.ietf.org/html/draft-kunze-ark-22#section-2.3),
`VERSION` is the version number of the Knora ARK URL format (currently always 1),
`PROJECT` is the project's @ref:[short-code](knora-iris.md#project-short-codes),
`RESOURCE_UUID` is the resource's @ref:[UUID](knora-iris.md#iris-for-data), and `VALUE_UUID`
is the value's `knora-api:valueHasUUID`.

For example, 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:
Expand Down
18 changes: 12 additions & 6 deletions docs/src/paradox/05-internals/design/api-v2/ark.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ License along with Knora. If not, see <http://www.gnu.org/licenses/>.

Knora must produce an ARK URL for each resource and each value. The ARK identifiers used
by Knora must respect
[the draft ARK specification](https://tools.ietf.org/html/draft-kunze-ark-18).
[the draft ARK specification](https://tools.ietf.org/html/draft-kunze-ark-22).
The format of Knora’s ARK URLs must be able to change over
time, while ensuring that previously generated ARK URLs still work.

Expand Down Expand Up @@ -66,8 +66,8 @@ http://HOST/ark:/NAAN/VERSION/PROJECT/RESOURCE_UUID[/VALUE_UUID][.TIMESTAMP]
Example: `20180528T155203897Z`.

Following the ARK ID spec, `/`
[represents object hierarchy](https://tools.ietf.org/html/draft-kunze-ark-18#section-2.5.1)
and `.` [represents an object variant](https://tools.ietf.org/html/draft-kunze-ark-18#section-2.5.2).
[represents object hierarchy](https://tools.ietf.org/html/draft-kunze-ark-22#section-2.5.1)
and `.` [represents an object variant](https://tools.ietf.org/html/draft-kunze-ark-22#section-2.5.2).
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.
Expand All @@ -84,9 +84,15 @@ The `RESOURCE_UUID` and `VALUE_UUID` are processed as follows:
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 the Knora resource IRI `http://rdfh.ch/0001/0C-0L1kORryKzJAJxxRyRQ`,
and using the DaSCH's ARK resolver hostname and NAAN, the corresponding
ARK URL without a timestamp is:
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
Expand Down

0 comments on commit 1dcf06f

Please sign in to comment.