https://www.w3.org/TeamSubmission/turtle/
Turtle is a subset of N3. N3 has some syntactic sugar plus also some syntax to describe first-order logic statements that include implication and the use of existential and universal qualifiers.
Tim-Berners Lee started work on this software:
which implements reasoning on N3, but it is not particularly performant for a number of reasons -- one is that it does not implement any description logic optimizations, another is that it is written in Python, another is that it doesn't have a particularly sophisticated rules engine.
The closest thing to a standard in this area is ISO Common Logic
https://en.wikipedia.org/wiki/Common_Logic
which is based on KIF but uses RDF for the basic data structures, i.e. you can load RDF data and work on it with Common Logic.
There are plenty of people who use logical reasoning over RDF data but usually they use something specific to their tools, such as the Jena Rules Engine, or some kind of Prolog -- it also is not that hard to stuff RDF data into a SAT solver, theorem prover or similar tools.
It's a conspicuous absense that there is no common standard for production rules.
Oh, and btw, the package is here: https://www.npmjs.com/package/n3
I completely agree that trying to represent a graph structure of data properly into JSON can be inordinately difficult.
What has happened is that people have tried a lot of things and some have succeeded and some have failed. For instance, OWL seems to have become an inpediment to progress rather than a useful tool. On the other hand, people are starting to understand what JSON-LD is and they like it.
See https://developers.google.com/schemas/formats/json-ld
Also note that by simply specifying a namespace to put the terms in you can transform JSON into usable RDF and even put multiple documents in and see them as a comprehensive graph.
is based on similar principles, but more concrete.
Store the graph in rocksdb, transform using the iterator library (only 2-3 transforms currently there, more coming) and then send the "json" over the wire without copy. We're looking at flatbuffers.
JSON format+JSON.parse() make you loose the graph structure of the data you have on your server and that you send to the client. Because it is basically a tree structure.
The Semantic Web defines a graph description langage called N3. If your server can serialize and send the data in such a format, and if you use the function N3.parse() on your client, you eventually retrieve, on the client, a graph of in-memory objects that corresponds to the data graph on your server. You can then traverse that graph in any direction you want.
So basically, with N3, you never lose the graph structure of your data.
And you do not need to restructure your JSON.