Hello all, I am using Jena 2.6.4, and I am trying to serialize the contents of a Jena model in JSON. Jena documentation indicates this is possible: http://jena.apache.org/documentation/io/index.html#formats. However, I can't find a working example of how to output JSON. The following does not work:
Model m = ModelFactory.createDefaultModel(); .... //add statements to model [not shown] .... outputstream = new ByteArrayOutputStream(); model.write(outputStream, "RDF/JSON"); .... It fails with this error: com.hp.hpl.jena.shared.NoWriterForLangException: RDF/JSON com.hp.hpl.jena.rdf.model.impl.RDFWriterFImpl.getWriter(RDFWriterFImpl.java:119) com.hp.hpl.jena.rdf.model.impl.ModelCom.getWriter(ModelCom.java:243) com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:277) .......... Any help in outputting a model as JSON would be much appreciated. Thanks! Alison
