Parsing dc:creator and dcterms:creator

21 views
Skip to first unread message

Elliot Metsger

unread,
Dec 3, 2009, 4:40:03 PM12/3/09
to foresite
Hi all,

ResourceMapJena.getCreators() currently only parses dc:creator (from
http://purl.org/dc/elements/1.1/).

It's my understanding that dcterms:creator (from http://purl.org/dc/terms/)
is semantically equivalent to dc:creator, and therefore
ResourceMapJena.getCreators() should look for both? I have a patch,
but it seems that the Jena DCTerms class is missing the creator
property...

Here's a sample ReM and testcase which currently fails with Jena 2.5.5
and Foresite (java trunk):
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info://ResourceMap">
<rdf:type rdf:resource="ore:ResourceMap"/>
<ore:describes rdf:resource="info://Aggregation"
xmlns:ore="http://www.openarchives.org/ore/terms/"/>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/"
rdf:parseType="Resource">
<foaf:name xmlns:foaf="http://xmlns.com/foaf/0.1/">bob
barker</foaf:name>
</dc:creator>
<dcterms:creator rdf:parseType="Resource"
xmlns:dcterms="http://purl.org/dc/terms/">
<foaf:name xmlns:foaf="http://xmlns.com/foaf/0.1/">datapub
web app</foaf:name>
</dcterms:creator>
</rdf:Description>
</rdf:RDF>

final File testCase004 = new File( testCaseDir, "testcase-004.xml" );
final ResourceMap rem = parser.parse( new FileInputStream
( testCase004 ) );
final List<Agent> creators = rem.getCreators();

assertEquals( 2, creators.size() );
final Set<String> names = new HashSet<String>();

for ( Agent creator : creators )
{
names.addAll( creator.getNames() );
}

assertEquals( 2, names.size() );
assertTrue( names.contains( "bob barker" ) );
assertTrue( names.contains( "datapub web app" ) );
Reply all
Reply to author
Forward
0 new messages