cayley icon indicating copy to clipboard operation
cayley copied to clipboard

Easier Way to Get Full Quads in Results

Open ericsliu opened this issue 9 years ago • 11 comments

If I want to get all information from a query, I have to write something like this: graph.Vertex("</en/from_the_terrace>","").Tag("1").Out(["","\u003c/film/film/directed_by\u003e"], "1out2").Tag("2").Out("", "2out3").Tag("3").All();

It would be nice if there were some way to get all the quads related to the query, so that I could make a query like this: graph.Vertex("</en/from_the_terrace>",).Out("\u003c//film/film/directed_by\u003e").All().Quads();

ericsliu avatar Aug 31 '16 20:08 ericsliu

We are discussing one of the possible solutions for this. Will be implemented a bit later one way or another.

dennwc avatar Aug 31 '16 21:08 dennwc

Related topic

dennwc avatar Sep 03 '16 19:09 dennwc

Do we have any insight onto a timeline for a feature like this? We are in need of this as well. We actually talked with Barak in person about this.

carnalim avatar Sep 12 '16 20:09 carnalim

It's relatively easy to make it work like this:

p = g.V("node").In("<rdf:subject>") // now we have links!
// save each quad "direction"
p = p.Save("<rdf:subject>","s").Save("<rdf:predicate>","p").Save("<rdf:object>","o")
arr = p.TagArray()

But all code path should be carefully examined, because it expects only nodes to be returned, not links. Thus it may crash occasionally if we miss something. This is the only time consuming part that I can think of. So, If this solution look good for you (and @barakmich), then I can implement it in a few days.

dennwc avatar Sep 16 '16 12:09 dennwc

If you could get it to return both nodes and links, that would be great. Would there be a way of getting labels as well?

ericsliu avatar Sep 16 '16 16:09 ericsliu

Sure. Labels are the same.

dennwc avatar Sep 16 '16 16:09 dennwc

Any chance this will be in the 0.6 release?

carnalim avatar Oct 04 '16 16:10 carnalim

We already tagged v0.6, so no. I think it will be in a next minor release.

dennwc avatar Oct 04 '16 16:10 dennwc

Any Updates on when we might see this?

carnalim avatar Nov 17 '16 23:11 carnalim

@carnalim Please test #494. It's missing some reversals and Has support, but it works for In/Out/Save.

dennwc avatar Nov 18 '16 20:11 dennwc

https://github.com/cayleygraph/cayley/issues/820 is a step forwards.

iddan avatar Sep 22 '19 02:09 iddan