trellis-ldp / trellis

Trellis is a platform for building scalable Linked Data applications
https://www.trellisldp.org
Apache License 2.0
105 stars 21 forks source link

AS message produced without provenence / type #57

Closed christopher-johnson closed 6 years ago

christopher-johnson commented 6 years ago

I am working on a new camel-kafka-elasticsearch integration and have noticed a possible issue related with the triplestore resource service event implementation. For some reason (as yet unknown) the event type (e.g. https://www.w3.org/ns/activitystreams#Create) is empty.

Here is an example AS message sourced from Kafka for reference:

{
  "@context" : "https://www.w3.org/ns/activitystreams",
  "id" : "urn:uuid:525573b5-f20f-489d-99dd-33668d3534bb",
  "type" : [ ],
  "object" : {
    "id" : "http://trellis:8080/ldp-test-6b56d629-3150-4ff5-8f69-1efa672f60fb",
    "type" : [ "http://www.w3.org/ns/ldp#RDFSource", "http://www.w3.org/ns/oa#TimeState", "http://www.w3.org/ns/activitystreams#Application", "http://xmlns.com/foaf/0.1/Person", "http://www.w3.org/ns/oa#Choice", "http://www.w3.org/ns/oa#HttpRequestState", "http://purl.org/dc/dcmitype/Sound", "http://www.w3.org/ns/oa#SpecificResource", "http://www.w3.org/ns/oa#TextualBody", "http://www.w3.org/ns/oa#Annotation", "http://www.w3.org/ns/oa#TextPositionSelector", "http://www.w3.org/ns/oa#FragmentSelector", "http://www.w3.org/ns/oa#CssStyle" ]
  },
  "published" : "2018-03-07T07:15:42.159590Z"
}

The target types are populated. The triple is created. Could have a simple explanation, I will keep looking at it.

christopher-johnson commented 6 years ago

It seems that this could be related to reading method for the PreferAudit graph. I notice that the AS message also does not include actor.

Even though the audit triples are created in the <http://www.trellisldp.org/ns/trellis#PreferAudit> graph, a request with the ?ext=audit does not return them (which I guess is the right way to do this, though the documentation suggests alternatively Prefer: return=representation; include="http://www.trellisldp.org/ns/trellis#PreferAudit"

If the fetchAuditQuads method cannot collect any data using ext=audit, then the message values would be empty.

Edit: I just pulled the latest master and noticed that you have already looked at this: https://github.com/trellis-ldp/trellis/commit/f21b9e558bcd546c9b96fae5f5dd602edb3b7e35

Now, I can get the triples using Prefer: return=representation; include="http://www.trellisldp.org/ns/trellis#PreferAudit". AFAIK, the event issue remains, however.

acoburn commented 6 years ago

@christopher-johnson I noticed this last week as I began writing integration tests for the event stream. Technically, this is a duplicate of issue #56, though your description here is very useful. I definitely have this on my radar and I have a plan for addressing it, though I'd like to have #54 merged first. The key things are that the actor and the event types are not present in the event stream and they absolutely should be.

acoburn commented 6 years ago

Resolved via https://github.com/trellis-ldp/trellis/commit/64140d1550e90fc32438f14ca3e7847b40f6b969