On 06/02/12 22:57, Dick Murray wrote:
Hi Andy and thanks for the added confusion! :-)
So Jena will actively generate namespaces (xmlns:j.x) where it can?
Unless the namespace is already allocated in the model
It
works backwards through the property until it hits a non valid NCName
char and that's the namespace/localname split. The writer must keep
track of the j.n entries for RDF/XML...
i.e. your example gives;
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://example/property/12" >
<rdf:Description rdf:about="http://id.example.org/fred">
<j.0:a813>bob</j.0:a813>
</rdf:Description>
</rdf:RDF>
and adding;
"http://example/property/12b813"
"http://example/d/property/12b813"
gives;
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://example/d/property/12"
xmlns:j.1="http://example/property/12" >
<rdf:Description rdf:about="http://id.example.org/fred">
<j.0:b813>bob</j.0:b813>
<j.1:b813>bob</j.1:b813>
<j.1:a813>bob</j.1:a813>
</rdf:Description>
</rdf:RDF>
As an aside is this to reduce the RDF/XML file sizes or a XML
"normalisation" standard?
No, it's to generate legal XML. The full URI would not make a legal XML
Name token [1]
E.g:
<http://example/property/12b813>bob</http://example/property/12b813>
is not legal XML. And it's even uglier than RDF-XML :)
Ian
[1] http://www.w3.org/TR/REC-xml/#NT-Name