On 21/07/16 23:44, Martynas Jusevičius wrote:
Hey,
I noticed that after upgrade from 2.11.0 to 3.0.1 the RDF/XML output
changed: element name is used instead of rdf:Description + rdf:type,
rdf:nodeID attribute is gone etc (output below).
The model is written the same way, like this:
model.write(baos, RDFLanguages.RDFXML.getName(), null);
RDFFormat for variants:
RDFDataMgr.write(baos, model, RDFFormat.RDFXML_PLAIN);
Am I right? How do I get the old behavior, i.e. write the plain RDF/XML format?
RDFFormat.RDFXML_PLAIN
Or change the registry?
model.write(System.out, "RDF/XML") ;
RDFWriterRegistry.register(Lang.RDFXML, RDFFormat.RDFXML_PLAIN);
model.write(System.out, "RDF/XML") ;
Andy
I think I have traced 3.0.1 behaviour to
RDFWriterRegistry.defaultSerialization(Lang lang) which chooses
RDFFormat(Lang.RDFXML, ABBREV).
2.11.0
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://purl.org/dc/terms/"
xmlns:j.1="http://www.w3.org/2011/http#">
<rdf:Description rdf:nodeID="A0">
<j.0:title
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Agent not
authorized</j.0:title>
<rdf:type
rdf:resource="http://www.w3.org/2011/http#Response"></rdf:type>
<j.1:reasonPhrase
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Forbidden</j.1:reasonPhrase>
<j.1:sc
rdf:resource="http://www.w3.org/2011/http-statusCodes#Forbidden"></j.1:sc>
<j.1:statusCodeValue
rdf:datatype="http://www.w3.org/2001/XMLSchema#long">403</j.1:statusCodeValue>
</rdf:Description>
</rdf:RDF>
3.0.1
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://purl.org/dc/terms/"
xmlns:j.1="http://www.w3.org/2011/http#">
<j.1:Response>
<j.0:title>Agent not authorized</j.0:title>
<j.1:sc
rdf:resource="http://www.w3.org/2011/http-statusCodes#Forbidden"></j.1:sc>
<j.1:reasonPhrase>Forbidden</j.1:reasonPhrase>
<j.1:statusCodeValue
rdf:datatype="http://www.w3.org/2001/XMLSchema#long">403</j.1:statusCodeValue>
</j.1:Response>
</rdf:RDF>
Martynas
atomgraph.com