Skip to content

Get a model's RDF projection

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

Returns the RDF-projection datoms of the model at its branch head, or at the head of ref when given, with the element-to-subject index, the vocabulary naming its metamodel’s RDF rendering declares (absent where the rendering declares none), and the projected commit id. Dependencies are expanded, because subject IRIs may resolve through elements in imported models. A metamodel with no registered RDF rendering is a 400 carrying the UNSUPPORTED_METAMODEL code. Computed on read; persists nothing.

modelId
required
string format: uuid
ref
string format: uuid

The ref to project the model 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

A model’s RDF projection at its branch head, as the query engine takes it.

object
commitId
required

The head commit the projection was taken at, for keying a client-side cache.

string format: uuid
datoms
required

The projection’s facts, each an [entity, attribute, value] triple.

Array<array>
subjectsByElementId
required

The subject IRI each element projects to, keyed by element id.

object
key
additional properties
string
naming

The vocabulary naming the metamodel’s RDF rendering declares, so a surface can write a query for an attribute or relation by its predicate. Absent for a metamodel whose rendering declares none.

object
types
required

The naming of each element type, keyed by the type’s name.

object
key
additional properties

How one element type and its properties are named in RDF.

object
class

The IRI of the class an element of the type is typed with. Absent for a type that is no class.

string
attributes
required

The predicate IRI of each attribute, keyed by the attribute’s name.

object
key
additional properties
string
relations
required

The naming of each relation, keyed by the relation’s name.

object
key
additional properties

How one relation is named in RDF.

object
predicate
required

The predicate IRI.

string
inverse
required

Whether the triple runs from the target to the source.

boolean
sharedPredicates

Predicates more than one property of the type is named by, which a query cannot read back to one property. Absent when there are none.

Array<string>

Example generated

{
"commitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"datoms": [
[
"example"
]
],
"subjectsByElementId": {
"additionalProperty": "example"
},
"naming": {
"types": {
"additionalProperty": {
"class": "example",
"attributes": {
"additionalProperty": "example"
},
"relations": {
"additionalProperty": {
"predicate": "example",
"inverse": true
}
},
"sharedPredicates": [
"example"
]
}
}
}
}

Bad request

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

The caller may not read the model. Such a caller is refused with this or with the plain 404, never with RefNotFoundProblem, and with ref which of the two can depend on the ref named: a ref the model has can meet the model’s read check and its 403, while one it does not have answers 404.

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

The model does not exist, or the caller may not read it and is refused here rather than with the 403, 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"
}
]
}