Federation: Being specific about target container (Field URIs)
Currently Add
and Remove
activities are sent with the target
property as a target object, like in this test
"target": {
"@type": "foaf:user",
"name": user.get_full_name(),
"@id": user.urlid
}
The target collection is resolved by the rdf_type
of the received object - I can deduce that the nested field is user/projects
because I have a relation to a model with rdf_type of the object hd:project
However if there is are two relations with the model hd:project
, which is being referred to?
For this reason the target should be sent with the URI of the predicate which it is being added to (e.g. hd:circlemember
), as this uniquely identifies the relationship. Currently though, we only store rdf_type
on models
We could achieve this by extending Django's fields to include URIs, but this would require large-scale changes for existing applications to their models. It may be better to create a kind of join table, connecting fields to their URIs e.g. "'djangoldp_circle.circle.member' -> 'hd:circlemember'"
.. I'm currently looking into alternatives, such as providing the information in field metas