...
Code Block |
---|
language | bash |
---|
title | sesame_sparql.sh |
---|
|
curl -X POST -H "Accept-Encoding: identity" -H "Accept: */*" -H "Content-Type: application/x-www-form-urlencoded" -d update=`cat event2.sparql` http://localhost:8081/openrdf-sesame/repositories/test/statements |
Adding Events to an LDP Container
External audit events can be added to an LDP Container in a repository resource. For each object, create an LDP Container that manages the audit event relationship automatically:
Code Block |
---|
|
curl -X PUT --data-binary @audit_container.ttl -H "Content-type: text/turtle" http://localhost:8080/fcrepo4/rest/foo/audit |
Code Block |
---|
language | xml |
---|
title | audit_container.ttl |
---|
|
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix premis: <http://www.loc.gov/premis/rdf/v1#>
<> a ldp:DirectContainer;
ldp:membershipResource <http://localhost:8080/fcrepo4/rest/foo>;
ldp:hasMemberRelation premis:hasEvent . |
Then, for each event, post the RDF for the event to the audit container:
Code Block |
---|
|
curl -X POST --data-binary @audit_event.ttl -H "Content-type: text/turtle" http://localhost:8080/fcrepo4/rest/foo/audit |
Code Block |
---|
language | xml |
---|
title | audit_event.ttl |
---|
|
@prefix audit: <http://fedora.info/definitions/v4/audit#> .
@prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<> a prov:InstantaneousEvent, premis:Event, audit:ExternalEvent ;
premis:hasEventRelatedAgent "jquser"^^xsd:string, "ImageMagick 6.8.8-9"^^xsd:string, "thumbnail-generator.example.edu"^^xsd:string ;
premis:hasEventType audit:derivativeCreation ;
premis:hasEventRelatedObject <http://localhost:8080/rest/foo> ;
premis:hasEventDateTime "2012-04-30T20:40:40"^^xsd:dateTime . |