On 25/02/13 17:17, Rob Vesse wrote:
Hi Joshua

You should be able to wire up RDF/JSON so it can be used by Model.read()
and Model.write() by calling the following:

IO_Jena.wireIntoJena();

If you call RIOT.init() anywhere in your code (or call ARQ.init() which
will call RIOT.init()) then this will already be called for you.

Then you should be able to do model.read(in, null, "RDF/JSON");

Rob

As of 2.10.0:

m.read("D.rj") ; //.rj is the extension for RDF/JSON.

m.read("D.rj", "RDF/JSON")

etc etc.

will read RDF/JSON.

No need to call RIOT.init or IO_Jena.wireIntoJena.

Wiring in RIOT happens automatically.

        Andy




On 2/25/13 9:00 AM, "Joshua TAYLOR" <[email protected]> wrote:

On Mon, Feb 25, 2013 at 10:28 AM, Andy Seaborne <[email protected]> wrote:
1/ Jena 2.6.4 is quite old and IIRC has no RDF/JSON support, read or
write.

2/ The RDF/JSON writer (Jena 2.10.0 and 2.7.*) is accessed via
RDFJSONWriter.write(....)

(this will change quite soon to include model.write(...,"RDF/JSON") but
it
is not in 2.10.0)

In another thread I mentioned that there were some things that I won't
be able to test for a while yet (need to be able to build first, :) ),
and RDFJSON serialization is one of them.  I had already found
RDFJSONWriter.write (which cleans up a number of things;  thanks!).
I'd hoped for reading,

    model.read( InputStream in, String base, String lang )

would work as

    model.read( in, null, "RDF/JSON" )

but hearing that write.( ..., "RDF/JSON" ) isn't there yet, I'll ask,
how should RDFJSON be *read* into a model?

//JT


--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/


Reply via email to