Skip to content

List unresolved references

GET
/models/{modelId}/unresolved-references
curl --request GET \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/unresolved-references \
--header 'Authorization: Bearer <token>'

What this model refers to but does not hold: the placeholders an import left behind for the models it builds on, grouped by the model that would supply them. Each group is keyed either by a source the document stated (a prof:isProfileOf target, an owl:imports that supplied nothing) or, where nothing was stated, by the namespace its members share, and carries the one action that applies as the model stands. Read-only and computed on demand at the model’s main branch head, or at the head of ref when given, like the validation report: a reference stops being unresolved the moment a dependency supplies it, and a ref holds its own dependency set. The path only exists for metamodels that report unresolved references (application profile, the RDF family, NL-SBB); on any other model it is a 404, which is not the same as an empty report.

modelId
required
string format: uuid
ref
string format: uuid

The ref to report at, a model_branch document id, read as GET /models/{modelId}?ref= reads it: a draft is its owner’s alone. When omitted, the model’s main branch is read.

OK

Media typeapplication/json

What one model refers to but does not hold, grouped by the model that would supply it. A report with no groups says the model resolves everything it names — which a model whose metamodel reports nothing at all never gets, since for it the route does not exist.

object
groups
required

The groups, most members first, then by key, so two reads agree.

Array<object>

References that one acquisition would resolve together, and what can be done about them. Exactly one of namespaceKey and declaredSource is set: a stated source outranks the namespaces its terms come from, because an IRI’s namespace does not say which model publishes it.

object
namespaceKey

The namespace the members share — everything up to and including the last # or / of their IRIs. Set only where the document stated no source; null otherwise.

string
nullable
declaredSource

The address the document stated its references come from. Null where the group is keyed by a namespace.

string format: uri
nullable
locatorElementId

The element carrying that address — the row or dependency a surface marks to say what the model is waiting for. Deliberately not one of the members: it names the supplying model rather than a term that model supplies. Null for a namespace group, and for a source no element carries.

string format: uuid
nullable
supplyingDependencyId

The dependency already supplying these references, set exactly when actions is RESOLVE. Resolving matches against one named target, and knowing the references are reachable does not say what to name: a base’s rows are matched in the context of the base itself, so a caller that guessed would leave every chained row unmatched and blame the target for it. Where several dependencies supply the group the first is named, which is a choice between models that all publish the terms. Null where the supplying model still has to be acquired.

string format: uuid
nullable
suggestedMode
required

How this group is best acquired, as a preselection the user may overrule: INTERNAL a model of the workspace’s own (shown as “Managed in your workspace”), EXTERNAL a read-only snapshot fetched from the address (shown as “External snapshot”). Both resolve references equally well; the difference is what the acquired model is afterwards.

string
Allowed values: INTERNAL EXTERNAL
actions
required

What can be done about this group as it stands. One entry: either the supplying model is already reachable or it is not, and offering both would ask a question the model has already answered. RESOLVE — something in the dependency closure publishes these, so they can be wired onto it (offered as an action only where bulk matching is supported). ADD — nothing the model reaches publishes them, so the supplying model has to be acquired first.

Array<string>
Allowed values: RESOLVE ADD
members
required

The references this group accounts for, by IRI then element.

Array<object>

One reference a model makes to something it does not hold.

object
elementId
required

The placeholder element standing in for it, so a surface can mark the row or node carrying it.

string format: uuid
iri
required

The identity the reference names — the only thing a placeholder is sure to know, and what any acquired model is matched against.

string
kindHint

What kind of term the document implied this is (a class, a property), or null where it implied nothing. A hint for display, never a claim the referenced model has to honour.

string
nullable
candidateModels

Models the workspace already holds that define some of this group’s terms, the one defining most first. Present only on a namespace group that still has to be acquired: reachability is computed over the dependency closure, so a model imported last week that publishes exactly these terms reports as ADD although the acquisition has already happened. Restricted to models the asking model could actually depend on — same owner, a metamodel it admits — that declare the group’s namespace and store at least one of its term IRIs on an element that is not a placeholder, so the first of them can be preselected and resolves something. Empty where no such model exists.

Array<object>

A model the workspace already holds that defines terms a group is waiting on. Declaring the group’s namespace is not enough: the model has to store at least one of the group’s term IRIs on an element that is not itself a placeholder.

object
modelId
required
string format: uuid
name
required
string
definedTerms
required

How many of the group’s references the model defines. Candidates are ordered by it, most first, so the first is the one that answers most of the group.

integer
>= 1

Example

{
"groups": [
{
"suggestedMode": "INTERNAL",
"actions": [
"RESOLVE"
]
}
]
}

No such model, or one the caller may not read, or unresolved references are not reported for its metamodel, each answered with the plain problem. Or ref names a ref that is not there for the caller, answered as RefNotFoundProblem: an unknown id, a ref of another model and another user’s draft all get that answer, in the same words, and only on a model the caller may read.

Media typeapplication/problem+json
Any of:

A Problem answered when a ref the request reads at is not there for the caller, on a resource they may read: a ref id that names nothing, a ref of another resource, and another user’s draft, which reads exactly as a ref that does not exist. The draft routes answer it too when the caller holds no draft.

A 404, as a missing resource is, and told apart from one by its type. A resource the caller cannot read keeps the plain answer it always had, whatever ref was named, so this one never says anything about a resource the caller could not see. To a client it means that the ref it was reading, typically a draft committed or discarded in another session, is gone while the resource stays: it goes back to the branch. The problem names no ref, so the answer for an id that names nothing and for another user’s draft is the same, byte for byte.

object
type
required

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
type
required

Stable constant a client branches on, which is what tells this 404 from a resource that is missing or not the caller’s to read.

string format: uri
Allowed values: https://modeldesk.io/problems/ref-not-found

Example

{
"type": "https://modeldesk.io/problems/ref-not-found"
}

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"
}
]
}