|
|
|
@ -30,31 +30,100 @@ struct rdf_enum types = {
|
|
|
|
|
struct rdf_serialize_field ap_object_rdf[];
|
|
|
|
|
|
|
|
|
|
static struct rdf_serialize_field activity_ref_types[] = {
|
|
|
|
|
{ (char*)apaot_ref, offsetof( struct ap_object, object.ref ), &rdf_string_field },
|
|
|
|
|
{ (char*)apaot_activity, offsetof( struct ap_object, object.ptr ), &rdf_object_field, &ap_object_rdf },
|
|
|
|
|
{
|
|
|
|
|
.predicate = { (char*)apaot_ref, "" },
|
|
|
|
|
.offset = offsetof( struct ap_object, object.ref ),
|
|
|
|
|
.type = &rdf_string_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { (char*)apaot_activity, "", },
|
|
|
|
|
.offset = offsetof( struct ap_object, object.ptr ),
|
|
|
|
|
.type = &rdf_object_field,
|
|
|
|
|
.subtype = &ap_object_rdf
|
|
|
|
|
},
|
|
|
|
|
{ NULL },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define OBJ_TYPE struct ap_object
|
|
|
|
|
struct rdf_serialize_field ap_object_rdf[] = {
|
|
|
|
|
{ "", offsetof( OBJ_TYPE, id ), &rdf_id_field },
|
|
|
|
|
{ "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>", offsetof( OBJ_TYPE, type ), &rdf_enum_field, &types },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#actor>", offsetof( OBJ_TYPE, actor ), &rdf_string_ref_field },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#content>", offsetof( OBJ_TYPE, content ), &rdf_string_field },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#published>", offsetof( OBJ_TYPE, published ), &rdf_date_field },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#to>", offsetof( OBJ_TYPE, to ), &rdf_array_of_field, &rdf_string_ref_field },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#cc>", offsetof( OBJ_TYPE, cc ), &rdf_array_of_field, &rdf_string_ref_field },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#bcc>", offsetof( OBJ_TYPE, bcc ), &rdf_array_of_field, &rdf_string_ref_field },
|
|
|
|
|
{ "<https://www.w3.org/ns/activitystreams#object>", offsetof( OBJ_TYPE, object.tag ), &rdf_tagged_union_field, activity_ref_types },
|
|
|
|
|
{ NULL, sizeof(struct ap_object) },
|
|
|
|
|
{
|
|
|
|
|
.predicate = {
|
|
|
|
|
"", ""
|
|
|
|
|
},
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, id ),
|
|
|
|
|
.type = &rdf_id_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<http://www.w3.org/1999/02/22-rdf-syntax-ns#", "type>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, type ),
|
|
|
|
|
.type = &rdf_enum_field,
|
|
|
|
|
.subtype = &types
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "actor>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, actor ),
|
|
|
|
|
.type = &rdf_string_ref_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "content>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, content ),
|
|
|
|
|
.type = &rdf_string_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "published>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, published ),
|
|
|
|
|
.type = &rdf_date_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "to>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, to ),
|
|
|
|
|
.type = &rdf_array_of_field,
|
|
|
|
|
.subtype = &rdf_string_ref_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "cc>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, cc ),
|
|
|
|
|
.type = &rdf_array_of_field,
|
|
|
|
|
.subtype = &rdf_string_ref_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "bcc>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, bcc ),
|
|
|
|
|
.type = &rdf_array_of_field,
|
|
|
|
|
.subtype = &rdf_string_ref_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<https://www.w3.org/ns/activitystreams#", "object>" },
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, object.tag ),
|
|
|
|
|
.type = &rdf_tagged_union_field,
|
|
|
|
|
.subtype = activity_ref_types
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { NULL, NULL },
|
|
|
|
|
.offset = sizeof(struct ap_object)
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
#undef OBJ_TYPE
|
|
|
|
|
|
|
|
|
|
struct rdf_serialize_field ap_signature_rdf[] = {
|
|
|
|
|
{ "", 0, &rdf_id_blank },
|
|
|
|
|
{ "<http://purl.org/dc/terms/creator>", offsetof( struct ap_signature, creator ), &rdf_string_ref_field },
|
|
|
|
|
{ "<http://purl.org/dc/terms/created>", offsetof( struct ap_signature, created ), &rdf_date_field },
|
|
|
|
|
{ NULL },
|
|
|
|
|
{
|
|
|
|
|
.predicate = {"", "" },
|
|
|
|
|
.offset = 0,
|
|
|
|
|
.type = &rdf_id_blank
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<http://purl.org/dc/terms/", "creator>" },
|
|
|
|
|
.offset = offsetof( struct ap_signature, creator ),
|
|
|
|
|
.type = &rdf_string_ref_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { "<http://purl.org/dc/terms/", "created>" },
|
|
|
|
|
.offset = offsetof( struct ap_signature, created ),
|
|
|
|
|
.type = &rdf_date_field
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.predicate = { NULL, NULL }
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|