When writing a Model to an RDF string, I currently do something like this:

1.      Use the model.listNameSpaces() method to get the list of namespaces 
used --- this doesn't include namespaces used in URI's in the object position 
of triples

2.      Manually add the missing namespaces for URI's in the object position of 
triples

3.      Assign prefixes to each namespace

4.      Use the model.setNsPrefixes(prefixToNamespaceMap) method to update the 
Model accordingly

5.      Write the Model to an RDF string

Is there any way to avoid step 3 by having Jena auto-generate prefixes for 
namespaces used within the model (including URI's in the object position)?  If 
not, is there an alternative to model.listNameSpaces() that will also return 
namespaces used in URI's in the object position of triples?

Thanks!

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may 
contain information that is privileged, confidential and/or proprietary and 
subject to important terms and conditions available at 
http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended 
recipient, please delete this message.

Reply via email to