Fork me on GitHub
#rdf
<
2023-08-11
>
quoll15:08:06

I like to check in on this channel as much as I can, but this past week I’ve been in Chicago for work, and totally missed your question @simongray. Sorry about that!

Max22:08:33

Is there a recommended library for parsing JSON-LD? I saw @quoll’s ttl libraries, but the only ones I found for JSON-LD were grafter which has limited docs and https://github.com/fluree/json-ld which doesn’t seem to be on clojars or maven anywhere

winsome03:08:58

I work at Fluree with the json-ld stuff, our implementation is not yet an official https://www.w3.org/TR/json-ld11-api/ compliant one. I have looked at the java ones, though! • jsonld-java has been around longer and is pretty fast, but does not support JSON-LD 1.1, just 1.0. • titanium-json-ld has full 1.1 support but it is an implementation that targets correctness first, sometimes at the expense of speed. I haven't dug into titanium's implementation to see if there's low-hanging performance fruit, but I do know that 1.1 support is more complex and that may be one of the reasons that jsonld-java hasn't added it yet.

wikipunk18:08:24

Apache Jena uses Titanium (I think) to parse JSON-LD -- You can give the RDF parser a JSON-LD string and get a Jena graph of the RDF triples in it. Using Aristotle you can get a nice EDN representation of the RDF but be aware of blank nodes. What I have done is since I'm using Datomic I assign every blank node a :db/id which is randomly generated and then transact them into the database. But that's unusual.

quoll01:09:06

It’s a month and a half on and I’m wondering how you went @U01EB0V3H39? I’ve been working with the ICD-11 api, which returns JSON-LD, so I ended up going with Titanium. It works, but it’s very frustrating. (Enough so that I’m wondering about trying it for myself) What did you end up using?

Max01:09:51

I ended up finding an ntriples version of the data and used your excellent ttl library to parse it, since ntriples is a subset of ttl. Sorry I can’t help 🤷

quoll01:09:22

No problem. I like Turtle more anyway 🙂

quoll01:09:51

I’m updating Raphael, BTW. It’s about to read from a Reader, and not from a string. I’m gradually working through the tests until I’m satisfied for release. This is allow it to deal with bigger files

🎉 1
Max02:09:51

That will hopefully speed up my data ingestion! Very exciting

quoll02:09:16

I don’t know if it will be FASTER, but can definitely handle MORE 🙂

quoll23:08:30

I’ve been thinking about doing this (since Asami is halfway there with its JSON-triples conversion), but to my knowledge there isn’t one out there. I’d go with a Java one, like https://github.com/jsonld-java/jsonld-java