Error: invalid pattern to match

19 views
Skip to first unread message

nicolas treiber

unread,
Apr 19, 2017, 10:01:17 AM4/19/17
to OrientDB
Hi,

I have a weird problem that popped out of nowhere. I have class Pokemon (yeah I work with pokemon data for testing) and a class Type. Each Pokemon has an 'in' relationship with one or multiple types, and a wanted to fetch all the pokemon of a given type (for example "fire"). So i made a query that worked perfectly:
MATCH {class: Pokemon, as: p}.(inE('has_type').outV()){class: Type, as: t} RETURN p, t

but suddenly, without any reason, it does not work anymore, given me the following error: 'invalid pattern to match"
I thought that it may be because of the data (maybe I had made some wrong changes), but the following query perfetcly works:
MATCH {class: Pokemon, as: p}<-has_type-{class: Type, as: t} RETURN p, t
and to me it appears to be exactly the same thing, only a different syntax for the relationship, and I'm pretty sure it's not because of the syntax because i followed the example of the doc (https://orientdb.com/docs/2.2/SQL-Match.html)  and I tested the following query with the data from the doc:
MATCH {class: Person, as: person}.(inE('Friend’).outV()){class: Person, as: friend} RETURN person, friend

Any idea about what black magic just occured ?

Luigi Dell'Aquila

unread,
Apr 19, 2017, 10:15:02 AM4/19/17
to orient-...@googlegroups.com
Hi Nicolas,

Try to remove the parentheses:

MATCH {class: Pokemon, as: p}.inE('has_type').outV(){class: Type, as: t} RETURN p, t

In the meantime I'll check why it doesn't work (it should...)

Thanks

Luigi



--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luigi Dell'Aquila

unread,
Apr 19, 2017, 10:16:20 AM4/19/17
to orient-...@googlegroups.com
About the black magic, I think the query planner is trying to process is from right to left, but when it finds a parenthesis block it fails to traverse it backwards

Thanks

Luigi

nicolas treiber

unread,
Apr 19, 2017, 10:33:35 AM4/19/17
to OrientDB
It works with the parenthesis before so I don't understand why it doesn't anymore.
Also I added the parenthesis in case I have a "while" on the second node, because it didn't because without them
Anyway i tried to remove the parenthesis and it works, but when I add a "while" to the second node i get the same error "invalid pattern to match"... It's really weird, I never had it before
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages