Skip to content

Updating graphs through Fedora REST API

phebal edited this page Oct 5, 2016 · 1 revision

Example of updating ebucore:filename in content metadata:

PATCH: http://127.0.0.1:8983/fedora/rest/dev/05/74/1r/77/05741r77z/content/fcr:metadata

Where the URI can be generated with:

GenericFile.first.content.ldp_source.subject + "/fcr:metadata"

Headers: Content-Type: application/sparql-update

In body: SPARQL query to replace the filename:

PREFIX ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#>
DELETE {
  <> ebucore:filename "<old_filename>" .
}
INSERT {
  <> ebucore:filename "<new_filename>" .
}
WHERE { }

File name can be determined with:

GenericFile.first.content.original_name