cc-devel AT lists.ibiblio.org
Subject: Developer discussion for Creative Commons technology and tools
List archive
[cc-devel] liblicense help: libexempi not reading back some predicates?
- From: Asheesh Laroia <asheesh AT creativecommons.org>
- To: hub AT figuiere.net, cc-devel AT lists.ibiblio.org
- Subject: [cc-devel] liblicense help: libexempi not reading back some predicates?
- Date: Wed, 24 Dec 2008 13:04:37 -0500 (EST)
Howdy Hub (and hello cc-devel, CC:d),
First of all, happy post-Solstice, and merry Christmas! I hope this email finds everyone well.
I'm trying to verify liblicense's support for storing and retrieving predicates in non-CC namespaces, such as dc:creator. I'm having some problems with Exempi that, now that I've spent a fair bit of time looking at alone, I am kind of clueless as to why it doesn't work the way I expect. I wondered if you might be able to help.
To grab the liblicense code I'm confused by, do this:
$ git clone git://code.creativecommons.org/liblicense
$ cd liblicense
$ git branch asheesh-experimental-two origin/asheesh-experimental-two
$ git checkout asheesh-experimental-two
$ git submodule init && git submodule update
$ ./autogen.sh && make check
You'll see one test fails, the predicate read/write test. The specific line that fails is exempi reading back dc:creator. The code path is pretty simple; modules/io/exempi.c's exempi_write() writes the predicate, and exempi_read() in the same file reads it. Exempi prefers to see predicates as a pair of (namespace, name), whereas we prefer to see predicates as atomic URIs; the result is that in modules/io/shared_xmp.c, I have a silly function (which yes, should not return a struct) that splits up a uri into a namespace and a "rest" (a qualified name).
In the test that fails, we attempt to write and read dc:creator.
Note that if you employ this *horrendous hack*, exempi seems to successfully read and write the result. Specifically, if you try to write the invalid predicate of dc:morePermissions instead of dc:creator, it reads back fine. To see this, simply change the ret.rest on line 31 of shared_xmp.c to "_ll_shared_xmp_morepermissions" and re-run "make check".
I'm quite spooked by this and wanted to check in with you, Hubert, to see what you make of it.
-- Asheesh.
P.S. My deepest thanks to you already, Hubert, for your help with other liblicense issues, especially the test suite!
--
Avoid reality at all costs.
- [cc-devel] liblicense help: libexempi not reading back some predicates?, Asheesh Laroia, 12/24/2008
Archive powered by MHonArc 2.6.24.