1
votes

I have trouble doing what i want with AQL and Graph queries. I'd like to get some basics examples of AQL on a simple dataset.

For example: Given a collection of actors and a collection of movies. And a actIn edges collection (with a year property) to connect the vertex.

[Actor] <- act in -> [Movie]

How could i get:

  • All actors who acted in "movie1" OR "movie2"
  • All actors who acted in both "movie1" AND "movie2" ?
  • All actors who acted in 3 or more movies wit
  • All common movies between "actor1" and "actor2" ?
  • All actors who acted in 3 or more movies ?
  • All movies where exactly 6 actors acted in ?
  • The number of actors by movie ?
  • The number of movies by actor ?
  • The number of movies acted in between 2005 and 2010 by actor ?

This is simple queries but i don't get how to describe them using AQL.

Any help is welcome and if you have tuts or links to better understand how to get the job done, i'll be glad !

Thanks

1
We have some graph samples in: github.com/triAGENS/ArangoDB-Data - However, the mentioned screencast is a little out of date and doesn't use AQL but the webinterface. Did you already have a look at docs.arangodb.com/Aql/GraphOperations.html ? Its using a small city network as sample. If - what are your problems in understanding the examples? (so we may improve ;-) - dothebart

1 Answers

5
votes

you are right examples for AQL are sparse right now. I have taken your questions here and created a recipe for the ArangoDB cookbook which should answer al of them. Please have a look here: https://docs.arangodb.com/cookbook/GraphExampleActorsAndMovies.html

PS: One of your queries is not complete: All actors who acted in 3 or more movies wit I did not know what to query for.