Bug 50497 - [PATCH] Support rdf:resource attributes in XMP
Summary: [PATCH] Support rdf:resource attributes in XMP
Status: RESOLVED FIXED
Alias: None
Product: XMLGraphicsCommons - Now in Jira
Classification: Unclassified
Component: xmp (show other bugs)
Version: 1.4
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: --
Assignee: XML Graphics Project Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-19 16:26 UTC by brian m. carlson
Modified: 2012-04-10 19:06 UTC (History)
0 users



Attachments
support for rdf:resource (5.39 KB, patch)
2010-12-19 16:33 UTC, brian m. carlson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description brian m. carlson 2010-12-19 16:26:27 UTC
(I'm forwarding bug report #605941 I created for Debian.)

When converting RDF into XMP, libxmlgraphics-commons-java ignores rdf:resource attributes and instead leaves the properties completely empty.  This is  problematic because certain common uses of RDF and XMP (e.g. cc:license attributes) are best used with rdf:resource.  Attached is a patch which parses and emits rdf:resource attributes normally.

Also, while the 2005 specification was not clear on whether rdf:resource was allowed in XMP, the 2008 specification (part 1, section 7.5) makes it clear that it is permissible.
Comment 1 brian m. carlson 2010-12-19 16:33:45 UTC
Created attachment 26422 [details]
support for rdf:resource
Comment 2 Glenn Adams 2012-04-10 19:06:21 UTC
patch landed at http://svn.apache.org/viewvc?rev=1311929&view=rev

n.b. as supplied, the patch produced a regression in junit tests, specifically XMPParserTest.testParseEmptyValues(), which i fixed by ensuring res != null in XMPHandler changes:

                        if ( res != null ) {
                            try {
                                URI resource = new URI(res);
                                getCurrentArray(true).add(resource);
                            } catch (URISyntaxException e) {
                                throw new SAXException("rdf:resource value is not a well-formed URI", e);
                            }
                        }

it would be nice if you could submit an additional patch that extends o.a.x.xmp.XMPParserTest to test the new functionality added by your patch

thanks brian!