Hi Ronald,
Jena used github/jsonld-java for its JSON-LD handling. Providing the
costs aren't going in the translation across the Jena/jsonld-java
boundary, then it is the cost in jsonld-java.
I haven't had the opportunity to check but it has been said that the
JSON-LD algorithms are not cheap.
Are you able to attach visialvm (or similar) and see where the time is
going?
BTW In the next release, Jena will have support for reading JSON-LD 1.1
using the Titanium project.
Andy
On 20/08/2021 08:36, Roland Bailly wrote:
Hello !
I have a question related to the performance of the RDFWriter to JSON LD FRAME
format.
Currently I have to process 40k objects inside in a RDF file. When I process
them into JSON following the code:
JsonLDWriteContext ctx = new JsonLDWriteContext();
JsonLdOptions opts = new JsonLdOptions();
opts.setOmitGraph(true);
opts.setEmbed(Embed.ALWAYS);
opts.setProcessingMode(JSON_LD_1_1);
ctx.setOptions(opts);
RDFWriter.create().format(RDFFormat.JSONLD_FRAME_FLAT).source(graph).context(ctx).build().asString();
I have in average 1 to 10 seconds to process it. It is a bit too slow.
Does someone know how to increase the speed of the process?
Yours faithfully,
Roland Bailly