Skip to content

Resolve a request path on an organization's catalog to the element it names

GET
/public/catalog/{orgSlug}/resolve
curl --request GET \
--url 'https://api.modeldesk.io/public/catalog/example/resolve?host=example&path=example'

Expands the path into one candidate IRI per namespace the organization has registered, looks the candidates up in the published-IRI index restricted to the organization, and answers with the one publicly visible element or model that carries the IRI. Among several candidates the default namespace’s wins; under one candidate a model holding the IRI itself ranks before one that only holds hash terms under it, then the most recent snapshot wins (a release by when it was cut, a working version by its head commit), and a model carrying the IRI on two elements is passed over for the next. A request for a document IRI answers the terms of the hash vocabulary under it as matches. The index holds latest releases only, so a path it has no answer for falls back to the head IRIs of the organization’s working versions: under version=@working of every model that publishes its working version, and without a pin of the models that have no release and publish it, each head’s canonical IRI included; a pinned release gets no fallback. The namespaces are read live, so a removed namespace stops resolving on the next request. Needs no sign-in.

orgSlug
required
string
host
required
string

The host the catalog received the request on.

path
required
string

The request path relative to the organization’s catalog base, without a leading slash, exactly as the client received it: still percent-encoded, so an escape in it is the IRI’s own. Encoded once more to travel in the query; the server takes that layer off.

version
string

The snapshot of the model to serve, URL-encoded: the name of one of its releases, or @working (exactly, case-sensitive) for its working version, the head of its main branch, when its owner publishes it. Absent, its default snapshot: the latest release, or the working version for a model without a release that publishes it. A pin that matches nothing the model offers answers the same 404 as a model that is not publicly visible. On the resolve operation it names a snapshot the hit’s model has to offer, while the hit itself is found at the latest release.

What the path names. Carries Cache-Control: public, max-age=300 and no entity tag, or public, max-age=60 when working is true, since a save can change the answer.

Media typeapplication/json

What a request path on the catalog host names. An element row at the IRI gives elementId; hash terms under the IRI give matches; an element at a document IRI with terms under it gives both; the model’s canonical-IRI row sets canonical; working says whether the snapshot the answer resolves to is the model’s working version.

object
iri
required

The IRI as the model owner authored it.

string
modelId
required
string format: uuid
canonical
required

Whether the IRI is the model’s canonical IRI, whether or not an element carries it too. The page renders the model page for a canonical hit.

boolean
elementId

The element that carries the IRI itself. Absent exactly when no element does: the model’s canonical row alone, or a document IRI that only has terms under it.

string format: uuid
matches
required

The terms of a hash vocabulary under the resolved document IRI, sorted by fragment. Empty exactly when the request named one IRI outright, fragment included, or no term sits under the document.

Array<object>
object
elementId
required
string format: uuid
fragment
required
string
working
required

Whether the snapshot the answer resolves to is the model’s working version, the head of its main branch: under version=@working, or without a pin for a model that has no release and publishes its working version. The working version changes with every save, so a page rendered for it is kept for one minute rather than five.

boolean

Example generated

{
"iri": "example",
"modelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"canonical": true,
"elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"matches": [
{
"elementId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"fragment": "example"
}
],
"working": true
}
Cache-Control
string

Nothing publicly visible answers: the path is absent, private or under no registered namespace, or no organization carries the slug; the cases are indistinguishable. Carries Cache-Control: public, max-age=60, shorter than a hit, so a release or a registration becomes reachable within a minute.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}
Cache-Control
string

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}