7676import org .apache .jena .riot .RDFDataMgr ;
7777import org .apache .jena .riot .RDFFormat ;
7878import org .apache .jena .riot .RDFParser ;
79+ import org .apache .jena .riot .RDFWriter ;
7980import org .apache .jena .riot .RiotException ;
80- import org .apache .jena .riot .WriterDatasetRIOT ;
81- import org .apache .jena .riot .system .PrefixMap ;
82- import org .apache .jena .riot .system .RiotLib ;
8381import org .apache .jena .riot .system .StreamRDF ;
8482import org .apache .jena .riot .web .HttpOp ;
8583import org .apache .jena .sparql .core .DatasetGraph ;
@@ -285,9 +283,6 @@ private boolean canUseCustomJsonLdProfile(final String profile) {
285283 private void writeJsonLd (final OutputStream output , final DatasetGraph graph , final IRI ... profiles ) {
286284 final String profile = getCustomJsonLdProfile (profiles );
287285 final RDFFormat format = canUseCustomJsonLdProfile (profile ) ? JSONLD_COMPACT_FLAT : getJsonLdProfile (profiles );
288- final WriterDatasetRIOT writer = RDFDataMgr .createDatasetWriter (format );
289- final PrefixMap pm = RiotLib .prefixMap (graph );
290- final String base = null ;
291286 final JsonLDWriteContext ctx = new JsonLDWriteContext ();
292287 if (canUseCustomJsonLdProfile (profile )) {
293288 LOGGER .debug ("Setting JSON-LD context with profile: {}" , profile );
@@ -304,7 +299,7 @@ private void writeJsonLd(final OutputStream output, final DatasetGraph graph, fi
304299 ctx .setJsonLDContextSubstitution ("\" " + profile + "\" " );
305300 }
306301 }
307- writer . write ( output , graph , pm , base , ctx );
302+ RDFWriter . create (). format ( format ). context ( ctx ). source ( graph ). output ( output );
308303 }
309304
310305 private String getCustomJsonLdProfile (final IRI ... profiles ) {
0 commit comments