Some issues about querying.

55 views
Skip to first unread message

Alex K

unread,
Jun 15, 2016, 3:56:20 PM6/15/16
to cayley-users
Is it possible to query by regexp? Example:

"fruits/apple/1" "is_in" "boxes/1"
"fruits/apple/2" "is_in" "boxes/2"
"fruits/apple/3" "is_in" "boxes/3"
"fruits/limon/3" "is_in" "boxes/1"
"bob" "took" "fruits/apple/2"

How can i query all apples or all fruits except taken by Bob? Is there something like "fruits/*" glob or regexp? Or may be I need to remodel set?

Denys Smirnov

unread,
Jun 16, 2016, 11:25:37 AM6/16/16
to cayley-users
You may just change a model a bit:

"apple/1" "is_in" "boxes/1"
"apple/2" "is_in" "boxes/2"
"apple/3" "is_in" "boxes/3"
"apple/1" "is" "fruit"
"apple/2" "is" "fruit"
"apple/3" "is" "fruit"

And then query for g.V("bob").Out("took").Has("is","fruit")


среда, 15 июня 2016 г., 22:56:20 UTC+3 пользователь Alex K написал:

Alex K

unread,
Jun 16, 2016, 3:38:54 PM6/16/16
to cayley-users


четверг, 16 июня 2016 г., 18:25:37 UTC+3 пользователь Denys Smirnov написал:
You may just change a model a bit:

"apple/1" "is_in" "boxes/1"
"apple/2" "is_in" "boxes/2"
"apple/3" "is_in" "boxes/3"
"apple/1" "is" "fruit"
"apple/2" "is" "fruit"
"apple/3" "is" "fruit"

And then query for g.V("bob").Out("took").Has("is","fruit")

Thank you! This is very interesting db. Sadly that is frozen.
Message has been deleted

Denys Smirnov

unread,
Jun 16, 2016, 3:59:47 PM6/16/16
to Alex K, cayley-users
This should work:

g.V("bob").Out("took").Except(g.V().Has(
"is","fruit"))

чт, 16 июн. 2016 г. в 22:42, Alex K <alexk...@gmail.com>:
One moment. How to set logical nefation?

g.V("bob").Out("took").HasNOT("is","fruit")

--
You received this message because you are subscribed to a topic in the Google Groups "cayley-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cayley-users/vtAlK0Yek1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cayley-users...@googlegroups.com.
To post to this group, send email to cayley...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cayley-users/27cc2b3d-eae4-4947-b4ec-23a14924fb66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex K

unread,
Jun 17, 2016, 1:52:44 AM6/17/16
to cayley-users, alexk...@gmail.com
Thanks!

Robert Melton

unread,
Jun 28, 2016, 9:38:50 AM6/28/16
to cayley-users
On Thursday, June 16, 2016 at 3:38:54 PM UTC-4, Alex K wrote:
Thank you! This is very interesting db. Sadly that is frozen.

Not frozen, it was only resting.  Expect to see lots of movement in the coming weeks.  One of my personal projects regarding it is full text search!
Reply all
Reply to author
Forward
0 new messages