Question about serializing a graph to different JSON structures

Hi guys.

I might be a little off-topic here.
But I hope you can help me figure out the JSON-way of doing things.

I maintain a small search engine at search.datao.net.
Try for example http://search.datao.net/?q=tom+cruise

The returned data is JSON.
The tree structure is fixed at the moment:
an array of objects with a _id, a endpoint object, some rdfslabels,
some rdfstypes, some owlsameas.

Now I need to propose different tree structures over the same data.
For example, I want to provide a JSON structure that looks like a map
of "endoints to the objects
of that endpoint".
Or, for example, a JSON structure that looks like a map of "rdfstypes
to the objects of that rdfstype".

I have no clue how to do that.

My idea is to convert the JSON-LD into a graph structure.
And provide a traversal pattern that serializes that graph into the
given tree structure.
(may be Gremlin can help, there?)

Does it sound like something easy to do?
Or something already available off-the-shelf in JSON-LD tools?

Received on Monday, 24 November 2014 10:53:45 UTC