Types in delete notifications

8 views
Skip to first unread message

Michael Giarlo

unread,
May 7, 2019, 12:43:03 PM5/7/19
to Trellis LDP
Hi,

I have a question about how object types are exposed in notifications. When I create and update e.g. basic containers and non-RDF sources using Trellis 0.8.1, I see notifications emitted like the following:

{"@context":"https://www.w3.org/ns/activitystreams","id":"urn:uuid:9a6ef6ec-9c80-40aa-9310-e220905d4581","type":["http://www.w3.org/ns/prov#Activity","Create"],"actor":["http://www.trellisldp.org/ns/trellis#AnonymousAgent"],"object":{"id":"http://platform:8080/resourceTemplate:foo123:Something:Excellent","type":["http://www.w3.org/ns/ldp#NonRDFSource"]},"published":"2019-05-07T16:06:10.022Z"}

The object ID and object type are correct, as I set them.

With a delete notification, on the other hand, the object type is set to LDP resource:

{"@context":"https://www.w3.org/ns/activitystreams","id":"urn:uuid:baa2b6e8-040f-4820-a790-21ac1383fef5","type":["http://www.w3.org/ns/prov#Activity","Delete"],"actor":["http://www.trellisldp.org/ns/trellis#AnonymousAgent"],"object":{"id":"http://platform:8080/resourceTemplate:foo123:Something:Excellent","type":["http://www.w3.org/ns/ldp#Resource"]},"published":"2019-05-07T16:19:41.464Z"}

I am using these messages, and depending on type values, to index Trellis data into different indices, so if the LDP type on the delete notification is wrong, my delete operations fail because they are running deletes in the wrong indices.

This is true for both basic containers and non-RDF sources. Is this the intended behavior or a bug?

Thanks,

-Mike

Aaron Coburn

unread,
May 7, 2019, 1:18:14 PM5/7/19
to trell...@googlegroups.com
Hi Mike,
You are correct that delete notifications use ldp:Resource as the type value. This is the expected value here, based on the implementation, but you raise a good point about what that value _ought_ to be. The way I had thought about this in the past was: the ldp:BasicContainer (or other type) has been deleted so it's no longer really an ldp:BasicContainer, but it is still an ldp:Resource, so the notification will just use that value. But I think one can make another argument just as easily: this is an ldp:BasicContainer and it has just been deleted. And that second form is, in many ways, easier to understand. Code-wise, it would be trivial to change this.

Are there other thoughts on what this type ought to be? 

Aaron



--
You received this message because you are subscribed to the Google Groups "Trellis LDP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trellis-ldp...@googlegroups.com.
To post to this group, send email to trell...@googlegroups.com.
Visit this group at https://groups.google.com/group/trellis-ldp.
To view this discussion on the web visit https://groups.google.com/d/msgid/trellis-ldp/8e7e403c-6f61-4d38-9a10-30abc5e61274%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Giarlo

unread,
May 7, 2019, 2:13:27 PM5/7/19
to Trellis LDP
Aaron,

Thanks for the explanation and for calling for more discussion.

I welcome others' thoughts on this, too. From my perspective, it was surprising to see the object type change in the delete notification after the create and update. Assuming folks are using these types to make decisions, such as I am, I would hope others might be open to making the change you describe.

-Mike


On Tuesday, May 7, 2019 at 10:18:14 AM UTC-7, Aaron Coburn wrote:
Hi Mike,
You are correct that delete notifications use ldp:Resource as the type value. This is the expected value here, based on the implementation, but you raise a good point about what that value _ought_ to be. The way I had thought about this in the past was: the ldp:BasicContainer (or other type) has been deleted so it's no longer really an ldp:BasicContainer, but it is still an ldp:Resource, so the notification will just use that value. But I think one can make another argument just as easily: this is an ldp:BasicContainer and it has just been deleted. And that second form is, in many ways, easier to understand. Code-wise, it would be trivial to change this.

Are there other thoughts on what this type ought to be? 

Aaron



On Tue, 7 May 2019 at 12:43, Michael Giarlo <michae...@stanford.edu> wrote:
Hi,

I have a question about how object types are exposed in notifications. When I create and update e.g. basic containers and non-RDF sources using Trellis 0.8.1, I see notifications emitted like the following:

{"@context":"https://www.w3.org/ns/activitystreams","id":"urn:uuid:9a6ef6ec-9c80-40aa-9310-e220905d4581","type":["http://www.w3.org/ns/prov#Activity","Create"],"actor":["http://www.trellisldp.org/ns/trellis#AnonymousAgent"],"object":{"id":"http://platform:8080/resourceTemplate:foo123:Something:Excellent","type":["http://www.w3.org/ns/ldp#NonRDFSource"]},"published":"2019-05-07T16:06:10.022Z"}

The object ID and object type are correct, as I set them.

With a delete notification, on the other hand, the object type is set to LDP resource:

{"@context":"https://www.w3.org/ns/activitystreams","id":"urn:uuid:baa2b6e8-040f-4820-a790-21ac1383fef5","type":["http://www.w3.org/ns/prov#Activity","Delete"],"actor":["http://www.trellisldp.org/ns/trellis#AnonymousAgent"],"object":{"id":"http://platform:8080/resourceTemplate:foo123:Something:Excellent","type":["http://www.w3.org/ns/ldp#Resource"]},"published":"2019-05-07T16:19:41.464Z"}

I am using these messages, and depending on type values, to index Trellis data into different indices, so if the LDP type on the delete notification is wrong, my delete operations fail because they are running deletes in the wrong indices.

This is true for both basic containers and non-RDF sources. Is this the intended behavior or a bug?

Thanks,

-Mike

--
You received this message because you are subscribed to the Google Groups "Trellis LDP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trell...@googlegroups.com.

Aaron Coburn

unread,
May 7, 2019, 2:20:53 PM5/7/19
to trell...@googlegroups.com
Mike, I have also opened an issue for this on github: https://github.com/trellis-ldp/trellis/issues/398

The PR that changes the behavior to what you are suggesting is, indeed, trivial.

Thanks again for bringing this up; I think your suggestion to include the specific LDP type (rather than just ldp:Resource) is a better approach.

Best, Aaron
 

To unsubscribe from this group and stop receiving emails from it, send an email to trellis-ldp...@googlegroups.com.

To post to this group, send email to trell...@googlegroups.com.
Visit this group at https://groups.google.com/group/trellis-ldp.

Michael Giarlo

unread,
May 8, 2019, 5:22:08 PM5/8/19
to Trellis LDP
Thanks much, Aaron et al.!
Reply all
Reply to author
Forward
0 new messages