News for hackers. Stuff that matters.
Re:Publishing JSON-LD for Developers by lolive on Tuesday May 08, 2018 @07:01PM (#17026098)
The point is that all those problems are strictly worse with plain JSON.
Re:Publishing JSON-LD for Developers by lolive on Tuesday May 08, 2018 @07:06PM (#17026146)
Ok, to be fair, I would say that JSON-LD could solve the problem of sending typed data through the wire once we have typed-contracts between server and client (for example when everybody switches from JS+REST to TS+Swagger).

Imho, JSON-LD is a piece of crap (because it is based on JSON, that is flawed by design). So I would definitely promote the usage of RDF/N3 (and its N3.parse()) as the way to go when you need to transmit typed graphs from server to client.

Note: N3 is a dialect of RDF, that is super easy to serialize and deserialize, that builds graphs of objects in memory (which JSON cannot do, because it can only describe trees). And that (almost always) follows a normalized vocabulary for types, IDs and labels.

Re:Publishing JSON-LD for Developers by lolive on Tuesday May 08, 2018 @07:11PM (#17026173)
Here is a small primer that i wrote on HN about N3: https://news.ycombinator.com/item?id=14476070

(as you can see, nothing very complex :)

Re:Publishing JSON-LD for Developers by lolive on Tuesday May 08, 2018 @07:25PM (#17026248)
Oh, and for your information, N3 has always had a reification syntax. For example:

{ [ x:firstname "Ora" ] dc:wrote [ dc:title "Moby Dick" ] } a n3:falsehood .

PS: yep, there are blank nodes here. PPS: very few parsers take this into account, I agree. But I am pretty sure N3.parse() does.