• <dcterms:identifier rdf:resource="&xxx;type#TheDataValue"/>
The xxx entity abbreviation must be declared outside the RDF core, in the XML DOCTYPE main node. Something like:
<!DOCTYPE rdf:RDF [
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY xxx "http://someurl.org/path/path">
So, the question is: how to implement this in Jena, considering Jena RDF write just outputs the RDF tree...?
As shown in this Jena file i/o how-to, Jena provides some advanced output configuration options that can control the generation of those items.
Indeed, there are two options that can be useful in generating the extra ENTITY references.
"If true, an XML Declaration is included in the output, if false no XML declaration is included. The default behaviour only gives an XML Declaration when asked to write to an OutputStreamWriter that uses some encoding other than UTF-8 or UTF-16. In this case the encoding is shown in the XML declaration. To ensure that the encoding attribute is shown in the XML declaration either:
Set this option to true and use the write(Model,Writer,String) variant with an appropriate OutputStreamWriter.
Or set this option to false, and write the declaration to an OutputStream before calling write(Model,OutputStream,String)."