Relationships between OSF objects are represented as URIs in the spirit of IANA link relations (e.g. related, self) per the JSON-API 1.0 spec. The name of the relationship can be thought of as the URI type. For example, a Node may have an affiliated_institutions relationship, and the relationship may carry multiple link relations. One for manipulating the relationship itself (self) and one for retrieving the target of the relationship (related):
{
"affiliated_institutions": {
"links": {
"self": {
"href": "http://localhost:8000/v2/nodes/xug4a/relationships/institutions/",
"meta": {}
},
"related": {
"href": "http://localhost:8000/v2/nodes/xug4a/institutions/",
"meta": {}
}
}
}
}
The type of resource (or resources) targeted by a link are typically clear. Resolving the affiliated_institutions related link will result in a JSON document representing Institutions. However, the type is not always clear, and additional information is required. For example, the target relationship of a comments object may point to another Comment, Node, or Registration:
{
"target": {
"links": {
"related": {
"href": "http://localhost:8000/v2/nodes/y9jdt/",
"meta": {
"type": "nodes"
}
}
}
}
}
In this case, the target relationship will resolve to a Node object as specified in the meta section of the related link object.
The OSF Java client API needs to be updated to support the resolution of relationships that may result in distinct object types.
Relationships between OSF objects are represented as URIs in the spirit of IANA link relations (e.g.
related,self) per the JSON-API 1.0 spec. The name of the relationship can be thought of as the URI type. For example, a Node may have anaffiliated_institutionsrelationship, and the relationship may carry multiple link relations. One for manipulating the relationship itself (self) and one for retrieving the target of the relationship (related):{ "affiliated_institutions": { "links": { "self": { "href": "http://localhost:8000/v2/nodes/xug4a/relationships/institutions/", "meta": {} }, "related": { "href": "http://localhost:8000/v2/nodes/xug4a/institutions/", "meta": {} } } } }The type of resource (or resources) targeted by a link are typically clear. Resolving the
affiliated_institutionsrelatedlink will result in a JSON document representing Institutions. However, the type is not always clear, and additional information is required. For example, thetargetrelationship of acommentsobject may point to another Comment, Node, or Registration:{ "target": { "links": { "related": { "href": "http://localhost:8000/v2/nodes/y9jdt/", "meta": { "type": "nodes" } } } } }In this case, the
targetrelationship will resolve to a Node object as specified in themetasection of therelatedlink object.The OSF Java client API needs to be updated to support the resolution of relationships that may result in distinct object types.