> Hi, I apologize in advance for my bad english. > > I want to produce an RDF like this > > <?xml version="1.0"?> > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns=" > http://somewhere/#"> > <node rdf:ID="a"> > <link rdf:resource="#b" /> > </node> > <node rdf:ID="b"/> > </rdf:RDF> > > But, I do not understand why, this is my output > > <?xml version="1.0"?> > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns=" > http://somewhere/#"> > <node rdf:ID="a"> > <link> > <node rdf:ID="b"/> > </link> > </node> > </rdf:RDF>
They mean the same thing (ie the same set of triples). It's just that the RDF/XML writer has made a particular set of choices for rendering the RDF. RDF-aware code reading those two different outputs won't care about the difference. If it's REALLY IMPORTANT to you that the output looks EXACTLY SO, then you have a certain amount of control over the XML -- see the IO HOWTO. Better not to need to care IMAO. > writer.write(model, System.out, baseURI); This means that when the model is read in, the terms that had namespace http://somewhere/# will have some namespace that depends on where they were read from. This is often a Bad Thing. Chris -- RIP Diana Wynne Jones, 1934 - 2011. Epimorphics Ltd, http://www.epimorphics.com Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT Epimorphics Ltd. is a limited company registered in England (number 7016688)
