Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Excerpt

Fedora generates event messages when a resource is created, updated or deleted. The messages are composed for headers and body. ActivityStreams JSON is now used for message bodies of transmitted events. The new ActivityStreams based JSON-LD uses proper actor values for emitted messages.


Message Headers

Notifications Events:

For every resource whose state is changed as a result of an HTTP operation, there must be a corresponding notification made available describing that change.

Examples

...

titleA minimal notification

...

HeaderDescriptionValuesSample Value
org.fcrepo.jms.user
The Fedora user who made the change.
bypassAdmin
org.fcrepo.jms.eventID
A UUID associated with the event

urn:uuid:2096784f-8915-4f76-9114-10f516553554

org.fcrepo.jms.identifier
The identifier portion of the URI of the changed resource
/test1
org.fcrepo.jms.timestamp
Timestamp in epoch time (milliseconds since January 1st, 1970)

1524580811763

org.fcrepo.jms.baseURL
The base portion of the identifiers URI.
http://localhost:8080/rest
org.fcrepo.jms.resourceType
A comma separated list of URIs identifying the types that describe the resource that changed.

http://www.w3.org/ns/ldp#Container,

http://fedora.info/definitions/v4/repository#Resource,

http://fedora.info/definitions/v4/repository#Container,

http://www.w3.org/ns/ldp#RDFSource,

http://www.w3.org/ns/ldp#BasicContainer


org.fcrepo.jms.eventType
A comma separated list of URIs identifying the event types that describe the resource that changed.

https://www.w3.org/ns/activitystreams#Create,

https://www.w3.org/ns/activitystreams#Update,

https://www.w3.org/ns/activitystreams#Delete

https://www.w3.org/ns/activitystreams#Create,

https://www.w3.org/ns/activitystreams#Update


org.fcrepo.jms.userAgent
The type of client user agent that was used to effect the change to the resource.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36

Message Body

The format of the body is JSON-LD.  

Below is an example of a message emitted on resource creation.

Code Block
{
	/activitystreams",
  "id": "urn:uuid:3c834a8f2096784f-56388915-44124f76-aa4b9114-35ea80416a1810f516553554",
  	"type": ["Create", "Update"],
  	"name": "Resource Creationcreate resource, update resource",
  	"actorpublished": "http://example.org/agent/fedoraAdmin2018-04-24T14:40:11.763Z",
  	"objectactor": [{
    		"type": ["Person"],
		"id": "httpinfo://example.org/fcrepo/rest/resource/path",
    fedora/local-user#bypassAdmin"
	}, {
		"type": ["Application"],
		"name": "Mozilla/5.0 (Macintosh; Intel Mac OS  "ldp:Container",
      "ldp:RDFSource"
    ]
  }
}
Code Block
titleA basic notification with some additional detail
{
  X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
	}],
	"object": {
		"type": ["http://www.w3.org/ns/ldp#Container", "http://fedora.info/definitions/v4/repository#Resource", "http://fedora.info/definitions/v4/repository#Container", "http://www.w3.org/ns/ldp#RDFSource", "http://www.w3.org/ns/ldp#BasicContainer", "http://www.w3.org/ns/prov#Entity"],
		"id": "http://localhost:8080/rest/test1",
		"isPartOf": "http://localhost:8080/rest"
	},
	"@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "isPartOf		"prov": {
        "@id"http://www.w3.org/ns/prov#",
		"dcterms": "http://purl.org/dc/terms/isPartOf",
		"type": "@type",
		"id": "@id",
		"isPartOf":      {
			"@id": "dcterms:isPartOf",
			"@type": "@id"
      		}
    	}]
}

Below is an example of a message emitted on resource update. 

Code Block
{
	
  ],
  "id": "urn:uuid:be29ae69b511e8bc-2134add1-f1b047ac-34bebb6c-2f91b6d1f02920e068b424fc",
  	"type": ["Update"],
  	"name": "Resourceupdate Modificationresource",
  	"published": "20162018-0704-04T1324T17:4658:39Z49.495Z",
	"actor": [{
		"type": "inbox["Person"],
		"id": "httpinfo://example.org/ldn/inbox/path",
  "actorfedora/local-user#bypassAdmin"
	}, {
		"type": ["Application"],
		"name":    {
      "id": "#actor0",
      "curl/7.54.0"
	}],
	"object": {
		"type": ["http://www.w3.org/ns/ldp#Container", "http://fedora.info/definitions/v4/repository#Resource", "http://fedora.info/definitions/v4/repository#Container", "http://www.w3.org/ns/ldp#RDFSource", "http://www.w3.org/ns/ldp#BasicContainer", "http://www.w3.org/ns/prov#Entity"],
		"id": "http://localhost:8080/rest/8e/5c/ce/65/8e5cce65-8272-4046-beb0-b7992bf07828",
		"isPartOf": "http://localhost:8080/rest"
	},
	"@context": ["https://www.w3.org/ns/activitystreams", {
		"prov": "http://www.w3.org/ns/prov#",
		"dcterms": "http://purl.org/dc/terms/",
		"type": "Person@type",
		"id": "@id",
		"isPartOf": {
			"@id": "dcterms:isPartOf",
			"@type": "@id"
		}
	}]
}

Below is an example of a message emitted on resource deletion.

Code Block
{
	"id": "urn:uuid:31410238-7a73-4014-a457-1b6d7df5adac",
	"type": ["Delete"],
	"name": "fedodelete raAdminresource",
    },
    {
      	"published": "2018-04-24T17:51:15.968Z",
	"actor": [{
		"type": ["Person"],
		"id": "#actor1",
      info:fedora/local-user#bypassAdmin"
	}, {
		"type": ["ServiceApplication"],
		"name": "Mozilla/5.0 (Macintosh; Intel Mac  "name": "APIX-core/0.1"
    }
  ],
  OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
	}],
	"object": {
		"type": ["http://www.w3.org/ns/ldp#Container", "http://fedora.info/definitions/v4/repository#Resource",  "id":"http://fedora.info/definitions/v4/repository#Container", "http://www.w3.org/ns/ldp#RDFSource", "http://examplewww.w3.org/fcrepo/rest/resource/path",
    "updated/ns/ldp#BasicContainer", "http://www.w3.org/ns/prov#Entity"],
		"id": "2016-07-04T13:44:39Zhttp://localhost:8080/rest/test1",
    "type": [
      "ldp:Container",
      "ldp:RDFSource",
      		"isPartOf": "http://localhost:8080/rest"
	},
	"@context": ["https://www.w3.org/ns/activitystreams", {
		"prov": "http://examplewww.w3.org/typens/CustomType"
    ],
    "isPartOfprov#",
		"dcterms": "http://examplepurl.org/fcrepodc/rest/"
  }
}terms/",
		"type": "@type",
		"id": "@id",
		"isPartOf": {
			"@id": "dcterms:isPartOf",
			"@type": "@id"
		}
	}]
}

See :

How to Inspect Event Messages Generated by Fedora