Re: Merging JSON-LD graphs

> On Oct 11, 2018, at 8:10 AM, Benjamin Young <byoung@bigbluehat.com> wrote:
> 
> FWIW, I contribute to http://levelgraph.io/ <http://levelgraph.io/>
> 
> A simple way to try it out is with this playground:
> https://wileylabs.github.io/levelgraph-playground/ <https://wileylabs.github.io/levelgraph-playground/>
> 
> It puts everything into the levegraph hexastore, and then you can serialize it back out into JSON-LD or N3.
> 
> It's not unlike what you've done by combining two flattened representations--which could just as easily work with something equally as consistent-making. :)

JSON-LD Framing can also do this, as by default, it frames using a “merged” graph [1], so reframing a document with named graphs will result in all of the statements being placed in the default graph.

> By default, framing uses a merged graph, composed of all the node objects across all graphs within the input.

Gregg

[1] https://www.w3.org/TR/json-ld11-framing/#framing-named-graphs

> Anyhow. Hope that's helpful!
> Benjamin
> 
> --
> http://bigbluehat.com/ <http://bigbluehat.com/>
> http://linkedin.com/in/benjaminyoung <http://linkedin.com/in/benjaminyoung>
> From: Martynas Jusevičius <martynas@atomgraph.com>
> Sent: Friday, July 13, 2018 7:58:37 AM
> To: Angelo Veltens
> Cc: public-linked-json@w3.org
> Subject: Re: Merging JSON-LD graphs
>  
> I haven’t used it, but check rdfjs:
> https://github.com/rdfjs <https://github.com/rdfjs>
> On Fri, 13 Jul 2018 at 13.56, Angelo Veltens <angelo.veltens@online.de <mailto:angelo.veltens@online.de>> wrote:
> 
> 
> Am 13.07.2018 um 13:47 schrieb Martynas Jusevičius:
> > I think you mean RDF graphs. We shouldn’t repeat the mistakes that 
> > were made with RDF/XML and conflate the model and the serialization(s).
> 
> Yes, you are right about that!
> 
> >
> > If you read both graphs into an RDF dataset using library such as Jena 
> > or RDF4J or Python’s RDFLib, you can then re-serialize them into a 
> > single file (JSON-LD or other).
> 
> I am working with JavaScript at the moment. Any library recommendations 
> on that?
> 
> Best regards,
> Angelo

Received on Thursday, 11 October 2018 16:23:19 UTC