I'm stuck with this version because the latest SPIN API (1.4.0) is using it and last I heard Holger said he's not planning an upgrade :/
I registered the writer like this: RDFLanguages.register(RDFLanguages.JSONLD); RDFWriterRegistry.register(new RDFFormat(RDFLanguages.JSONLD), new JSONLDWriterFactory(jsonLdTemplates)); https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/client/Application.java#L145 I can do a pre-check by attempting ModelFactory.createDefaultModel().getReader() and catching the exception. But it's not very elegant. On Tue, Dec 22, 2015 at 1:35 PM, Andy Seaborne <[email protected]> wrote: > Unclear. > > 1/ 2.11.0 is old. Use a later version with JSON-LD built-in. > > 2/ You may need to use RDFDataMgr. > > Not sure at 2.11.old whether Lang registration interacted with the Jena > RDFReaderFImpl. > > 3/ Not clear what you registered and how. > > 4/ Did you call RIOT.init()? Maybe needed. > > Andy > > > > On 21/12/15 17:25, Martynas Jusevičius wrote: >> >> Hey, >> >> I have a situation where I register a new Lang (JSON-LD) in Jena >> 2.11.0 but I only have a Writer for it, not a Reader. How can I check >> whether Reader exists for a certain Lang before doing the actual read? >> >> Right now I get an exception: >> >> com.hp.hpl.jena.shared.NoReaderForLangException: JSON-LD >> at >> com.hp.hpl.jena.rdf.model.impl.RDFReaderFImpl.getReader(RDFReaderFImpl.java:100) >> at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274) >> >> Thanks, >> >> Martynas >> >
