Fixity and versions in Fedora4

47 views
Skip to first unread message

Adam Wead

unread,
Dec 2, 2014, 6:32:12 PM12/2/14
to Fedora Tech
Hi all,

When you call fcr:fixity for a resource in Fedora4, I’m assuming it’s checking the fixity of just the current version, instead of all of the versions. If we wanted to check the fixity of other versions, would we append the same fcr:fixity call to the labeled version?

This question came up today in regards to getting Sufia’s audits working. Sufia’s notion of audits, under Fedora3, will run fixity checks on every version of a datastream.

…adam


Andrew Woods

unread,
Dec 2, 2014, 7:01:14 PM12/2/14
to fedor...@googlegroups.com
Hello Adam,
Yes, calling /fcr:fixity on a Binary resource (aka Non-RDF Source, aka datastream) calculates the fixity of the current version of that resource:
--------
curl localhost:8080/rest/collection/image/fcr:fixity
--------

If you wanted to check the fixity of other versions, you would indeed simply call /fcr:fixity on the labelled version of that resource (version label below is 'v0'):
--------
curl localhost:8080/rest/collection/image/fcr%3aversions/v0/fcr:fixity
--------
Note, the URL encoding of "fcr:versions" to "fcr%3aversions".

Andrew





…adam


--
You received this message because you are subscribed to the Google Groups "Fedora Tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedora-tech...@googlegroups.com.
To post to this group, send email to fedor...@googlegroups.com.
Visit this group at http://groups.google.com/group/fedora-tech.
For more options, visit https://groups.google.com/d/optout.

Adam Wead

unread,
Dec 3, 2014, 10:40:44 AM12/3/14
to fedor...@googlegroups.com
Andrew,

Thanks, that works. I have to use the URL encoding for “fcr:versions” but not “fcr:fixity”. Seems odd… but it works!

…adam

Andrew Woods

unread,
Dec 3, 2014, 11:38:19 AM12/3/14
to fedor...@googlegroups.com
Hello Adam,
Yes, it is a bit odd indeed. As I am sure you suspect, it boils down to namespaces and the fact that the "fcr" prefix is used to help route REST requests. If you do not URL encode "fcr:versions" in this example, the fixity service interprets the "fcr:versions" directive as a namespaced path element, which it is not exactly. By URL encoding "fcr:versions", it is not interpreted as a namespaced path element. The odd part is why the URL encoding is not being decoded in the path interpretation. But under the circumstances, it is a good thing.

The logic should probably be to decode the URL but recognize the "fcr" prefix and treat it differently. I have put in a ticket:

Thanks,
Andrew
Reply all
Reply to author
Forward
0 new messages