Bug 50497

Summary: [PATCH] Support rdf:resource attributes in XMP
Product: XMLGraphicsCommons - Now in Jira Reporter: brian m. carlson <sandals>
Component: xmpAssignee: XML Graphics Project Mailing List <general>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.4   
Target Milestone: --   
Hardware: PC   
OS: Linux   
Attachments: support for rdf:resource

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!