<br><font size=2 face="sans-serif">Hi Peter, </font>
<br><font size=2 face="sans-serif"> In XML/ABBREV mode, the
serializer uses rdf:Types for element names. Since your example doesn't
have an rdf:Type, it uses the default Jena element names.</font>
<br>
<br><font size=2 face="sans-serif">- Ben</font>
<br>
<br>
<br><font size=2 face="sans-serif">Ben Szekely<br>
IBM Software Engineer<br>
Advanced Internet Technology, Cambridge, MA<br>
bhszekel@us.ibm.com</font>
<br>
<br><tt><font size=2>tdwg-guid-bounces@mailman.nhm.ku.edu wrote on 09/25/2006
11:02:30 AM:<br>
<br>
> Hi Everyone,<br>
> <br>
> Does anyone have/or know of any good examples of using Jena to output<br>
> RDF metadata with non-typical namespaces such as TCS/RDF? <br>
> <br>
> Currently I have the following code for my metadata method(I know
it's<br>
> wrong!).<br>
> <br>
> String TN_NS = "http://tdwg.org/2006/03/12/TaxonNames/";<br>
> ByteArrayOutputStream byteStream = new ByteArrayOutputStream();<br>
> Model model = ModelFactory.createDefaultModel();<br>
> Resource res = model.createResource("http://test");<br>
> res.addProperty(model.createProperty(TN_NS,"testProperty"),"test");<br>
> <br>
> model.write(byteStream, "RDF/XML-ABBREV");<br>
> return new MetadataResponse(new<br>
> ByteArrayInputStream(byteStream.toByteArray()),null,MetadataResponse.RDF<br>
> _FORMAT);<br>
> <br>
> ...which gives me.<br>
> <br>
> <rdf:RDF<br>
> xmlns:j.0="http://tdwg.org/2006/03/12/TaxonNames/"<br>
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><br>
> <rdf:Description rdf:about="http://test"><br>
> <j.0:testProperty >test</j.0:testProperty><br>
> </rdf:Description><br>
> </rdf:RDF><br>
> <br>
> ...whereas I could really do with something along the lines of the
IPNI<br>
> metadata.<br>
> <br>
> <rdf:RDF xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>
> xmlns:dc="http://purl.org/dc/elements/1.1/"<br>
> xmlns:dcterms="http://purl.org/dc/terms/"<br>
> xmlns:tn="http://tdwg.org/2006/03/12/TaxonNames/"<br>
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><br>
> <br>
> <!-- example family (has an unlinked typifying name
withnon-<br>
> standard format data)--><br>
> <tn:TaxonName<br>
> rdf:about="urn:lsid:ipni.org:names:30000959-2:1.1.2.1"><br>
> <tn:nomenclaturalCode rdf:resource="&tn;#botanical"
/><br>
> <dc:title>Amaryllidaceae J.St.-Hil.</dc:title><br>
> <dcterms:created>2004-01-20 00:00:00.0</dcterms:created><br>
> <dcterms:modified>2005-06-23<br>
> 15:45:33.0</dcterms:modified><br>
> <tn:rankString>fam.</tn:rankString><br>
> <tn:nameComplete>Amaryllidaceae</tn:nameComplete><br>
> <tn:uninomial>Amaryllidaceae</tn:uninomial><br>
> <tn:authorship>J.St.-Hil.</tn:authorship><br>
> <tn:publishedIn>Expos. Fam. Nat. 1: 134.
1805 [Feb-Apr<br>
> 1805]</tn:publishedIn><br>
> <tn:year>1805</tn:year><br>
> <tn:typifiedBy><br>
> <tn:NomenclaturalType><br>
> <dc:title>Amaryllis Linnaeus,
nom.<br>
> cons.</dc:title><br>
> </tn:NomenclaturalType><br>
> </tn:typifiedBy><br>
> </tn:TaxonName><br>
> <br>
> I think the main problem I have is creating resources that aren't<br>
> defined as vocabularies within Jena already. I can't seem to find
a way<br>
> to create that <tn:TaxonName root resource element.<br>
> <br>
> I'm starting to think that just outputting vanilla text could be the<br>
> best option here, or am I barking up the wrong tree?<br>
> <br>
> Many thanks, Peter. <br>
> <br>
> Peter Hollas MSc BSc(hons) (Peter.Hollas@thomson.com)<br>
> Software Engineer /Systems Administrator<br>
> Thomson Zoological<br>
> Innovation Centre<br>
> York Science Park<br>
> Heslington<br>
> York<br>
> YO10 5DG<br>
> <br>
> Tel: 01904-435113<br>
> Fax: 01904-435114 <br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> TDWG-GUID mailing list<br>
> TDWG-GUID@mailman.nhm.ku.edu<br>
> http://mailman.nhm.ku.edu/mailman/listinfo/tdwg-guid<br>
</font></tt>