Can it be as simple as:
select from User
where
out('has_job') in ( select @rid from ( traverse out(E) from Job where
name = 'Engineer' ) )
and
out('located_in') in ( select @rid from ( traverse out(E) from Location
where name = 'Canada ) )
- Can I use out('has_job') in a where clause?
- What if there are multiple? Does in support collection in collection, or
must I use intersect?
On Friday, October 24, 2014 1:29:30 PM UTC-4, Doug Moscrop wrote:
>
> Hello,
>
> First a quick thanks for OrientDB!
>
> Given a set of vertices (that varies by query) I need to find all the
> vertices that contain paths to all of those target vertices.
>
> So, naively I feel like I could just run N queries (one for each target
> vertex) then find the intersection. Can I do this at the database instead?
>
> I feel like I am over-thinking the solution, but all of my searches
> inevitable take me to shortest path type problems, which is not the case
> here unless I am mistaken.
>
> For use case, imagine we have stored some kind of location hierarchy, like:
>
> Canada -> Ontario
> \-> British Columbia
>
> as well as a job one:
>
> Engineer -> Software Engineer
> \-> Hardware Engineer
>
> A vertex Person can have edges to jobs and functions, I want to be able to
> find (as an example)
>
> - All Software Engineers in Ontario
> - All Hardware Engineers in Canada
>
> Sorry if this should be really obvious. Thanks again.
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.