RDF4J Newbie question -
When I load this RDF from file:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<foaf:Person>
<foaf:name>My Name</foaf:name>
</foaf:Person>
</rdf:RDF>
using this code
String fileName = "foaf.rdf";
try {
InputStream is = new FileInputStream(fileName);
Model model = Rio.parse(is, "", RDFFormat.RDFXML);
System.out.println();
Rio.write(model, System.out, RDFFormat.RDFXML);
System.out.println();
is.close();
}
catch (Exception ex) {
System.out.println(ex.toString());
}
the output looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:nodeID="node1basf0r6vx1">
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
<foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">My Name</foaf:name>
</rdf:Description>
</rdf:RDF>
How would I go about getting RDF printed out in the original format?