Hi Pieter, Yes, it is possible to map RDF graphs, and also RDF datasets (collections of graphs with names), to a property graph data model without loss. GraphSail [1] had to do this in order to use Blueprints-based DBs as triple stores, querying over the RDF data and retrieving it. GraphSail uses a mapping almost identical to that of SailGraph [2] (see a schematic on that page), which maps RDF to property graphs. For the "opposite" of GraphSail and SailGraph (i.e. arbitrary property graphs to RDF), see PropertyGraphSail [3].
Olaf Hartig discusses some incompatibilities between PG and RDF in his paper. Some essential things to keep in mind: *) In mapping between PG and RDF, you are forced to treat edges either as resources or as statements. If edges are statements, then any edge properties are lost in the PG-->RDF mapping (unless you were to do something a little weird with named graphs: one graph per statement). If edges are vertices, the RDF format is quite verbose and is not symmetrical with a useful RDF-->PG mapping. PropertyGraphSail supports two styles of mapping: one "verbose" (edge-reified) and the other compact (edges as statements). *) A straightforward RDF(datasets)-->PG mapping treats resources as vertices and statements as edges or as properties depending on the object, but this is more complicated if you want to preserve named graph metadata, as you can't attach metadata to PG properties. You already have a bit of a problem if you want to do anything graph-like with named graph metadata, as PG is not a hypergraph data model (no edges from edges). Best, Josh [1] https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation [2] https://github.com/tinkerpop/blueprints/wiki/Sail-Implementation [3] https://github.com/tinkerpop/blueprints/wiki/PropertyGraphSail-Ouplementation On Mon, Dec 21, 2015 at 11:28 AM, pieter-gmail <[email protected]> wrote: > Thanks, I have just started on the rdf path. > > When you say the RDF data model and PG data model are not 100% aligned > does that mean that for some RDF models to PG model there will be > information loss or just a increase in complexity and efficiency? > > Does the same hold for the other way around PG model to RDF model? > > I'll have a look at your implementation to understand things better. > > Cheers > Pieter > > On 21/12/2015 18:46, Mike Personick wrote: > > The RDF data model and the PG data model are not 100% aligned. I know > > there have been a few academic papers on the subject. For Blazegraph I > am > > using a PG schema built on top of raw RDF. But a raw RDF graph would not > > work with the Blazegraph TP3 interface if it doesn't follow the PG > schema. > > > > On Mon, Dec 21, 2015 at 3:22 AM, pieter-gmail <[email protected]> > > wrote: > > > >> Found this recently, fyi > >> > >> http://arxiv.org/abs/1409.3288 > >> > >> Cheers > >> Pieter > >> > >> On 12/12/2015 16:01, pieter wrote: > >>> Hi, > >>> > >>> I know many rdf vendors are TinkerPop providers. > >>> > >>> Can it work in the other direction, i.e. can a rdf dataset be loaded > >>> into a TinkerPop database? > >>> Is it possible to load any rdf dataset into TinkerPop without loss? > >>> > >>> Is this something TinkerPop is interested in? > >>> > >>> Thanks > >>> Pieter > >>> > >>> > >> > >
